![untitled.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200338/untitled.jpeg)
Discrepancy between MATLAB and Simulink closed loop response?
1 次查看(过去 30 天)
显示 更早的评论
I have a closed loop system which I am testing in MALTAB and Simulink, expecting the same output.
**MATLAB**
num_plant = [0.0001 10];
den_plant = [0.005 5 0.6616 61.01 2.11 20];
G1 = tf(num_plant, den_plant)
num_controller = [46615 6526 5.722e05 2.389e04 2.001e05]
den_controller = [1 404 41605 162000 200000]
C2 = tf(num_controller, den_controller)
G2=G1*C2; %G1 is same 5th order TF as Simulink
new2 = feedback(G2, 1);
step(new2)
Note:
G1 =
0.0001 s + 10
--------------------------------------------------------
0.005 s^5 + 5 s^4 + 0.6616 s^3 + 61.01 s^2 + 2.11 s + 20
C2 =
46615 s^4 + 6526 s^3 + 572200 s^2 + 23890 s + 200100
----------------------------------------------------
s^4 + 404 s^3 + 41605 s^2 + 162000 s + 200000
![2.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200336/2.png)
**SIMULINK**
![1.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200337/1.png)
----------
According to the official documentation, feedback should be doing what I am presenting with blocks in Simulink. Surely I am missing something. I checked the code and everything should be the same in both cases. What is the reason for this discrepancy?
2 个评论
Aquatris
2019-1-7
What version of Matlab are you using?
I used the script (coppied your code without change other than adding grid on) in Matlab 2013a and the result looks identical to your simulink results.
![untitled.jpg](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200338/untitled.jpeg)
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!