Single-Degree-of-Freedom Vibration Equation
Hello, I’m Hiroki 🐶, a data scientist.
In my previous blog I introduced the Matlab code for the physical model, which actually uses a very fancy method called state-space representation.
Today, I want to delve a little deeper into this state-space representation.
So, in this post, I will introduce:
- What is state-space representation?
- The benefits of representing a single-degree-of-freedom vibration model in state-space representation
Firstly, this is the single-degree-of-freedom vibration model.
Normally, you can write its motion equation as follows:
$$\begin{align*}
m\ddot{x}+c\dot{x}+kx&=f \
\end{align*}$$
But in the Matlab code I introduced last time,
% Definition of the differential equation
A = [0 1; -k/m -c/m];
B = [0; 1/m];
C = [1 0];
D = 0;
% Creation of the state-space model
sys = ss(A, B, C, D);
it looks different.
This is known as state-space representation, a fancy and meaningful method of transforming and solving the motion of equation.
Actually, the equation
$$\begin{align*}
m\ddot{x}+c\dot{x}+kx&=f \
\end{align*}$$
can be transformed into
$$\begin{pmatrix}
\dot{x} \\
\ddot{x} \\
\end{pmatrix}
\begin{align*}
&=
\end{align*}
\begin{pmatrix}
0 & 1 \\
-k/m & -c/m \\
\end{pmatrix}
\begin{pmatrix}
x \\
\dot{x} \\
\end{pmatrix}
+
\begin{pmatrix}
0 \\
1/m \\
\end{pmatrix}
f
$$
and,
$$
A
\begin{align*}
&=
\end{align*}
\begin{pmatrix}
0 & 1 \\
-k/m & -c/m \\
\end{pmatrix}$$
$$
B
\begin{align*}
&=
\end{align*}
\begin{pmatrix}
0 \\
1/m \\
\end{pmatrix}$$
$$
C
\begin{align*}
&=
\end{align*}
\begin{pmatrix}
1 \\
0 \\
\end{pmatrix}$$
$$
D=0
$$
How come formula transformation from
$$\begin{align*}
m\ddot{x}+c\dot{x}+kx&=f \
\end{align*}$$
to
$$\begin{pmatrix}
\dot{x} \\
\ddot{x} \\
\end{pmatrix}
\begin{align*}
&=
\end{align*}
\begin{pmatrix}
0 & 1 \\
-k/m & -c/m \\
\end{pmatrix}
\begin{pmatrix}
x \\
\dot{x} \\
\end{pmatrix}
+
\begin{pmatrix}
0 \\
1/m \\
\end{pmatrix}
f
$$
Start by considering the vector
$$\begin{pmatrix}
\dot{x} \\
\ddot{x} \\
\end{pmatrix}$$
and,
$$\begin{align*}
m\ddot{x}+c\dot{x}+kx&=f \
\end{align*}$$
Above equation is divided into below two equations
$$\begin{align*}
\dot{x}-\dot{x}=0 \
\end{align*}$$
$$\begin{align*}
m\ddot{x}+c\dot{x}+kx&=f \
\end{align*}$$
and use below formula
$$\begin{pmatrix}
\dot{x} \\
\ddot{x} \\
\end{pmatrix}$$
then,
$$\begin{pmatrix}
1 & 0 \\
0 & m \\
\end{pmatrix}
\begin{pmatrix}
\dot{x} \\
\ddot{x} \\
\end{pmatrix}
+
\begin{pmatrix}
0 & -1 \\
k & c \\
\end{pmatrix}
\begin{pmatrix}
x \\
\dot{x} \\
\end{pmatrix}
\begin{align*}
&=
\end{align*}
\begin{pmatrix}
0 \\
f \\
\end{pmatrix}$$
This can be expressed as
$$\begin{pmatrix}
1 & 0 \\
0 & m \\
\end{pmatrix}
\begin{pmatrix}
\dot{x} \\
\ddot{x} \\
\end{pmatrix}
\begin{align*}
&=
\end{align*}
\begin{pmatrix}
0 & 1 \\
-k & -c \\
\end{pmatrix}
\begin{pmatrix}
x \\
\dot{x} \\
\end{pmatrix}
+
\begin{pmatrix}
0 \\
1 \\
\end{pmatrix}
f
$$
Divide the second row by m to get:
$$\begin{pmatrix}
\dot{x} \\
\ddot{x} \\
\end{pmatrix}
\begin{align*}
&=
\end{align*}
\begin{pmatrix}
0 & 1 \\
-k/m & -c/m \\
\end{pmatrix}
\begin{pmatrix}
x \\
\dot{x} \\
\end{pmatrix}
+
\begin{pmatrix}
0 \\
1/m \\
\end{pmatrix}
f
$$
This can be expressed as
$$\begin{pmatrix}
\dot{x} \\
\ddot{x} \\
\end{pmatrix}
\begin{align*}
&=
\end{align*}
A
\begin{pmatrix}
x \\
\dot{x} \\
\end{pmatrix}
+
B
f
$$
This is the state-space representation.
$$
y
\begin{align*}
&=
\end{align*}
C
\begin{pmatrix}
x \\
\dot{x} \\
\end{pmatrix}
+
D
f
$$
this is output equation.
Why is this exciting?
It’s a fundamental form in modern control engineering,
allowing you to easily simulate various input-output signals for linear systems.
For example、this is demonstrated in the part of the code shown by ChatGPT last time, where the lsim function is a prime example:
% Creation of the state-space model
sys = ss(A, B, C, D);
% Simulation of the response
t = linspace(0, 10, 1000); % Simulation time [s]
u = f * ones(size(t)); % Time series of external force
y = lsim(sys, u, t);
In summary,
State-space representation is a fundamental form in modern control engineering.
The benefit of representing a single-degree-of-freedom vibration model in state-space is that it simplifies the simulation of various input-output signals for linear systems using functions like lsim.
That’s it for today. There were a lot of equations, so you might be tired. Thank you for reading to the end. Love&Respect♡ Hiroki🐶