Skip to content
Snippets Groups Projects
Commit 20e5fa06 authored by zhiyupan's avatar zhiyupan
Browse files

add V6-V9

parent 2998eb23
Branches
No related tags found
No related merge requests found
...@@ -7,22 +7,6 @@ classdef DTStateSpace < DTBlock ...@@ -7,22 +7,6 @@ classdef DTStateSpace < DTBlock
xo xo
end end
methods methods
function c = DTStateSpace(in,out,A,B,C,D,T)
c = c@DTBlock();
c.A = A;
c.B = B;
c.C = C;
c.D = D;
c.Ts = T;
c.ninput = size(B,2);
c.noutput = size(C,1);
c.inpos = in;
c.outpos = out;
c.nstate = size(c.A,1);
c.xo = zeros(1,c.nstate);
c.x = c.xo;
end
function c = DTStateSpace(in,out,A,B,C,D,T,xo) function c = DTStateSpace(in,out,A,B,C,D,T,xo)
c = c@DTBlock(); c = c@DTBlock();
c.A = A; c.A = A;
......
function [num den] = myss2tf2(A,B,C)
n2 = -A(1,1)*B(2)*C(2)+A(1,2)*B(2)*C(1)+A(2,1)*B(1)*C(2)-A(2,2)*B(1)*C(1);
n1 = B(1)*C(1)+B(2)*C(2);
d1 = -A(1,1)-A(2,2);
d2 = A(1,1)*A(2,2)-A(1,2)*A(2,1);
num = [n1 n2];
den = [1 d1 d2];
notebooks/exam example/Bilder/Turbine.png

69.3 KiB

notebooks/exam example/Bilder/TurbineSchema.png

77.5 KiB

