Final Project-Modeling
Final Project-Modeling
HCM
FINAL REPORT
SOLUTION
a) Build a mathematical model
di 1
L + Ri + ∫ i dt =e i
dt C
1
C
∫ i dt=e 0
Taking the Laplace transform of this Equation, assuming zero initial conditions, we
obtain:
1 1
LsI ( s )+ RI ( s ) + I ( s )=Ei ( s )
C s
1 1
I ( s )=E0 ( s )
Cs
If e i is assumed to be the input and e 0 is the output, then the transfer function of this
system is found to be:
E0 ( s ) 1
=
Ei ( s ) LC s + RCs+1
2
Find state-Space model of this system: First, note that the differential equation for the
system can be obtained from the transfer function Equation as:
R 1 1
ë 0 + ė 0 + e 0= e
L LC LC i
Then by defining state variables by:
1
x 1=e 0
x 2=ė 0
y=x 1=e0
We obtain:
[][ ][ ] [ ]
0 1 0
ẋ1 x1
= −1 −R + 1 u
ẋ2 x2
LC L LC
And
[ y ] =[ 1 0 ]
[]
x1
x2
These two Equations give a mathematical model of the system in state space.
b) Perform simulation using Matlab/Simulink
Let:
R=50
L=0.1
C=0.000001
[][ ][ ] [ ]
0 1 0
ẋ1 x1
= −1 −50 + 1 u
ẋ2 x2
0.1× 0.000001 0.1 0.1 × 0.000001
2
Sine:
Square
3
c) Design a controller for the above system
4
d) Simulate the system with the controller using Matlab and Simulink.
Sine:
Square:
5
-The controller is designed to improve characteristics such as stability, transient time,
robustness, and reduce steady-state errors.
-Simulations for systems with controllers often exhibit faster response, less oscillation,
and stable convergence to the desired value.
Question 2: Identification
• Select model
• Build the datasheet
• Use Matlab's Identification tool to find mathematical models
• Use Matlab's Parameter estimation to identify system parameters.
• Simulation comparison between recognition model and original model
• Design Controller
• System simulation with controller (Matlab/Simulink).
SOLUTION
• Select model:
In this Figure we assume that displacements x i , x 0, and y are measured from their
respective steady-state positions. Then the Equations of motion for the mechanical
systerm shown in this Figure are:
6
b 1 ( ẋ i− ẋ 0 ) +k 1 ( x i−x 0 )=b2 ¿
b 2 ( ẋ 0− ẏ ) =k 2 y
By taking the Laplace transforms of these two Equations, assunming zero initial
conditions, we have:
b 1 [ s X i ( s )−s X 0 ( s ) ] + k 1 [ X i ( s ) −X 0 ( s ) ]=b 2 [ s X i ( s )−sY ( s ) ]
b 2 [ s X i ( s )−sY ( s ) ]=k 2 Y ( s )
b2 s X 0 ( s )
b 1 [ s X i ( s )−s X 0 ( s ) ] + k 1 [ X i ( s ) −X 0 ( s ) ]=b 2 s X 0 ( s )−b2 s
b2 s +k 2
Or
b2 s
(b ¿ ¿ 1 s+ k 1) X i ( s )=(b1 s +k 1 +b 2 s−b2 s )X ( s ) ¿
b2 s +k 2 0
( )( )
Xi (s ) b1 b b
s+1 2 s+1 + 2 s
k1 k2 k1
7
• Use Matlab's Identification tool to find mathematical models
8
Collect data:
9
New set of parameters:
10
• Simulation comparison between recognition model and original model
11
• Design Controller
PID:
12
• System simulation with controller (Matlab/Simulink).
13
-Systems without controllers: Simulations often show large, difficult-to-control
fluctuations, or failure to reach steady state in a short time.
-System with controller: Simulations demonstrate that the controller significantly
improves performance parameters. In particular, with the mentioned PID set, the system is
able to converge faster and reach the desired steady state.
14