1

I derived a differential equation for a system that I am studying that takes the following form:

$$\dot{x}-au_1(x-x_0)=bu_2+cu_1$$

This was derived from expanding a non-linear differential equation as a Taylor series about the operating point $x_0$ and eliminating higher order terms. I want to convert this into a state-space model in the form:

$$\mathbf{\dot{x}}=\mathbf{Ax}+\mathbf{Bu}$$ $$\mathbf{y}=\mathbf{Cx}+\mathbf{Du}$$

The input $u_1$ is actually part of the $\mathbf{A}$ matrix in this system, I'm assuming that makes this a time variant system?

I'm struggling to understand how to deal with the constant term $x_0$ from the trimmed operating point.

I was curious to see how Simulink handled this, so I used the linearization app to derive a state-space model from the original non-linear differential equation at the operating point $x_0$ and the output it gave takes the following form:

$$\mathbf{A}=d=a*u_{1trimmed}$$ $$\mathbf{B}=[\begin{matrix}c&b\end{matrix}]$$ $$\mathbf{C}=1$$ $$\mathbf{D}=0$$

Where $u_{1trimmed}$ is the value of input $u_1$ trimmed about the operating point $x_0$. However, it has completed ignored the $x_0$ term and this has led to errors in the system response at the operating point $x_0$ because $\dot{x}$ is not zero at the operating point without the $x_0$ term.

Is there a way of keeping the input $u_1$ in the $\mathbf{A}$ matrix and keeping the offset term $x_0$ in the model? Or, is an LTI state-space model not appropriate for this kind of system?

For info. I simulated the original non-linear model, a linearised time-domain model and the Simulink derived state-space model and plotted the results (see figure below). Hopefully you can see that the state-space model does not behave well at the trimmed operating point $x_0=5$ (start of the simulation). I'm assuming that this is because it has ignored the $x_0$ term from the model and that error is integrating over time.

Simulink Simulation Results

  • In the first place, are you sure that your system is linear? If not, then it cannot be written in a matrix-vector form. – CroCo Apr 24 '24 at 21:04
  • Can you show the original nonlinear differential equation for the rate of change of tank level, $\frac{dh}{dt} = \text{inflow} - \text{outflow}$? – Xega Xam Apr 25 '24 at 10:58
  • To answer both questions, the original system is non-linear and is described by the following differential equation: $$\frac{dh}{dt}=\frac{1}{A}\left[\dot{Q}{in}-\frac{C_v}{c_1}\sqrt{{\rho}ghc_2} \right]$$ This is linearised about the operating point $h_0$ to give the following equation: $$\frac{dh}{dt} = \frac{1}{A} \left( \frac{Q{\text{in}}}{3600} - \frac{C_v \sqrt{h_0 c_2 g \rho}}{c_1} \right) - \frac{c_2 C_v g \rho (h - h_0)}{2 A c_1 \sqrt{h_0 c_2 g \rho}}$$ Then simplified as: $$\dot{x}-au_1(x-x_0)=bu_2+cu_1$$ Where $x=h$, $u_1=Q_{in}$ and $u_2=Cv$ – b7031719 Apr 25 '24 at 20:28
  • What I am trying to point out is that the last term in the linearised equation contains both the input $C_v$, the state $h$ and $h_0$ which is the state value at the desired operating point. I want to know if that makes traditional state-space representation difficult to achieve for this kind of system? – b7031719 Apr 25 '24 at 20:43

1 Answers1

1

Starting with the nonlinear differential equation:

$$ \frac{dh}{dt} = - \left(\frac{1}{A} \frac{C_v}{c_1} \sqrt{\rho g c_{2}}\right) \sqrt{h} + \frac{1}{3600 A} Q_{in} $$

we can rewrite it more succinctly as:

$$ \frac{dh}{dt} = - a \sqrt{h} + b Q_{in} $$

To linearize the system around the operating point $h_{0}$, we define $\delta{h} = h - h_{0}$. At $h_{0}$, we also observe that the operating point is subjected to the input flow $Q_{in} = \frac{a}{b} \sqrt{h_{0}}$. Thus, we define $\delta{Q_{in}} = Q_{in} - \frac{a}{b} \sqrt{h_{0}}$. The linearized model is then derived as:

$$ \frac{d\delta{h}}{dt} = - \left(\frac{a}{2 \sqrt{h}} \Biggr{\rvert}_{h_{0}}\right) \delta{h} + b \delta{Q_{in}} $$

Since $h_{0}$ is constant, then $\frac{d\delta{h}}{dt} = \frac{dh}{dt}$ and the linear system can be expressed as:

$$ \frac{dh}{dt} = - \frac{a}{2 \sqrt{h_{0}}} \left(h - h_{0}\right) + b \delta{Q_{in}} $$

$$ \frac{dh}{dt} = - \frac{a}{2 \sqrt{h_{0}}} h + \frac{a}{2 \sqrt{h_{0}}} h_{0} + b \delta{Q_{in}} $$

In linear state-space form, it appears as:

$$ \frac{dh}{dt} = \underbrace{- \frac{a}{2 \sqrt{h_{0}}}}_{\mathbf{A}} h + \underbrace{\left[\matrix{\frac{a}{2 \sqrt{h_{0}}} & b}\right]}_{\mathbf{B}} \underbrace{\left[\matrix{h_{0} \cr \delta{Q_{in}}}\right]}_{\mathbf{u}} $$

Xega Xam
  • 495
  • There are two inputs in this system, the input flow rate $Q_{in}$ and the outlet valve flow co-efficient $C_v$ and both need to be represented by in the input vector. I don't think that it is possible to separate the state $h$ and the input $C_v$ but please confirm.

    Also, you have represented the operating point $h_0$ as an input which is something that the Simulink Linearization tool doesn't do. Do you have any insight as to why?

    – b7031719 Apr 28 '24 at 16:56
  • I understand that $C_{v}$ represents the outflow coefficient. Does the operator vary this coefficient during the liquid filling process in the tank? Or does this coefficient remain constant throughout the filling process but can be reset before the filling process begins? – Xega Xam Apr 29 '24 at 09:27
  • I haven't utilized the Simulink tool in this stage. The solution provided is purely based on mathematical analysis using the Single Input, Single Output concept. If the outflow coefficient varies over time as a second control input during the filling process, then the linearization needs to be adjusted accordingly. By the way, assuming that the outflow coefficient is constant, can you verify the accuracy of the linear state-space approximation compared to the nonlinear system near the operating point $h_{0}$ and show the result in image? – Xega Xam Apr 29 '24 at 09:35