Second order ODE with initial and final condition
1 view (last 30 days)
Show older comments
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,
Answers (0)
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!