Make a direction field for the differential equation

조회 수: 199 (최근 30일)
Bob
Bob 2016년 7월 23일
답변: Om Prakash Yadav 2021년 11월 25일
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에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by