1
$\begingroup$

Is there a built-in function that expresses a 2nd order ODE as 1st order ODE's? If not, how can one decouple a 2nd ODE to a first-order one using Mathematica?

I couldn't find it here: Why is NDSolve solving in term of two 1st order ODE slower than 2nd order?

$\endgroup$
3
0
$\begingroup$

Using NonlinearStateSpaceModel

fode = NonlinearStateSpaceModel[m y''[t] + c y'[t] + k y[t] == f[t], {y[t], y'[t]}, f[t], {}, t]

enter image description here

To extract the parts

With[{res = NonlinearStateSpaceModel[fode, {x1[t], x2[t]}] // Normal},
 ApplySides[MatrixForm@*Transpose@*List, D[res[[2]], t] == res[[1, 1]]]]

enter image description here

$\endgroup$
1
  • $\begingroup$ the NonlinearStateSpaceModel is really neat, thanks! But this raises the question: How come I couldn't find it in the documentation while searching for a built-in function that converts an ODE to a first-order system? $\endgroup$
    – l0293624
    Dec 4 '19 at 15:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.