Curves don't fit to the direction field (value) need help
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
The curves do not fit to direction.the problem is the values of t and y or linspaces , need help :/
if true
t=0.3:0.2:3; y= -10:0.5:5;
[T, Y]= meshgrid(t,y);
dY= 3.*T.^2.*exp(-T)-T.*Y-Y./T;
dT= ones (size(dY));
quiver (T ,Y ,dT,dY,5)
axis tight
syms t y(t);
eqn = diff(y,t)==3.*t.^2.*exp(-t)-t.*y-y./t;
dsolve(eqn)
hold on
X0=linspace(0.5,3);
X1=linspace(0.5,3);
X2=linspace(0.5,3);
Y0=exp(-X0).*X0.^2-exp(-X0)./X0;
Y1=exp(-X1).*X1.^2+exp(1)-1.*exp(-X1)./X1;
Y2=exp(-X2).*X2.^2+(2.*exp(1)-1).*exp(-X2)./X2;
plot(X0,Y0,X1,Y1,X2,Y2);
hold off
end
2 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Numerical Integration and 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!