Curves don't fit to the direction field (value) need help

2 views (last 30 days)
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 Comments
aertha13
aertha13 on 21 Mar 2018
I need X1 curve to be under the red line so that all curves can show the same direction. But when I change the values, I'm losing the arrows.

Sign in to comment.

Answers (0)

Categories

Find more on Numerical Integration and Differential Equations in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!