Second order ODE with initial and final condition
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to numerically solve the following second order differential equation:
In general A could be a matrix, but for simplicity, I focus on the case where A is a function of t, and a, m & K are constants. I have the initial condition:
and final condition:
How can I specify an initial and a final condition using ode45 or similar?
What can I put for Y0 in my codes below?
function dy= ode_func(t,y)
a=.01; m=100; K=.001;
dy = zeros(2,1);
dy(2)= a/t * exp(-m*t) -K;
dy(1)= y(2);
with main script:
[T,Y] = ode45(@ode_func, [0,100], Y0);
Plot(T,Y)
Thank you,
Réponses (0)
Voir également
Catégories
En savoir plus sur Ordinary Differential Equations dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!