Make a direction field for the differential equation

419 次查看(过去 30 天)
Make a direction field for the differential equation: y' =( t + y + 1)/ (y − t ). In a comment, talk about where existence and uniqueness break down for this equation. Does your slope field appear to corroborate this? Where there’s a problem, does it appear like existence fails or uniqueness?
Attempted code:
% The solution is unique at y(0)=1
[T, Y] = meshgrid(-2:0.2:2, -2:0.2:2);
S = -T.+ Y + 1/Y-T;
L = sqrt(1 + S.^2);
quiver(T, Y, 1./L, S./L, 0.45)
axis tight; xlabel('t'), ylabel('y')
title('Direction field for dy/dt = -t/y')

回答(2 个)

Om Prakash Yadav
Om Prakash Yadav 2021-11-25
Actually, you have written expressions incorrectly,
[T, Y] = meshgrid(-2:0.2:2, -2:0.2:2);
S =( -T + Y + 1)./(Y-T);
L = sqrt(1 + S.^2);
quiver(T, Y, 1./L, S./L, 0.45)
axis tight; xlabel('t'), ylabel('y')
title('Direction field for dy/dt = -t/y')

Nahid Farabi
Nahid Farabi 2020-2-28
% The solution is unique at y(0)=1
[T, Y] = meshgrid(-2:0.2:2, -2:0.2:2);
S = -T.+ Y + 1/Y-T;
L = sqrt(1 + S.^2);
quiver(T, Y, 1./L, S./L, 0.45)
axis tight; xlabel('t'), ylabel('y')
title('Direction field for dy/dt = -t/y')

类别

Help CenterFile Exchange 中查找有关 Scatter Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by