How to plot a first order differential equation with singular point?

6 ビュー (過去 30 日間)
mathango
mathango 2016 年 8 月 17 日
コメント済み: mathango 2016 年 8 月 17 日
Is there a way to plot a first or second order differential equation with singular point? Example equation:
(1-y^2)*y" + 5*y' + 3*y = 0
Usually I get error message from ode about division by zero.

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 8 月 17 日
Save this file as odef.m
function dx=odef(t,x)
dx=zeros(2,1)
dx(1)=x(2);
dx(2)=(-5*x(2)-3*x(1))/(1-x(1)^2)
Then call it
%y'(0)=0.1 and y(0)=0.1 are initial conditions
tspan=[0 10]
[t,y]=ode45(@odef,tspan,[0.1 ;0.1])
plot(t,y)

その他の回答 (0 件)

カテゴリ

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