1
$\begingroup$

I need to numerically solve $$\frac{\mathrm dx}{\mathrm dt} = y - x^3$$ $$\frac{\mathrm dy}{\mathrm dt} = -x - y^3$$
with initial conditions $x_0,y_0 = 1,0$ for $t$ from $1$ to $100$. I don't know how to do this.

I'd also like to plot this along with some other functions and don't know how to plot multiple functions on one plot. The specific functions are $$A = x^2 + y^2$$

and $$B = 1/t$$

I'm quite new to MATLAB, so I need some help.

  • 2
    You should be able to adapt the answer I gave you [here](http://math.stackexchange.com/questions/51357/51415#51415) to your current problem.2011-08-15
  • 1
    [As for plotting...](http://www.mathworks.com/support/2011a/matlab/7.12/demos/PlotTools_viewlet_swf.html)2011-08-15
  • 0
    I don't see how in the first case. I tried dy(1) = y(2) - y(1).^3, dy(2) = - y(1) - y(2).^3. That didn't work.2011-08-15
  • 0
    "That didn't work." isn't very informative for me. What did you enter, and what did MATLAB spit out?2011-08-16

1 Answers 1