Second order ODE with initial and final condition
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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,
Risposte (0)
Vedere anche
Categorie
Scopri di più su Ordinary Differential Equations in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!