Curves don't fit to the direction field (value) need help
조회 수: 2 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!