phase_portrait - x2=0.3; n=1; while (sqrt(x1^2 +...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
x1=0.5; x2=0.5; dt=0.002; n=1; while (sqrt(x1^2 + x2^2)>0.02) x1dot = -x1 - 2*x2*x1^2+x2; x2dot = -x1-x2; x1=x1 + x1dot*dt; x2=x2 + x2dot*dt; x1_save(n)=x1; x2_save(n)=x2; n=n+1; end plot(x1_save,x2_save) hold on x1=0.5;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: x2=0.3; n=1; while (sqrt(x1^2 + x2^2)>0.02) x1dot = -x1 - 2*x2*x1^2+x2; x2dot = -x1-x2; x1=x1 + x1dot*dt; x2=x2 + x2dot*dt; x1_save(n)=x1; x2_save(n)=x2; n=n+1; end plot(x1_save,x2_save)...
View Full Document

Ask a homework question - tutors are online