how to create equation from continuous state of s-function results

1 view (last 30 days)
i hope that some one can help me...
This is regarding to my s-function m-file which contains 11 ODE equation.
sys(1) = -Kd*x(1) - (Fev*I.x(3).(1 - x(2))*Kp);
sys (2) = Kp*(1 - x(2)).*x(3);
sys(3) = (-Fev*x(3).x(3).(1 - x(2))./(1 + Fev*x(2))).*Kp
untill sys(11)
my 12 and 13 equation is from 11 ODE equation, as below:
dl = (x(3)+x(5) / x(8) +x(3))*102;
dk = (x(6) +x(4) / x(7) + x(9)) *102 ;
But i do not know how to create 12 and 13 equation in s-function file?should i put these equations in discrete state?

Answers (1)

Kaustubha Govind
Kaustubha Govind on 20 Feb 2012
If you need to run your S-function in continuous-time, you should denote dl and dk as continuous states, and return their values based on your equations from the Derivatives method. Run the following command at the MATLAB prompt to see an example.
>> edit msfcn_limintm

Categories

Find more on Block and Blockset Authoring in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!