Problem solving ODE system in Simulink
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Oscar Espinosa
il 7 Nov 2020
Commentato: Oscar Espinosa
il 7 Nov 2020
Hi, I'm having some troubles when trying to solve a system of ODE.
This is the equation that I'm trying to solve: with initial conditions .
When solving the equation numerically I obtained the next plot in the interval from to .
I tried to do the same with Simulink, but the resulting graph from the scope its the next one:
The Simulink diagram is the next:
Thanks in advance.
Oscar Espinosa
0 Commenti
Risposta accettata
Stephan
il 7 Nov 2020
I think something went wrong, when you solved numeric:
syms y(t)
eq = diff(y,t,4) + 3 * diff(y,t,2) - sin(t) * diff(y,t,1) + 8 * y == t^2;
[V,S] = odeToVectorField(eq);
fun = matlabFunction(V,'Vars',{'t','Y'});
[tsol, ysol] = ode45(fun,[0 20], [1 2 3 4]);
plot(tsol, ysol(:,1))
result is:
The equation in Simulink:
gives:
Which is the same result. I think you have to switch the x0-Inputs with the signal inputs of your 4 integrators to solve the issue.
Più risposte (0)
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!