フィルターのクリア

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 Center および File ExchangeOrdinary Differential Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by