# How to choose a control input so that the nonlinear system stays at a fixed point?

The dynamics of a magnetically suspended steel ball can be described by

$$m \ddot{h} = mg - c \frac{u^2}{h^2}$$

where $$m$$ is the mass of the ball, $$g$$ is gravitational acceleration, $$c$$ is a positive constant, and $$h$$ represents the vertical position of the ball. The input $$u$$ is the current supplied to the electromagnet.

(a) Write down a nonlinear state space model using $$x_1 = h$$ and $$x_2 = \dot{h}$$.

(b) Determine the equilibrium control input $$u_e$$ that has to be applied to suspend the ball at some position $$h=h_0 > 0$$.

For part (a), the system is \begin{align} \dot{x}_1 &= x_2 \tag{1} \\ \dot{x}_2 &= g - \frac{c}{m} \frac{u^2}{x^2_1} \tag{2} \end{align}

For part (b), the equilibrium point $$x_e=(h_0,0)$$ which is not at the origin, so we need first to make sure the equilibrium point $$x_e$$ is transformed to the origin by introducing new variables: let $$y=x-x_e$$, we get:

\begin{align} y_1 &= x_1 - h_0 &\implies \dot{x}_1 = \dot{y}_1 \tag{3}\\ y_2 &= x_2 - 0 &\implies \dot{x}_2 = \dot{y}_2 \tag{4} \end{align} From (1),(2),(3), and (4), the new system is \begin{align} \dot{y}_1 &= y_2 \\ \dot{y}_2 &= g - \frac{c}{m} \frac{u^2}{(y_1 + h_0)^2} \end{align} The equilibrium point $$y_e = (\sqrt{\frac{c}{gm}} u - h_0, 0)$$. The control input $$u_e$$ that makes $$y_e$$ is zero is $$u_e = \frac{ h_0}{\sqrt{\frac{c}{gm}}}$$, therefore, the equilibrium control input $$u_e$$ that has to be applied to suspend the ball at some position $$h=h_0 > 0$$ is $$u_e = \frac{ h_0}{\sqrt{\frac{c}{gm}}}$$

Is this correct? if not, any suggestions how to tackle this problem.

Looks correct, but you can always check this yourself by plugging your $$u_e$$ into the expression for either $$\dot{x}_2$$ or $$\dot{y}_2$$. Also note that the input only appears as $$u^2$$, so using $$-u$$ should have the same effect as $$u$$.
Lastly it is also possible to solve for $$u_e$$ by setting $$\dot{x}_2=0$$ while using $$x_1=h_0$$. However, you might also have to linearize the system around this equilibrium point, so doing this coordinate translation would probably have to be done anyway in a later stage.
• I've fixed that, thanks. But when I run the simulation via Simulink Matlab, it doesn't seem the the state $x_1 \rightarrow h_0$. I'm not sure if the input choice is correct. Commented Jul 25, 2019 at 0:42
• @CroCo Having a desired equilibrium does not mean that the system converges to it. For that you also need that that equilibrium is stable. This probably isn't the case. In order to achieve this you need to let $u$ deviate from $u_e$ using some sort of feedback. Commented Jul 25, 2019 at 0:47
• The Jacobain matrix $A$ is $$A =\frac{\partial f}{ \partial x} = \begin{bmatrix} 0 & 1 \\ 2gh^2_0x^{-3}_1 & 0 \end{bmatrix}_{x_e=(h_0,0),u_e=\sqrt{\frac{gm}{c}} h_0} = \begin{bmatrix} 0 & 1 \\ 2gh^{-1}_0 & 0 \end{bmatrix}$$ The eigenvalues of $A$ are $\lambda_{1,2}=\pm \sqrt{\frac{2g}{h_0}}$. They are real and sign opposite, hence, the system is unstable for this input. Is this correct? Commented Jul 25, 2019 at 2:55