plot numerical solutions to the the initial value problem

On a single graph, plot numerical solutions to the the initial value problem on the interval [0,10]. Use values of b that are less than -1, equal to -1, between -1 and 1 and above 1. Use a domain of [0,6].
equation: y' = (y - sqrt(t)) * (1 - y^2) y(0)=b.
Attempted code:
syms y(t)
figure; hold on
for b = -2:1:2
fb = dsolve('Dy = (y - sqrt(t)) * (1 - y^2)', y(0) == b) ;
ezplot(fb, [0, 10, 0, 6])
end
I am confused on how you get it to plot those values for b and be on an interval of 0,10 with a domain of 0,6.

댓글 수: 2

use xlimit command
Bob
Bob 2016년 7월 29일
편집: Bob 2016년 7월 29일
Can you show me how I would use that command in this case. I have never used that command before. What part of my question would I use the xlimit for? This is what I have now:
syms y(t)
figure; hold on
for b = -2:1:2
fb = dsolve('Dy = (y - sqrt(t)) * (1 - y^2)', y(0) == b) ;
ezplot(fb, [0, 10, 0, 6])
xlim([0 10])
ylim([0 6])
end
Still need fix the range of my b values I think.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

태그

질문:

Bob
2016년 7월 29일

편집:

Bob
2016년 7월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by