Differential Equation Matlab Resolve
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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)=??
0 Kommentare
Antworten (2)
Andrei Bobrov
am 15 Jul. 2014
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);
0 Kommentare
MiguelMauricio
am 15 Jul. 2014
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
0 Kommentare
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!