title: Solving a state-space (2nd order equation) with ode45 in MATLAB
body: <p>I'm trying to teach myself how to use MATLAB for solving state-space systems, I have what seems to be a pretty straight-forward system but have been unable to find any decent straight-forward examples for a novice thus far.</p>
  
  <p>I'd like a simple walk-through of how to translate the system into MATLAB, what variables to set, and how to solve for about 50(?) seconds (from t=0 to 50 or any value really).</p>
  
  <p>I'd like to use ode45 since it's a 4th order method using a Runge-Kutta variant.</p>
  
  <p>Here's the 2nd-order equation:</p>
  
  <pre><code>θ''+0.03|θ'|θ'+4pi^2*sinθ=0
  </code></pre>
  
  <p>The state-space:</p>
  
  <pre><code>x_1'=x_2
  
  x_2'=-4pi^2*sin(x_1)-0.03|x_2|x_2
  
  x_1 = θ, x_2 = θ'
  
  θ(0)=pi/9 rad, θ'(0)=0, h(step)=1
  </code></pre>