Lab Report
Individual Report
Due date: Saturday, 23 March, 2024, 23:59
Include: Code, figures, and anything you think it is important :)
If you have any questions, please contact me by email: fangyuan.wang@connect.polyu.hk (Fangyuan Wang)
Question 1 (20 Pts.)
Given the following dynamic system $4\ddot{x}+5\dot{x}+2x=9u$, for $u$ as the input, with initial conditions
$x(0)=0$ and $\dot x(0)=0$. Manually calculate the transfer function and represent
it in Matlab/Ocatve. Calculate the Laplace transformation's partial fraction decomposition (i.e. [r, p, k])
by Matlab/Octave and write down the complete form (i.e. the function) in your lab report.
Question 2 (20 Pts.)
Compute the total transfer function $C/R$ of the following system, compute the poles, draw the pole-zero map and the root locus
using Matlab/Octave.
Question 3 (20 Pts.)
Consider the following negative feedback system,
where
$$G(s) = \frac{5s + 8}{s^4 + 4s^3 + 6s^2 + 3s + 3} $$
and $H=2$. Using matlab/octave, calculate the transfer function $C/R$, the unit step response, the impulse response, and the time response
with a cosine wave input of period 5s with amplitude 1 of the closed-loop system.
Hint: the syntax of generating cosine wave in Matlab is
For example, to generate a cosine wave of period 1s with amplitude 1, we can use the following scripts.
t = 0:0.001:10;
f = cos(2*pi*t);
plot(t,f);
Note that if you are using Octave, you need to add "pkg load signal;" at the beginning of the script.
Run the scripts, we can get the figure of the cosine wave;
Question 4 (20 Pts.)
Consider the following mass-damper-spring system,
Suppose we have $m=14$, $c=2$, $k=3$, $\dot x(0)=0$ and $x(0)=0$, use the ODE solver to create
a simulation to show the response of $x$ under a constant force $F=4$.
Hint: For a second-order system $\ddot{x}+b\dot{x}+cx=u$, denote
$x_1=x, x_2=\dot{x}$, then the system can be rewritten as
$$\left\{\begin{aligned}
& \dot x_1=x_2\\
& \dot x_2 = -bx_2-cx_1+u
\end{aligned}\right.$$
Question 5 (20 Pts.)
The
Game of Life,
also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970.
It is the best-known example of a cellular automaton.
This game uses an
m x n
grid of cells, and each cell begins with one of two states:
alive (noted by a 1) or dead (noted by a 0). Each cell then interacts with the eight cells that surround
it (these can be horizontal, vertical, or diagonal) based on these four rules:
The next state is created by applying the above rules simultaneously to every cell in the current state,
where births and deaths occur simultaneously. Write a function to compute the next state of the following states.
Note that you can take the border of the grid as dead cells.
Examples: