MATLAB: How to solve a differential equations’ system in SIMULINK

derivativedifferential equationsintegrationsimulinksystem

I need to solve a system of 5 differential equations that are characterized by the presence of the unknown variable both at the second member of the equation and in the derivative. I tried to use a block Discrete-Time Integrator with a loop that pick up the output of the block and calculate the second member of the equation and then enters again the integrator as dT/dt. I make an example:
cy' = ay + b –> with a gain block that multiply the output of the intergrator I calculate ay and with a Sum I obtain ay +b. Then I divide all by c and the input (that is y') goes to the integrator.
Is that correct, is that possible? The results are wrong, but I would know if is because of an error or if is due to a wrong usage of the Discrete-Time Integrator block. Someone said me that it isn't possible to solve a system of differential equatiin this way, using this simulink structure, but I would like to know your opinion.
Thank you very much to everyone answers.

Best Answer

What you describe sounds correct. The following posts gives a good example of how to draw ODEs in Simulink: