Differential Equation Matlab Resolve

1 回表示 (過去 30 日間)
Alexmm
Alexmm 2014 年 7 月 14 日
回答済み: Andrei Bobrov 2014 年 7 月 15 日
Hello everyone, I can not resolve / implement the follow differential equation. Is there anyone who can help me??
y''(t)+p(t)y'+q(t)y=0
q=1/(1+t)^2;
p=1+q;
y(0)=1; y'(0)=0; y''(0)=0; ------> y'(4*pi)=??

回答 (2 件)

Andrei Bobrov
Andrei Bobrov 2014 年 7 月 15 日
Your odefun - funnn:
function dy = funnn(t,y)
q = 1./(1+t).^2;
dy = [ y(2);
-((q + 1).*y(2) + q.*y(1))];
end
solve:
sol = ode45 (@funnn, [0 20], [1 0]);
out = deval(sol,4*pi,2);

MiguelMauricio
MiguelMauricio 2014 年 7 月 15 日
Try using dsolve
syms y(t) t
q=1/(1+t)^2;
p=1+q;
Dy=diff(y);D2y=diff(y,2);
solution=dsolve(D2y+p*Dy+q*y==0,Dy(0)==0,y(0)==1,t)
In any case, your last initial condition (y''(0) must be wrong since the equation would not hold. For t=0 you would have 0 + 2*0 + 1*1=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