My Simulink results of a delayed discrete transfer function differs from lsim output
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to simply simulate a model I obtained from the system identification toolbox. The model is a discrete model with an input delay. However, the results from simulating with the command 'lsim' is different from what I get from simulink. The output from 'lsim' is similar to what I expect to get but the results from the simulatiom is wrong. I am simulating the model both in MATLAB and SIMULINK with the input 'u' which is a two-column matrix with the first column for the simulation time and the second column for the corresponding input.
>> tf1=tf([0,5.1095],[1,-1.9924,0.9924],1,'IODelay',261)
tf1 =
5.109
z^(-261) * ----------------------
z^2 - 1.992 z + 0.9924
Sample time: 1 seconds
Discrete-time transfer function.
>> y_lsim=lsim(tf1,u(:,2),u(:,1));
>> out=sim('system_simulation.slx');
A view from the simulink file ''system_simulation.slx'' :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/597385/image.png)
Solver is fixed-step with 1s as the step time.
>> plot(out.tout,y,out.tout,y_lsim,'r--')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/597390/image.png)
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Simulation and Prediction finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!