%% Cell type:markdown id:9653081e-df65-4ccd-9204-e11c542a469f tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Gegeben ist die Prinzipskizze einer Wasserturbine zur Stromerzeugung:
%% Cell type:markdown id:880aa4ff-2004-4875-affc-5759aba8104e tags:
<img src="Bilder/Turbine.png" alt="drawing" width="600" height="300"/>
%% Cell type:markdown id:a27e62db-897e-41e8-9b56-fd8c6b48f3bf tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Die Wasserturbine sei in dieser Aufgabe die zu betrachtende Regelstrecke, die als linear
angenommen wird. Damit lässt sich das System der Wasserturbine gemäß des nachfolgenden
Wirkungsplans darstellen:
%% Cell type:markdown id:add7e04a-83e6-4685-b845-47137f44a388 tags:
<img src="Bilder/TurbineSchema.png" alt="drawing" width="600" height="300"/>
%% Cell type:code id:e050a273-a079-40b9-ac0c-194e5e7f12e8 tags:
``` octave
% Necessary to use control toolbox
pkg load control
clear all
```
%% Cell type:markdown id:1943a7dc-b837-4623-8792-a1775026155d tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Geben Sie die Zustandsraumdarstellung des Systems
%% Cell type:code id:ef3d3be5-73cd-48d2-a773-d177b638230a tags:
``` octave
Kb = 500
Kt = 104
Kv = 2
J = 100
```
%% Output
Kb = 500
Kt = 104
Kv = 2
J = 100
%% Cell type:code id:402f525f-8a64-4584-8d05-dbd5e42e5516 tags:
``` octave
A = [0 -Kv;Kt/J -Kb/J]
B = [1; 0]
C = [0 1]
D = 0
```
%% Output
A =
0.00000 -2.00000
1.04000 -5.00000
B =
1
0
C =
0 1
D = 0
%% Cell type:markdown id:8629e5a2-ae35-418d-8a65-7e511440917e tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Dann berechnen wir die Eigenwerte
%% Cell type:code id:1ed03ed5-3913-4107-95c9-f48e52bb50ee tags:
``` octave
p = eigs(A)
```
%% Output
p =
-4.54206
-0.45794
%% Cell type:markdown id:0353e887-ebe2-44d0-b7fb-a191622cabff tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Dann wenden wir das Caley-Hamilton-Theorem an
%% Cell type:code id:0d90c253-316f-47ed-9f7b-561ff0ed4868 tags:
``` octave
Ts = 0.1;
Ac = [1 p(1);1 p(2)]
Bc = [expm(p(1)*Ts);expm(p(2)*Ts)]
alfa = inv(Ac)*Bc
```
%% Output
Ac =
1.00000 -4.54206
1.00000 -0.45794
Bc =
0.63495
0.95524
alfa =
0.991151
0.078422
%% Cell type:markdown id:d4fac333-e43d-49c7-aaec-6168b86bd6a6 tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
und dann:
%% Cell type:code id:828217c8-bd90-42da-8b36-9e1f05727a24 tags:
``` octave
Fi = alfa(1)*eye(2)+alfa(2)*A
```
%% Output
Fi =
0.991151 -0.156845
0.081559 0.599039
%% Cell type:markdown id:a6ed8d3e-8d76-451c-8480-7182a8723ab2 tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Wir Konnen vergleichen unsere Berechnungen mit Octave:
%% Cell type:code id:058ad783-d553-4bcc-873c-a6f521c16975 tags:
``` octave
Fio = expm(A*Ts)
```
%% Output
Fio =
0.991151 -0.156845
0.081559 0.599039
%% Cell type:markdown id:63fb7dec-c4e2-4e53-b6f9-bea0649fd521 tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Die andere Matrix können wir so berechnen:
%% Cell type:code id:0c2d94f8-536c-421a-98ae-69771c0e6ca2 tags:
``` octave
Gi = (Fi-eye(2))*inv(A)*B
```
%% Output
Gi =
0.0996930
0.0044243
%% Cell type:markdown id:8a4be558-f51c-415e-96f7-922b8e417422 tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Zu vergleichen:
%% Cell type:code id:69e7fd06-f71a-48ec-af34-d2e406f9067c tags:
``` octave
sys = ss(A,B,C,D)
sysd = c2d(sys,Ts,'zoh')
```
%% Output
sys.a =
x1 x2
x1 0 -2
x2 1.04 -5
sys.b =
u1
x1 1
x2 0
sys.c =
x1 x2
y1 0 1
sys.d =
u1
y1 0
Continuous-time model.
sysd.a =
x1 x2
x1 0.9912 -0.1568
x2 0.08156 0.599
sysd.b =
u1
x1 0.09969
x2 0.004424
sysd.c =
x1 x2
y1 0 1
sysd.d =
u1
y1 0
Sampling time: 0.1 s
Discrete-time model.
%% Cell type:markdown id:4fb92a07-3450-4c37-bef4-7e3734cc8c20 tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Jetzt können wir die Übertragungsfunktion in z-domän berechnen:
%% Cell type:code id:cbf41502-116d-40b5-8fec-39faf2062a03 tags:
``` octave
[num den] = myss2tf2(Fi,Gi,C)
Gz = tf(num,den,Ts)
```
%% Output
num =
0.0044243 0.0037458
den =
1.00000 -1.59019 0.60653
Transfer function 'Gz' from input 'u1' to output ...
0.004424 z + 0.003746
y1: ---------------------
z^2 - 1.59 z + 0.6065
Sampling time: 0.1 s
Discrete-time model.
%% Cell type:code id:6ebd4c8d-4218-41b7-aa86-902033541283 tags:
``` octave
```
%% Cell type:markdown id:c47fa3d9-51c0-4181-89d4-42bc55f053c1 tags:
# <span style='color:OrangeRed'>V7 STEUERBARKEIT UND BEOBACHTBARKEIT</span>
%% Cell type:markdown id:9653081e-df65-4ccd-9204-e11c542a469f tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Ziel ist hier überzuprufen Sie, ob jedes lineare, zeitdiskrete System 3. Ordnung in Regelungsnormalform/Beobachtungsnormalform
steuerbar bzw. beobachtbar ist.</p>
b1) Stellen Sie für ein beliebiges lineares, zeitdiskretes System 3. Ordnung das Zustandsraummodell
in Beobachtungsnormalform auf.</p>
b2) Stellen Sie die Beobachtbarkeitsmatrix für das System aus Aufgabenteil b1) auf und
begründen Sie, ob jenes System stets beobachtbar ist.</p>
b3) Verifizieren Sie, dass die Steuerbarkeitsmatrix eines beliebigen linearen, zeitdiskreten
Systems 3. Ordnung in Regelungsnormalform der Beobachtbarkeitsmatrix aus Aufgabenteil
b2) entspricht und begründen Sie damit, ob jedes lineare, zeitdiskrete
System 3. Ordnung in Regelungsnormalform stets steuerbar ist.</p>
%% Cell type:code id:1cf4028f-c9ee-468a-995a-2284567c6a02 tags:
``` octave
pkg load symbolic
```
%% Cell type:markdown id:a27e62db-897e-41e8-9b56-fd8c6b48f3bf tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Die Zustandsraumdarstellung in Beobachtungsnormalform für ein beliebiges lineares,
zeitdiskretes System 3. Ordnung lautet:
%% Cell type:code id:e050a273-a079-40b9-ac0c-194e5e7f12e8 tags:
``` octave
syms a1 a2 a3
syms b0 b1 b2 b3
```
%% Cell type:code id:402f525f-8a64-4584-8d05-dbd5e42e5516 tags:
``` octave
A = [0 0 -a3; 1 0 -a2; 0 1 -a1]
B = [b3-b0*a3; b2-b0*a2; b1-b0*a1]
C = [0 0 1]
D = b0
```
%% Output
A = (sym 3×3 matrix)
⎡0 0 -a₃⎤
⎢ ⎥
⎢1 0 -a₂⎥
⎢ ⎥
⎣0 1 -a₁⎦
B = (sym 3×1 matrix)
⎡-a₃⋅b₀ + b₃⎤
⎢ ⎥
⎢-a₂⋅b₀ + b₂⎥
⎢ ⎥
⎣-a₁⋅b₀ + b₁⎦
C =
0 0 1
D = (sym) b₀
%% Cell type:markdown id:8629e5a2-ae35-418d-8a65-7e511440917e tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Aufstellen der Beobachtbarkeitsmatrix
%% Cell type:code id:1ed03ed5-3913-4107-95c9-f48e52bb50ee tags:
``` octave
So = [C; C*A; C*A*A]
```
%% Output
So = (sym 3×3 matrix)
⎡0 0 1 ⎤
⎢ ⎥
⎢0 1 -a₁ ⎥
⎢ ⎥
⎢ 2 ⎥
⎣1 -a₁ a₁ - a₂⎦
%% Cell type:markdown id:0353e887-ebe2-44d0-b7fb-a191622cabff tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Um Beobachtbarkeit überzuprufen berechnnen wir die Determinant
%% Cell type:code id:0d90c253-316f-47ed-9f7b-561ff0ed4868 tags:
``` octave
det(So)
```
%% Output
ans = (sym) -1
%% Cell type:markdown id:d4fac333-e43d-49c7-aaec-6168b86bd6a6 tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
So hat denn vollen Rang, weshalb jedes lineare, zeitdiskrete System 3. Ordnung in Beobachtungsnormalform
beobachtbar ist.
%% Cell type:markdown id:a6ed8d3e-8d76-451c-8480-7182a8723ab2 tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Die Regelungsnormalform und Beobachtungsnormalform sind zueinander dual.
Das heißt es gilt:
%% Cell type:code id:828217c8-bd90-42da-8b36-9e1f05727a24 tags:
``` octave
As = A.'
Bs = C.'
Cs = B.'
Ds = D
```
%% Output
As = (sym 3×3 matrix)
⎡ 0 1 0 ⎤
⎢ ⎥
⎢ 0 0 1 ⎥
⎢ ⎥
⎣-a₃ -a₂ -a₁⎦
Bs =
0
0
1
Cs = (sym) [-a₃⋅b₀ + b₃ -a₂⋅b₀ + b₂ -a₁⋅b₀ + b₁] (1×3 matrix)
Ds = (sym) b₀
%% Cell type:markdown id:63fb7dec-c4e2-4e53-b6f9-bea0649fd521 tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Aufstellen der Steuerbarkeitsmatrix
%% Cell type:code id:0c2d94f8-536c-421a-98ae-69771c0e6ca2 tags:
``` octave
Ss = [Bs As*Bs As*As*Bs]
```
%% Output
Ss = (sym 3×3 matrix)
⎡0 0 1 ⎤
⎢ ⎥
⎢0 1 -a₁ ⎥
⎢ ⎥
⎢ 2 ⎥
⎣1 -a₁ a₁ - a₂⎦
%% Cell type:markdown id:8a4be558-f51c-415e-96f7-922b8e417422 tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Ss = So. Um Steuerbarkeit überzuprufen berechnnen wir auf jedem Fall die Determinant
%% Cell type:code id:69e7fd06-f71a-48ec-af34-d2e406f9067c tags:
``` octave
det(Ss)
```
%% Output
ans = (sym) -1
%% Cell type:markdown id:4fb92a07-3450-4c37-bef4-7e3734cc8c20 tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
So hat denn vollen Rang (wie erwartet), weshalb jedes lineare, zeitdiskrete System 3. Ordnung in Regelungnormalform
steuerbar ist.
%% Cell type:code id:6ebd4c8d-4218-41b7-aa86-902033541283 tags:
``` octave
```
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment