Prev: How to change the background color from green to black
Next: Urgently need a program on image processing.
From: Ebsan Uddin on 8 May 2010 02:43 Sorry for the 2 year bump. But I have a similar hw problem. I just want to make sure I'm doing the right thing: I've plotted the vector field and drew a phase portrait for Nonlinear Differential Equation. I need to plot the seperatrix by "picking an initial point close to the saddle point, and solving the IVP for t going from 0 to -20." According to my phase portrait I have two limits (0,0) and (3/2, 5/3). The seperatrix is a vector that passes (1/2, 0). I came up with this by looking at the phase portrait. So if I'm correct all I have to do is pick an initial point around (1/2,0) such as (.501, .001) and solve with ode45. Here's my code: >>g = inline ('[ y(1)*(-1 + 2.5*y(1) - y(1)^2 - .3*y(2)); y(2)*(-1.5 + y(1))]', 't', 'y') >>vectfield(g,0:.1:3,0:.1:2) >>hold on >> [ts,ys] = ode45(g,[0,-20],[.55;.01]); plot(ys(:,1),ys(:,2)) >> axis ([0 3 0 2]) >> hold off Thanks for the help in advance |