Curves don't fit to the direction field (value) need help
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Numerical Integration and Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!