Adding trajectories to vector fields of a linear system
9 次查看(过去 30 天)
显示 更早的评论
I used the quiver function to plot the vector fields of a simple uncoupled linear system,
[x1, x2] = meshgrid(-.5:0.05:0.5, -.5:.05:.5);
x1dot = - x1;
x2dot = 2*x2;
quiver(x1,x2,x1dot,x2dot)
Got this figure
Tried to add streamline function to obtain trajectories to no effect,
[x1, x2] = meshgrid(-.5:0.05:0.5, -.5:.05:.5);
x1dot = - x1;
x2dot = 2*x2;
quiver(x1,x2,x1dot,x2dot)
hold on
startx = -0.4:0.05:0.5;
starty = ones(size(startx));
streamline(x1,x2,x1dot,x2dot,startx,starty)
Any suggestions would be helpful!
0 个评论
采纳的回答
Kuifeng
2016-4-4
[x1, x2] = meshgrid(-.5:0.05:0.5, -.5:.05:.5);
x1dot = - x1;
x2dot = 2*x2;
quiver(x1,x2,x1dot,x2dot)
hold on
starty = -0.5:0.05:0.5;
startx = ones(size(starty))*-0.5; %specify the starting x values- LHS
streamline(x1,x2,x1dot,x2dot, startx,starty)
startx_2 = ones(size(starty))*0.5; %specify the starting x values -RHS
streamline(x1,x2,x1dot,x2dot, startx_2,starty);
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Vector Fields 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!