solving ode with variable, discrete coefficients
Show older comments
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
Answers (1)
Torsten
on 8 Jul 2016
0 votes
Take a look at the example "ODE with Time-Dependent Terms" under
to see how you should proceed.
Best wishes
Torsten.
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!