フィルターのクリア

Different Answers from Matlab and Simulink

2 ビュー (過去 30 日間)
Mrudul Agrawal
Mrudul Agrawal 2020 年 11 月 5 日
回答済み: Raunak Gupta 2020 年 11 月 10 日
I have a script of matlab solving 2 double order dependant differential equation. Now I want to solve same in simulink, I have developed a model in simulink but it is not giving me correct graph. Kindly someone help me in debugging the model.
PFA for matlab and simulink code.
Th equations are:
dhdt = hdot
dhdotdt = (1/m/l)*(m*g*h + m/M*(-Kp.*h - Kd.*hdot - b.*xdot + m*g.*h))
dxdt = xdot
dxdotdt = (1/M)*(-Kp*h - Kd*hdot - b*xdot + m*g*h)

採用された回答

Raunak Gupta
Raunak Gupta 2020 年 11 月 10 日
Hi,
From the files I can see there is a difference while you plot both the outputs. In the MATLAB file x is plotted correctly as in Simulink file. The h is plotted as it is Simulink whereas it is multiplied by 180/pi while plotting in MATLAB. Since you scaled the h value in .m file, the tilt on x is not visible due to small value. You can maybe remove the scaling from MATLAB Script or add the scaling as a gain block in Simulink to match the results.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBlock Libraries についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by