필터 지우기
필터 지우기

How can I Solve a Second Order ODE with ODE45?

조회 수: 4 (최근 30일)
Jack Glendenning
Jack Glendenning 2016년 5월 4일
댓글: Jack Glendenning 2016년 5월 6일
So I I have to solve the following ODE for y(t) using the ODE45 tool in MATLAB:
The ODE that I have to solve is:
13y''+0.27y'-0.35/y +3.5=1.2753
y(0)=0 y'(0)=0 for 0<=t<=5
  댓글 수: 2
Jan
Jan 2016년 5월 4일
What have you tried so far and which problems do you have?
Jack Glendenning
Jack Glendenning 2016년 5월 6일
It's ok I managed to solve it: (note the question i have been given was actually in terms of x(t). I thought y(t) might be easier for people to see. That's why i asked with y(t).
%%Solving Second order ODE via ode45
%Will solve 0.13x''+0.27x'-0.35/x+3.5=1.2753
%x(2)=x(1)'
%eq1: x(1)'=x(2)
%eq2: x(2)'=(1.2753-3.5+0.35/x(1)-0.27*x(2))/0.13
ODEFUN = @(t,x) [x(2);(1.2753-3.5+0.35/x(1)-0.27*x(2))/0.13];
TSPAN = [0 5];
X0=[0.03;0];
[TOUT, XOUT]= ode45(ODEFUN, TSPAN, X0); figure
plot(TOUT,XOUT)

댓글을 달려면 로그인하십시오.

답변 (1개)

Torsten
Torsten 2016년 5월 4일
There is a singularity in t=0 ...
Best wishes
Torsten.

카테고리

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