作业帮 > 数学 > 作业

常微分方程平面向量场 matlab

来源:学生作业帮 编辑:搜搜考试网作业帮 分类:数学作业 时间:2024/06/14 01:08:02
常微分方程平面向量场 matlab
实验名称:常微分方程平面向量场
实验内容:考虑一阶常微分方程初值问题
y'=y(1-y);
y(0)=y0.
设定平面上矩形区域:D={(x,y)|0
常微分方程平面向量场 matlab
x = 0:0.2:6;
y = 0:0.1:2;
[x,y] = meshgrid(x,y);
fxy = y.*(1-y);
cosa = 1./(1+fxy.^2);
sina = cosa.*fxy;
cla;
quiver(x,y,cosa,sina);
hold on
[sx,sy] = ode45(@(x,y) y.*(1-y) ,[0,6],[0.2;1.8]);
plot(sx,sy,'r');