solving ode with variable, discrete coefficients
Afficher commentaires plus anciens
Hi there, I am working on solving a system of ODEs where there are variable, discrete coefficients. However, I don't know how to handle ode45 function and my equation function. If someone could help me, it would be really appreciated.
My problem is * u'(s) = v(s) * v'(s) = A(s)*cos(u(s)) * u(0) = 0, v(0) = 1,
where A(s) is not a closed form of function, but vector of values at each point s, which is obtained from solving preliminary ODEs. What I am thinking is to call another function which returns the value of A at each point s inside my ode function. But, I am not sure how to handle the independent variable s in ode45 so that 's' in ode45 is matched with the 's' which is already defined in A(s).
Thanks
Réponses (1)
Torsten
le 8 Juil 2016
0 votes
Take a look at the example "ODE with Time-Dependent Terms" under
to see how you should proceed.
Best wishes
Torsten.
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!