How to utilize S-function in Simulink to solve 2nd order ODE?
Show older comments
I'm trying to understand Simulink and I've read quite a few articles, but I got stuck at the following problem.
I have an initial value problem:

This one can be transformed into a system of two 1st order ODEs:

Now I found some example, which solves this problem using Simulink, but using S-function instead of Integrators. And that's the place, where I'm completely confused. In the problem they're giving following equations to the S-function.


Those equations seem quite similar, but if we expand them, we'll get the following:

And my questions:
1) What is the
term doing there? I'd suppose, that
or B should be
, based on the fact, that the original equation is homogeneous.
term doing there? I'd suppose, that
or B should be 2) How am I supposed to specify this problem using S-function builder?
3) Is there any place, where I could specify A,B,C,D matrices in S-function builder, as they're basically constants and not an input variables or initial conditions?
I'm sorry for such a general question, but I'm having really hard time to understand this. I've found some examples, but all of them are dealing with ODEs using Integrator tool in Simulink and not specifying them by S-function, so I'd be really happy for one explained example here.
Thank you very much!
Best,
Martin
Answers (0)
Categories
Find more on General Applications 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!