# Second order differential equation to two equations of first order

Here is a differential equation

x''[t] - eps (a^2 - x[t]^2) x'[t] + w^2*x[t] == 0


boundary conditions are

x=0,
v=0.001


i want to substitute x'[t] to v[t] and then NDSolve the equation to respect of x and v.

Right now my code looks like this

NDSolve[{
x''[t] - eps (a^2 - x[t]^2) x'[t] + w^2*x[t] == 0 /. {x'[t] -> v[t], x''[t] -> v'[t]}
x == 0,
v == 0.001},
{x[t], v[t]}, {t, 0, 10}]


and it obviously doesnt work. I suppose that ./ substitution isn't enough and I need to make more equations but i don't know how to do it.

## 1 Answer

First, when you want to solve for two variables,x and v, you need two equations. Add x'[t] == v[t] .

Second, with NDSolve, all parameters, w,a,eps, have to be given numerical values.

ndsol[w_, a_, eps_] :=
NDSolve[{x''[t] - eps (a^2 - x[t]^2) x'[t] + w^2*x[t] ==
0 /. {x'[t] -> v[t], x''[t] -> v'[t]}, x'[t] == v[t], x == 0,
v == 0.001}, {x, v}, {t, 0, 10}]

Plot[Evaluate[v[t] /. ndsol[3, 2, -3]], {t, 0, 10}]


And exactly the same

Plot[Evaluate[x'[t] /. ndsol[3, 2, -3]], {t, 0, 10}]