Time-based integration of ODEs
Mostrar comentarios más antiguos
Hello everyone. I have a problem that I hope I can get some help on. So I have the following set of differential equations:
I need to solve for θ, ϕ, and ψ from those three differential equations. To be specific I need to solve for a value (not a function) of θ, ϕ, and ψ at a given moment. I have a for loop that runs, and at each iteration the value of p, q, and r change, so at each iteration I will need to do this integration and solve for a value of θ, ϕ, and ψ. What information do I have avaliable for me? The value of p, q, and r at each iteration, and I also know the initial values (iteration = 1) of θ, ϕ, and ψ, and finally, I know the time at each iteration as well. Is this possible in MATLAB? I tried implementing this with ODE45 and struggled very much. Any help is super appreciated.
6 comentarios
Davide Masiello
el 13 de En. de 2023
This seems like a very standard problem and could be solved easily in MatLab.
I suggest you post your code so that we can suggest what to change/improve.
Star Strider
el 13 de En. de 2023
What actually defines an ‘iteration’?
Do the ‘tspan’ limits change in each iteration? If so, how are they defined?
Are p, q, and r defined as function results (and if so, what is the argument to the function) or are they elements of vectors?
Jan
el 13 de En. de 2023
@Ali Almakhmari: What does "each iteration" mean? Are p,q,r functions of the time? If not, how are they defined?
Ali Almakhmari
el 13 de En. de 2023
It is still not clear, what you call "iteration". ODE45 solves the ODE in steps, so this is an iterative process. But steps can be rejected or re-calculated, such that "changes in each iteration" are not meaningful. If p,q,r are functions of time, there is no problem.
Please post the existing code, even if it fails. Then it might get clear immediately, how p,q,r are defined.
Ali Almakhmari
el 13 de En. de 2023
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


