divergence results using ode45 in .m-file and using ode45 simulink
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi everyone,
I'm simulating an ODE in simulink, using a s-function, to obtain the time response and do the system analysis. When I write this ODE in a .m-file and use the ode45 solver to obtain the time response of the system, i have a similar results for some variations in the input variable, but when the value of the input variable decreases, the results of the .m-file is different.
Anyone know why is this occuring?
best regards,
Gustavo
0 Commenti
Risposte (2)
Richard Brown
il 29 Apr 2012
Try forcing ode45 to use time steps no bigger than the simulink ones, i.e.
opts = odeset('MaxStep', 0.1); %substitute 0.1 for the simulink step size
ode45(..., opts);
0 Commenti
Jan
il 28 Apr 2012
Either there is a bug in the program.
Or the solution is instable. E.g. solutions of chaotic deterministic systems are instable and tiny differences in the intermediate solutions can lead to large differences in the final position. You can check this by an analysis of the sensitivity to variations of the initial values.
Vedere anche
Categorie
Scopri di più su Ordinary Differential Equations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!