Second order ODE with initial and final condition

조회 수: 7 (최근 30일)
Ramtin Taheri
Ramtin Taheri 2019년 7월 8일
댓글: Torsten 2019년 7월 8일
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,

답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by