Find a Guide

State-Space Form for Non-Linear Systems

Introduction

Let there be a system with a mass on a pendulum swinging back and forth. Assuming this system does not have small-angle approximations, this would be an example of a non-linear system. Let's dive in to see how we can put the system in its state-space form.

Setting up State-Space

We can start by writing the equation for the system describing the pendulum.

[ 1 ]

$$ \ddot{\theta} + \frac{g}{l} \sin{\theta} = u $$

To get started, we will have to define some x variables to form our state-space equations. Now you may be asking how many x variables do we need? And that is a good question. We will have as many x values as the highest derivative for each non-constant variable in a system added up. Notice that there is only one non-constant variable, $ \theta $, and it has a highest derivative of 2, hence, we will only need 2 x variables for the system.

We can define our x variables as

[ 2 ]

$$ x_1 = \theta $$ $$ x_2 = \dot{\theta} $$

Notice we define them as the base variable and first order derivative for our $ x_1 $ and $ x_2 $ variables. We do not define one to be the second order derivative because we want to make the system easier to solve! Let's substitute the two values into our equation.

[ 3 ]

$$ \dot{x_1} = x_2 $$

[ 4 ]

$$ \dot{x_2} + \frac{g}{l} \sin{x_1} = u $$

Notice that Eq. (3) was added in addition to our original equation, Eq. (1). This is because we have two x variables, so we need two equations to form our state-space. We are simply stating the relation that the derivative of $ x_1 $ is $ x_2 $. Now that the equations have been defined, we can isolate our first order derivatives on one side:

[ 5 ]

$$ \dot{x_1} = x_2 $$ $$ \dot{x_2} = -\frac{g}{l} \sin{x_1} + u $$

Now that the equations have been written, we can put the system in its state-space form. But first, let's see the format for the state-space form:

[ 6 ]

$$ \dot{x} = \mathbf{A} x + \mathbf{B} u(t) $$

where $ \dot{x} $ is an array of the first derivatives of the x variables we defined in Eq. (3), $ \mathbf{A} $ is the Jacobian matrix, where the system's main information is stored, and $ \mathbf{B} u(t) $ are the external inputs to the system. Now with linear systems, this process is nice and easy because we can form the Jacobian matrix by pulling out variables similar to matrix multiplication, but since the system is non-linear, we cannot do this method. Instead, we have to follow a different format.

[ 7 ]

$$ A = \begin{bmatrix} \frac{\partial \dot{x_1}}{\partial x_1} & \frac{\partial \dot{x_1}}{\partial x_2} \\ \frac{\partial \dot{x_2}}{\partial x_1} & \frac{\partial \dot{x_2}}{\partial x_2} \end{bmatrix} $$

The way this is set up, is the partial derivative is take of Eq. (3) for each variable, $ x_1 $ and $ x_2 $, and then the same is done for Eq. (4). Now if we had more variables, and hence, more equations, the same pattern would repeat on and on. Now, let's put the system in its state-space form using the non-linear Jacobian matrix.

[ 8 ]

$$ \begin{Bmatrix} \dot{x_1} \\ \dot{x_2} \end{Bmatrix} = \begin{bmatrix} 0 & 1 \\ -\frac{g}{l} \cos{x_1} & 0 \end{bmatrix} \begin{Bmatrix} x_1 \\ x_2 \end{Bmatrix} + \begin{Bmatrix} 0 \\ 1 \end{Bmatrix} u $$

And that is all! We can now put non-linear systems into their state-space forms. This is incredibly handy for when we talk about finding the fixed points and stability of a system.

Find a Guide