Given system of ODE:

$\begin{cases} \dot{x}=G+u_1 \\ \dot{z}=-z+\frac{df}{dt} \\ \dot{G}=-G+z \cdot u_2 \end{cases}$

where $f=-x^2$,

$u_1=\frac{d}{dt}(\alpha \sin(\omega \cdot t))$ and $u_2=\alpha \sin(\omega \cdot t)$

f = -x[t]^2;
asys = AffineStateSpaceModel[{x'[t] == G[t] + u1[t], z'[t] + z[t] == D[f, t], G'[t] + G[t] == z[t]  u2[t]}, {{x[t], 1}, {G[t], 0}, {z[t], 0}}, {u1[t], u2[t]}, {x[t], z[t], G[t]}, t];

And here is the result of the numerical calculation:

pars = {\[Alpha] = 0.5, \[Omega] = 2 Pi 5, xs = 1, xe = 0};
s1 = \[Alpha] Sin[\[Omega] t];
or = OutputResponse[asys, {D[s1, t], s1}, {t, 0, 500}]
Plot[{or[[1]] - s1, xe}, {t, 0, 25}, PlotRange -> All, PlotPoints -> 100]

enter image description here

Next, I try to get the transfer function of the system:

tf = TransferFunctionModel[asys]

And results:

or = OutputResponse[tf, {D[s1, t], s1}, {t, 0, 500}]
Plot[{or[[1]]}, {t, 0, 5}, PlotRange -> All, PlotPoints -> 100]

enter image description here

Should the results be the same, and if not, why not?


1 Answer 1


Of course they are not going to be the same, because the linearization removed all the nonlinear terms.

The responses are being computed for these two different systems.

NonlinearStateSpaceModel /@ {asys, StateSpaceModel[asys]}

enter image description here

  • $\begingroup$ Suba Thomasб hello! Thank you for your answer! I came across this question while trying to linearize a non-autonomous differential equation. I figured out the current question, but not yet with linearization. mathematica.stackexchange.com/questions/253133/… $\endgroup$
    – dtn
    Aug 10, 2021 at 13:15
  • $\begingroup$ In this form, the system does not lend itself to linearization, because it has no equilibrium points. Maybe the original $\dot{x}=-x^2+\frac{1}{t+1}+1$ can be linearized? A comment was left there, it is not an option, because non-autonomy can be more complex and some more or less universal approach is needed. $\endgroup$
    – dtn
    Aug 10, 2021 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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