Matlab script of the Simulink continuous-time integral
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I am trying to rewrite a Simulink block codes into a MATLAB script. I am not sure how the Simulink continusous-time integral works.
Here are first five rows of my inputs and outputs of the Simulink continuous integral block:
Integral inputs : [0,-10061562.4942636,14046.7032856068,11854.0747457453,8494.70586350615]
Integral outputs : [10,105812.741557873,6954.67061976904,8336.63324037146,9344.78029589033]
I am using fixed-step size of 0.1 in Simulink and initial value of the integral block is 10.
I have tried,

and used Backward Euler method to approximate x_dot
2) trapezoidal method described in http://radio.feld.cvut.cz/matlab/toolbox/simulink/ug/discretetimeintegrator.html

My analysis so far,
a) Both of these methods does not exactly work like the Simulink Integral
b) At least for input and output combinations after 3rd iteration, the trapezoidal method works.
Can anyone help me, where i am making error? or is there other way to do it?
Thanks :)
0 commentaires
Réponses (1)
Voir également
Catégories
En savoir plus sur Discontinuities dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!