How to write ode45 to solve differential equations with changing parameters
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am going to solve the differential equations:
dX = f(X, U, P), X is system states, U is control inputs which is known, and P is function of X, U and P itself. Since nonlinearity, P cannot be expressed analytically.
I tried to use ode45, but I have to use a for-end loop to upgrade my P for every step. Is there anyway I can avoid using for-end loop here? For example, just use ode45 to integrate my equations for one go?
I'm new to MATLAB, I will be very thankful if you let me know how to write it in detail. Thank you very much.
2 comentarios
Torsten
el 7 de Abr. de 2015
dX=f(X,U,P) P-f2(X,U,P)=0
This is a differential-algebraic system which can be solved by ODE15S, e.g.
Best wishes
Torsten.
Respuestas (1)
Jan
el 6 de Abr. de 2015
Please explain the values of U and P with details. Is the function to be integrated still smooth? Otherwise ODE45 cannot handle it reliably. See http://www.mathworks.com/matlabcentral/answers/59582#answer_72047
Ver también
Categorías
Más información sobre Ordinary Differential Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!