Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lecture-tutorials
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACS
Public
Teaching materials
Systemtheorie 2
lecture-tutorials
Commits
5f54ea3f
Commit
5f54ea3f
authored
Dec 6, 2021
by
zhiyupan
Browse files
Options
Downloads
Patches
Plain Diff
replace exam example/V6.ipynb
parent
20e5fa06
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
notebooks/alt/Octsim/@myss2tf2/myss2tf2.m
+0
-10
0 additions, 10 deletions
notebooks/alt/Octsim/@myss2tf2/myss2tf2.m
notebooks/exam example/V6.ipynb
+23
-14
23 additions, 14 deletions
notebooks/exam example/V6.ipynb
with
23 additions
and
24 deletions
notebooks/alt/Octsim/@myss2tf2/myss2tf2.m
deleted
100644 → 0
+
0
−
10
View file @
20e5fa06
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];
This diff is collapsed.
Click to expand it.
notebooks/exam example/V6.ipynb
+
23
−
14
View file @
5f54ea3f
{
{
"cells": [
"cells": [
{
"cell_type": "markdown",
"id": "1f0f7673-ab1a-413f-b73c-0a248ba39ed9",
"metadata": {},
"source": [
"# <span style='color:OrangeRed'>V6 NORMALFORMEN IN ZUSTANDRAUMDARSTELLUNG</span>"
]
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"id": "9653081e-df65-4ccd-9204-e11c542a469f",
"id": "9653081e-df65-4ccd-9204-e11c542a469f",
...
@@ -14,7 +22,7 @@
...
@@ -14,7 +22,7 @@
"id": "880aa4ff-2004-4875-affc-5759aba8104e",
"id": "880aa4ff-2004-4875-affc-5759aba8104e",
"metadata": {},
"metadata": {},
"source": [
"source": [
"<img src=\"
Bilder/
Turbine.png\" alt=\"drawing\" width=\"600\" height=\"300\"/>"
"<img src=\"Turbine.png\" alt=\"drawing\" width=\"600\" height=\"300\"/>"
]
]
},
},
{
{
...
@@ -33,12 +41,12 @@
...
@@ -33,12 +41,12 @@
"id": "add7e04a-83e6-4685-b845-47137f44a388",
"id": "add7e04a-83e6-4685-b845-47137f44a388",
"metadata": {},
"metadata": {},
"source": [
"source": [
"<img src=\"
Bilder/
TurbineSchema.png\" alt=\"drawing\" width=\"600\" height=\"300\"/>"
"<img src=\"TurbineSchema.png\" alt=\"drawing\" width=\"600\" height=\"300\"/>"
]
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
2
,
"execution_count":
1
,
"id": "e050a273-a079-40b9-ac0c-194e5e7f12e8",
"id": "e050a273-a079-40b9-ac0c-194e5e7f12e8",
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [],
...
@@ -59,7 +67,7 @@
...
@@ -59,7 +67,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
3
,
"execution_count":
2
,
"id": "ef3d3be5-73cd-48d2-a773-d177b638230a",
"id": "ef3d3be5-73cd-48d2-a773-d177b638230a",
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
...
@@ -83,7 +91,7 @@
...
@@ -83,7 +91,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
4
,
"execution_count":
3
,
"id": "402f525f-8a64-4584-8d05-dbd5e42e5516",
"id": "402f525f-8a64-4584-8d05-dbd5e42e5516",
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
...
@@ -127,7 +135,7 @@
...
@@ -127,7 +135,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
5
,
"execution_count":
4
,
"id": "1ed03ed5-3913-4107-95c9-f48e52bb50ee",
"id": "1ed03ed5-3913-4107-95c9-f48e52bb50ee",
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
...
@@ -158,7 +166,7 @@
...
@@ -158,7 +166,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
6
,
"execution_count":
5
,
"id": "0d90c253-316f-47ed-9f7b-561ff0ed4868",
"id": "0d90c253-316f-47ed-9f7b-561ff0ed4868",
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
...
@@ -202,7 +210,7 @@
...
@@ -202,7 +210,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
7
,
"execution_count":
6
,
"id": "828217c8-bd90-42da-8b36-9e1f05727a24",
"id": "828217c8-bd90-42da-8b36-9e1f05727a24",
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
...
@@ -233,7 +241,7 @@
...
@@ -233,7 +241,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
8
,
"execution_count":
7
,
"id": "058ad783-d553-4bcc-873c-a6f521c16975",
"id": "058ad783-d553-4bcc-873c-a6f521c16975",
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
...
@@ -264,7 +272,7 @@
...
@@ -264,7 +272,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
9
,
"execution_count":
8
,
"id": "0c2d94f8-536c-421a-98ae-69771c0e6ca2",
"id": "0c2d94f8-536c-421a-98ae-69771c0e6ca2",
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
...
@@ -295,7 +303,7 @@
...
@@ -295,7 +303,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
10
,
"execution_count":
9
,
"id": "69e7fd06-f71a-48ec-af34-d2e406f9067c",
"id": "69e7fd06-f71a-48ec-af34-d2e406f9067c",
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
...
@@ -363,7 +371,7 @@
...
@@ -363,7 +371,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 1
5
,
"execution_count": 1
0
,
"id": "cbf41502-116d-40b5-8fec-39faf2062a03",
"id": "cbf41502-116d-40b5-8fec-39faf2062a03",
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
...
@@ -373,7 +381,7 @@
...
@@ -373,7 +381,7 @@
"text": [
"text": [
"num =\n",
"num =\n",
"\n",
"\n",
" 0.0044243 0.0037458\n",
"
0.0000000
0.0044243 0.0037458\n",
"\n",
"\n",
"den =\n",
"den =\n",
"\n",
"\n",
...
@@ -392,7 +400,8 @@
...
@@ -392,7 +400,8 @@
}
}
],
],
"source": [
"source": [
"[num den] = myss2tf2(Fi,Gi,C)\n",
"pkg load signal\n",
"[num den] = ss2tf(Fi,Gi,C,D)\n",
"Gz = tf(num,den,Ts)"
"Gz = tf(num,den,Ts)"
]
]
},
},
...
...
%% Cell type:markdown id:1f0f7673-ab1a-413f-b73c-0a248ba39ed9 tags:
# <span style='color:OrangeRed'>V6 NORMALFORMEN IN ZUSTANDRAUMDARSTELLUNG</span>
%% Cell type:markdown id:9653081e-df65-4ccd-9204-e11c542a469f tags:
%% Cell type:markdown id:9653081e-df65-4ccd-9204-e11c542a469f tags:
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
Gegeben ist die Prinzipskizze einer Wasserturbine zur Stromerzeugung:
Gegeben ist die Prinzipskizze einer Wasserturbine zur Stromerzeugung:
%% Cell type:markdown id:880aa4ff-2004-4875-affc-5759aba8104e tags:
%% Cell type:markdown id:880aa4ff-2004-4875-affc-5759aba8104e tags:
<img
src=
"
Bilder/
Turbine.png"
alt=
"drawing"
width=
"600"
height=
"300"
/>
<img
src=
"Turbine.png"
alt=
"drawing"
width=
"600"
height=
"300"
/>
%% Cell type:markdown id:a27e62db-897e-41e8-9b56-fd8c6b48f3bf tags:
%% Cell type:markdown id:a27e62db-897e-41e8-9b56-fd8c6b48f3bf tags:
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
Die Wasserturbine sei in dieser Aufgabe die zu betrachtende Regelstrecke, die als linear
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
angenommen wird. Damit lässt sich das System der Wasserturbine gemäß des nachfolgenden
Wirkungsplans darstellen:
Wirkungsplans darstellen:
%% Cell type:markdown id:add7e04a-83e6-4685-b845-47137f44a388 tags:
%% Cell type:markdown id:add7e04a-83e6-4685-b845-47137f44a388 tags:
<img
src=
"
Bilder/
TurbineSchema.png"
alt=
"drawing"
width=
"600"
height=
"300"
/>
<img
src=
"TurbineSchema.png"
alt=
"drawing"
width=
"600"
height=
"300"
/>
%% Cell type:code id:e050a273-a079-40b9-ac0c-194e5e7f12e8 tags:
%% Cell type:code id:e050a273-a079-40b9-ac0c-194e5e7f12e8 tags:
```
octave
```
octave
% Necessary to use control toolbox
% Necessary to use control toolbox
pkg load control
pkg load control
clear all
clear all
```
```
%% Cell type:markdown id:1943a7dc-b837-4623-8792-a1775026155d tags:
%% Cell type:markdown id:1943a7dc-b837-4623-8792-a1775026155d tags:
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
Geben Sie die Zustandsraumdarstellung des Systems
Geben Sie die Zustandsraumdarstellung des Systems
%% Cell type:code id:ef3d3be5-73cd-48d2-a773-d177b638230a tags:
%% Cell type:code id:ef3d3be5-73cd-48d2-a773-d177b638230a tags:
```
octave
```
octave
Kb = 500
Kb = 500
Kt = 104
Kt = 104
Kv = 2
Kv = 2
J = 100
J = 100
```
```
%% Output
%% Output
Kb = 500
Kb = 500
Kt = 104
Kt = 104
Kv = 2
Kv = 2
J = 100
J = 100
%% Cell type:code id:402f525f-8a64-4584-8d05-dbd5e42e5516 tags:
%% Cell type:code id:402f525f-8a64-4584-8d05-dbd5e42e5516 tags:
```
octave
```
octave
A = [0 -Kv;Kt/J -Kb/J]
A = [0 -Kv;Kt/J -Kb/J]
B = [1; 0]
B = [1; 0]
C = [0 1]
C = [0 1]
D = 0
D = 0
```
```
%% Output
%% Output
A =
A =
0.00000 -2.00000
0.00000 -2.00000
1.04000 -5.00000
1.04000 -5.00000
B =
B =
1
1
0
0
C =
C =
0 1
0 1
D = 0
D = 0
%% Cell type:markdown id:8629e5a2-ae35-418d-8a65-7e511440917e tags:
%% Cell type:markdown id:8629e5a2-ae35-418d-8a65-7e511440917e tags:
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
Dann berechnen wir die Eigenwerte
Dann berechnen wir die Eigenwerte
%% Cell type:code id:1ed03ed5-3913-4107-95c9-f48e52bb50ee tags:
%% Cell type:code id:1ed03ed5-3913-4107-95c9-f48e52bb50ee tags:
```
octave
```
octave
p = eigs(A)
p = eigs(A)
```
```
%% Output
%% Output
p =
p =
-4.54206
-4.54206
-0.45794
-0.45794
%% Cell type:markdown id:0353e887-ebe2-44d0-b7fb-a191622cabff tags:
%% Cell type:markdown id:0353e887-ebe2-44d0-b7fb-a191622cabff tags:
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
Dann wenden wir das Caley-Hamilton-Theorem an
Dann wenden wir das Caley-Hamilton-Theorem an
%% Cell type:code id:0d90c253-316f-47ed-9f7b-561ff0ed4868 tags:
%% Cell type:code id:0d90c253-316f-47ed-9f7b-561ff0ed4868 tags:
```
octave
```
octave
Ts = 0.1;
Ts = 0.1;
Ac = [1 p(1);1 p(2)]
Ac = [1 p(1);1 p(2)]
Bc = [expm(p(1)*Ts);expm(p(2)*Ts)]
Bc = [expm(p(1)*Ts);expm(p(2)*Ts)]
alfa = inv(Ac)*Bc
alfa = inv(Ac)*Bc
```
```
%% Output
%% Output
Ac =
Ac =
1.00000 -4.54206
1.00000 -4.54206
1.00000 -0.45794
1.00000 -0.45794
Bc =
Bc =
0.63495
0.63495
0.95524
0.95524
alfa =
alfa =
0.991151
0.991151
0.078422
0.078422
%% Cell type:markdown id:d4fac333-e43d-49c7-aaec-6168b86bd6a6 tags:
%% Cell type:markdown id:d4fac333-e43d-49c7-aaec-6168b86bd6a6 tags:
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
und dann:
und dann:
%% Cell type:code id:828217c8-bd90-42da-8b36-9e1f05727a24 tags:
%% Cell type:code id:828217c8-bd90-42da-8b36-9e1f05727a24 tags:
```
octave
```
octave
Fi = alfa(1)*eye(2)+alfa(2)*A
Fi = alfa(1)*eye(2)+alfa(2)*A
```
```
%% Output
%% Output
Fi =
Fi =
0.991151 -0.156845
0.991151 -0.156845
0.081559 0.599039
0.081559 0.599039
%% Cell type:markdown id:a6ed8d3e-8d76-451c-8480-7182a8723ab2 tags:
%% Cell type:markdown id:a6ed8d3e-8d76-451c-8480-7182a8723ab2 tags:
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
Wir Konnen vergleichen unsere Berechnungen mit Octave:
Wir Konnen vergleichen unsere Berechnungen mit Octave:
%% Cell type:code id:058ad783-d553-4bcc-873c-a6f521c16975 tags:
%% Cell type:code id:058ad783-d553-4bcc-873c-a6f521c16975 tags:
```
octave
```
octave
Fio = expm(A*Ts)
Fio = expm(A*Ts)
```
```
%% Output
%% Output
Fio =
Fio =
0.991151 -0.156845
0.991151 -0.156845
0.081559 0.599039
0.081559 0.599039
%% Cell type:markdown id:63fb7dec-c4e2-4e53-b6f9-bea0649fd521 tags:
%% Cell type:markdown id:63fb7dec-c4e2-4e53-b6f9-bea0649fd521 tags:
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
Die andere Matrix können wir so berechnen:
Die andere Matrix können wir so berechnen:
%% Cell type:code id:0c2d94f8-536c-421a-98ae-69771c0e6ca2 tags:
%% Cell type:code id:0c2d94f8-536c-421a-98ae-69771c0e6ca2 tags:
```
octave
```
octave
Gi = (Fi-eye(2))*inv(A)*B
Gi = (Fi-eye(2))*inv(A)*B
```
```
%% Output
%% Output
Gi =
Gi =
0.0996930
0.0996930
0.0044243
0.0044243
%% Cell type:markdown id:8a4be558-f51c-415e-96f7-922b8e417422 tags:
%% Cell type:markdown id:8a4be558-f51c-415e-96f7-922b8e417422 tags:
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
Zu vergleichen:
Zu vergleichen:
%% Cell type:code id:69e7fd06-f71a-48ec-af34-d2e406f9067c tags:
%% Cell type:code id:69e7fd06-f71a-48ec-af34-d2e406f9067c tags:
```
octave
```
octave
sys = ss(A,B,C,D)
sys = ss(A,B,C,D)
sysd = c2d(sys,Ts,'zoh')
sysd = c2d(sys,Ts,'zoh')
```
```
%% Output
%% Output
sys.a =
sys.a =
x1 x2
x1 x2
x1 0 -2
x1 0 -2
x2 1.04 -5
x2 1.04 -5
sys.b =
sys.b =
u1
u1
x1 1
x1 1
x2 0
x2 0
sys.c =
sys.c =
x1 x2
x1 x2
y1 0 1
y1 0 1
sys.d =
sys.d =
u1
u1
y1 0
y1 0
Continuous-time model.
Continuous-time model.
sysd.a =
sysd.a =
x1 x2
x1 x2
x1 0.9912 -0.1568
x1 0.9912 -0.1568
x2 0.08156 0.599
x2 0.08156 0.599
sysd.b =
sysd.b =
u1
u1
x1 0.09969
x1 0.09969
x2 0.004424
x2 0.004424
sysd.c =
sysd.c =
x1 x2
x1 x2
y1 0 1
y1 0 1
sysd.d =
sysd.d =
u1
u1
y1 0
y1 0
Sampling time: 0.1 s
Sampling time: 0.1 s
Discrete-time model.
Discrete-time model.
%% Cell type:markdown id:4fb92a07-3450-4c37-bef4-7e3734cc8c20 tags:
%% Cell type:markdown id:4fb92a07-3450-4c37-bef4-7e3734cc8c20 tags:
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
<div
style=
"font-family: 'times'; font-size: 13pt; text-align: justify"
>
Jetzt können wir die Übertragungsfunktion in z-domän berechnen:
Jetzt können wir die Übertragungsfunktion in z-domän berechnen:
%% Cell type:code id:cbf41502-116d-40b5-8fec-39faf2062a03 tags:
%% Cell type:code id:cbf41502-116d-40b5-8fec-39faf2062a03 tags:
```
octave
```
octave
[num den] = myss2tf2(Fi,Gi,C)
pkg load signal
[num den] = ss2tf(Fi,Gi,C,D)
Gz = tf(num,den,Ts)
Gz = tf(num,den,Ts)
```
```
%% Output
%% Output
num =
num =
0.0044243 0.0037458
0.0000000
0.0044243 0.0037458
den =
den =
1.00000 -1.59019 0.60653
1.00000 -1.59019 0.60653
Transfer function 'Gz' from input 'u1' to output ...
Transfer function 'Gz' from input 'u1' to output ...
0.004424 z + 0.003746
0.004424 z + 0.003746
y1: ---------------------
y1: ---------------------
z^2 - 1.59 z + 0.6065
z^2 - 1.59 z + 0.6065
Sampling time: 0.1 s
Sampling time: 0.1 s
Discrete-time model.
Discrete-time model.
%% Cell type:code id:6ebd4c8d-4218-41b7-aa86-902033541283 tags:
%% Cell type:code id:6ebd4c8d-4218-41b7-aa86-902033541283 tags:
```
octave
```
octave
```
```
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment