0

I ask for help from specialists in differential equations, dynamical systems, optimal control and general control theory;

I have the following system of differential equations:

\begin{cases} \frac{dx(t)}{dt}=G(t) \\ \frac{dz(t)}{dt}+z(t)=\frac{df}{dt} \\ \frac{dG(t)}{dt}+G(t)=z(t) \cdot \alpha \sin(\omega t) \\ \frac{dH(t)}{dt}+H(t)=z(t) \cdot (\frac{16}{\alpha^2}(\sin(\omega t)-\frac{1}{2})) \\ \frac{dX(t)}{dt}+X(t)=\frac{dx(t)}{dt} \end{cases}

where, $x,z,G,H,X$ - variables; $f=-(x(t)+\alpha \sin(\omega t)-x_e)^2$; $\alpha, \omega$ - parameters.

As an output $y$, I assign:

$y=\tanh(k \cdot H(t))$

As an reference signal $r_1$, I assign:

$r_1=-1$

As an constant time $p_1$, I assign:

$p_1=-1$

Well, I tried to program this in the Mathematica program and ran into a difficulty that I can't get over yet. Question: in which of the equations should the control signal $u(t)$ be placed?

I chose the first equation, then the original system of equations will look like this:

\begin{cases} \frac{dx(t)}{dt}=G(t)+u(t) \\ \frac{dz(t)}{dt}+z(t)=\frac{df}{dt} \\ \frac{dG(t)}{dt}+G(t)=z(t) \cdot \alpha \sin(\omega t) \\ \frac{dH(t)}{dt}+H(t)=z(t) \cdot (\frac{16}{\alpha^2}(\sin(\omega t)-\frac{1}{2})) \\ \frac{dX(t)}{dt}+X(t)=\frac{dx(t)}{dt} \end{cases}

(***)

Clear["Derivative"]

ClearAll["Global`*"]

Needs["ParallelDeveloper"]

S[t] = [Alpha] Sin[[Omega] t]

M[t] = 16/[Alpha]^2 (Sin[[Omega] t] - 1/2)

f = -(x[t] + S[t] - xe)^2

Parallelize[ asys = AffineStateSpaceModel[{x'[t] == G[t] + u[t], z'[t] + z[t] == D[f, t], G'[t] + G[t] == z[t] S[t], H'[t] + H[t] == z[t] M[t], 1/k X'[t] + X[t] == D[x[t], t]}, {{x[t], xs}, {z[t], 0.1}, {G[t], 0}, {H[t], 0}, {X[t], 0}}, {u[t]}, {Tanh[k H[t]]}, t] // Simplify]

pars1 = {Subscript[r, 1] -> -1, Subscript[p, 1] -> -1}

Parallelize[ fb = AsymptoticOutputTracker[asys, {-1}, {-1, -1}] // Simplify]

pars = {xs = -1, xe = 1, [Alpha] = 0.3, [Omega] = 2 Pi*1/2/Pi, k = 100, [Mu] = 1}

Parallelize[ csys = SystemsModelStateFeedbackConnect[asys, fb] /. pars1 // Simplify // Chop]

plots = {OutputResponse[{csys}, {0, 0}, {t, 0, 1}]}

At the end, I get an error.

At t == 0.005418556209176463`, step size is effectively zero; \
singularity or stiff system suspected

It seems to me that this is due to the fact that either in the system there is a $\csc$ somewhere, or I have put the control input signal in the wrong equation. I need the support of a theorist who can help me choose the right sequence of actions to solve the problem.

I would be glad to any advice and help.

dtn
  • 731
  • 1
  • 6
  • 19
  • Where you place the input has to do, primarily, with the real world application of the model in question. For example, with Euler Lagrange equations (physical models), the input often appears as a torque or force (as opposed to appearing as a velocity). Usually this is known prior to modelling. Also, looks like AffineStateSpaceModel linearizes the nonlinear equations about an operating point. Are you sure the linearization is controllable? Also doesn't look like it supports your time varying model... – Rollen S. D'Souza Apr 18 '21 at 16:30
  • The system is controlled. I will say even more. The control signal must somehow influence the variable $G(t)$, and this influence must be reflected in the variable $H(t)$ – dtn Apr 18 '21 at 17:12
  • And you have verified observability? There do not seem to be any theoretical obstructions to control design. Looks like a practical issue to me in using Mathematica functions. I ran your script, and mathematica spits out a model that doesn't match the linearization of the system plus designs a controller that has a singularity for some $t> 0.$ That would naturally cause simulation problems. I suggest this be discussed on the mathematica exchange or directly in their forums. – Rollen S. D'Souza Apr 18 '21 at 21:45
  • @Rollen And can we turn the system from uncontrolled to control one – dtn Apr 19 '21 at 01:42
  • You can always add inputs to a system in such a way that the system is (completely) controllable. The question of adding inputs though isn't one I'm aware of answered in the community. Since it is usually a given where the inputs appear in the model. – Rollen S. D'Souza Apr 19 '21 at 01:52
  • @Rollen

    I discovered something. The system is controlled if the input $u(t)$ is set to either the first or the third equation. In both cases, the system is not observable at the output if the variable $H(t)$ is used as an output $y$, but in combination with other variables (I chose $y=X(t)-G(t)-H(t)$) the system is controllable and observable. I am afraid that variable coefficients with $\sin(\omega t)$ introduce the singularity into the system.

    – dtn Apr 19 '21 at 03:41
  • @Rollen

    https://math.stackexchange.com/questions/4114416/finite-time-criterion-for-ode

    – dtn Apr 24 '21 at 06:10

0 Answers0