Professional Documents
Culture Documents
Assignment - 4 - Instrumentation and Control - State Space Quiz
Assignment - 4 - Instrumentation and Control - State Space Quiz
L1 L2
A
V1 + C1 + V2
− −
B
R1
C2
dVC1
ẋ1 dt x1 VC1
ẋ2 dVC2 x2 VC2
= didt ; =
ẋ3 L1 x3 iL1
dt
ẋ4 diL2 x4 iL2
dt
KVL at loop 1
1
ẋ1 = (x3 − x4 ) (2)
C1
KVl at loop 2
diL2
−VC1 + L2 + V2 (t) + VR = 0
dt
1
ẋ4 = (x1 − V2 (t) − R1 x4 ) (3)
L2
KCL at node B
iL2 = iC2 + iC1
1
dV2 dV1
C2 = C1 + iL2
dt dt
C1 1 1
ẋ2 = (x3 − x4 ) + x4
C2 C1 C2
1
ẋ2 = x3 (4)
C2
2 MATLAB
2.1 Tranfer Function at C1
Solving the Output of C1:
y(t) = VC1
y(t) = x1
Then, we set the state space matrices as
G1 =
>> G2
G2 =
2
2.2 Transfer Function at C2
Solving the Output of C2:
y(t) = VC2
y(t) = x2
Then, we set the state space matrices as
0 100 × 103 −100 × 103
0 0 0
3
0 0 100 × 10 0 0 0
A= −0.5 0.5
;B =
0 0 0.5 0
0.5 0 0 −5 0 −0.5
C= 0 1 0 0 ; D= 0 0
>> % State space to transfer function
A = [0 0 100000 -100000; 0 0 100000 0; -0.5 0.5 0 0; 0.5 0 0 -5];
B = [0 0; 0 0; 0.5 0; 0 -0.5];
C = [0 1 0 0];
D = [0 0];
G1 =
>> G2
G2 =
-2.5e09
---------------------------------------------
s^4 + 5 s^3 + 5e04 s^2 + 1.863e-09 s - 2.5e09
3
Then, we set the state space matrices as
0 100 × 103 −100 × 103
0 0 0
3
0 0 100 × 10 0 0 0
A= −0.5 0.5
;B =
0 0 0.5 0
0.5 0 0 −5 0 −0.5
C = −1 1 0 0 ; D = −1 0
Solving For Transfer Function at L1:
>> % State space to transfer function
A = [0 0 100000 -100000; 0 0 100000 0; -0.5 0.5 0 0; 0.5 0 0 -5];
B = [0 0; 0 0; 0.5 0; 0 -0.5];
C = [-1 1 0 0];
D = [-1 0];
G1 =
>> G2
G2 =
-50000 s^2 - 7.85e-07
---------------------------------------------
s^4 + 5 s^3 + 5e04 s^2 + 1.863e-09 s - 2.5e09
Continuous-time transfer function.
4
>> % State space to transfer function
A = [0 0 100000 -100000; 0 0 100000 0; -0.5 0.5 0 0; 0.5 0 0 -5];
B = [0 0; 0 0; 0.5 0; 0 -0.5];
C = [1 0 0 -10];
D = [0 -1];
G1 =
50000 s^2
---------------------------------------------
s^4 + 5 s^3 + 5e04 s^2 + 1.863e-09 s - 2.5e09
>> G2
G2 =
>>
5
% State space model
sys = ss(A, B, C, D, 0.25);
G1 =
250000 s
---------------------------------------------
s^4 + 5 s^3 + 5e04 s^2 + 1.863e-09 s - 2.5e09
>> G2
G2 =