Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all; close all; clc;
- %parametry symulacji
- h=0.2;
- tu_max=40;
- ts_max=20;
- tan_min=0;
- tan_max=4;
- tan_step=h;
- %obiekt rzeczywisty (5 krotna inercja)
- loc=0.7;
- moc=conv(conv([1 2 1],[1 2 1]),[1 1]);
- %sterowanie
- tud=0:h:tu_max;
- Tn=40;
- Au=1;
- bn=0.5;
- fn=1/Tn;
- u=Au*sin(2*pi*fn*tud);
- % amplituda szumu pomiarowego
- An=0.6;
- %odp identyfikacyjna
- ys=lsim(loc,moc,u,tnd)+ An*randn(size(tnd));
- %identyfikacja MNK
- n_min=ceil(tan_min/h);
- n_max=floor(tan_max/h);
- n_Step=ceil(tan_step/h);
- nn=n_min:n_step:n_max;
- J_opt=inf;
- Ji=zeros(size(nn));
- i=1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement