[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems with Arx-algorithm
From: |
Lukas Reichlin |
Subject: |
Re: Problems with Arx-algorithm |
Date: |
Sun, 18 May 2014 07:50:19 +0200 |
On 14.05.2014, at 10:58, Flo89 <address@hidden> wrote:
> Hello,
>
> I did some measurements and data analysis on a system. Now I want to let
> octave calculate a transfer function with arx algorithm but I'm running into
> problems.
> Here's the code:
>
> InputData =
> dlmread('/home/flo/Dokumente/Octaveprojects/c_output_frequencies_high_speed.csv','\t');
> input = InputData(:,1);
> input_short = input(10 : 10 : end);
> output = InputData(:,2);
> output_short = output(10 : 10 : end);
>
> sampletime = 1/(200000)*10;
> t = 0 : sampletime :sampletime*(rows(input_short)-1);
> dat = iddata(output_short, input_short, sampletime);
>
> [sys, x0] = arx(dat, 'na',i, 'nb', l);
> [y, t, x] = lsim (sys,input_short,t,x0);
> figure
> plot(t,y,'r');
> hold on;
> plot(t,output_short,'g');
>
> I'm doing this for example in two for loops to find good values for na and
> nb. But if I'm doing na = 6 and nb = 1 to nb = 6 theres always the same
> simulated system. I doubt it will ever chance when changing the parameters.
> So my question is: What am I doing wrong in general?
> And the second: I knot that the delay between input and output is around 100
> sampletimes. Is nk then 100?
>
> Here are images of the real system:
> <http://octave.1599824.n4.nabble.com/file/n4664059/real_system.png>
> And here of the real output and the simulated one:
> <http://octave.1599824.n4.nabble.com/file/n4664059/simulated.png>
>
> Thank you!
Hi Florian
Could you please send me the file "c_output_frequencies_high_speed.csv"? I
would like to run some tests. Note that the "iddata" class has a "resample"
method (help @iddata/resample). Regarding the second question: Yes, "nk" should
be 100 in your case.
Lukas