Make a direction field for the differential equation

135 views (last 30 days)
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')

Answers (2)

Om Prakash Yadav
Om Prakash Yadav on 25 Nov 2021
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 on 28 Feb 2020
% 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')

Community Treasure Hunt

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

Start Hunting!