0
$\begingroup$

Please how can I solve this using StateSpaceModel.

eqns := {(lp \[Theta]''[t]) + m g Sin [\[Theta][t]] + c \[Theta]'[t] -
  Sin [\[Theta][t]] y0''[t] == 0}; 
$\endgroup$
2
  • 1
    $\begingroup$ Do you mean put it in a state space form? $\endgroup$ Commented Jan 17, 2023 at 16:54
  • $\begingroup$ Yes, I need to put it in a state space form? $\endgroup$
    – Tetrasreal
    Commented Jan 29, 2023 at 17:32

1 Answer 1

1
$\begingroup$

StateSpaceModel is a linear representation. It will throw away nonlinear terms.

eqns = {lp θ''[t] + m g Sin[θ[t]] + c θ'[t] - Sin[θ[t]] y0''[t] == 0};
StateSpaceModel[eqns, {θ[t], y0[t]}, {}, {θ[t], y0[t]}, t]

enter image description here

NonlinearStateSpaceModel can handle nonlinear terms, but it doesn't support descriptor systems yet. For now, we have to use an internal function as shown here.

{{f, h, e}, x} = Control`DEqns`nonaffinestatespaceForm[eqns, {{θ[t], 0}, {y0[t], 0}}, 
    {}, {θ[t], y0[t]}, t, #[[1 ;; 2]] &, DescriptorStateSpace -> True];

The state space equations are in the form $e.x'==f$.

x

enter image description here

{e.D[x, t], Table["==", 4], f}//Transpose // TableForm

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks you very much. $\endgroup$
    – Tetrasreal
    Commented Jan 31, 2023 at 9:12

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