Skip to content
Snippets Groups Projects
Commit e75740e7 authored by JupyterHub User's avatar JupyterHub User
Browse files

Add systheo2functions.py to notebooks/V04..., notebooks/V06..., notebooks/V07, notebooks/V08

parent e5f742fb
No related branches found
No related tags found
1 merge request!1merge develop into master
This diff is collapsed.
%% Cell type:markdown id: tags:
# <span style='color:OrangeRed'>V7 - Steuerbarkeit und Beobachtbarkeit</span>
%% Cell type:code id: tags:
``` python
import numpy as np
pi = np.pi
sin = np.sin
cos = np.cos
sqrt = np.sqrt
exp = np.exp
atan2 = np.arctan2
log10 = np.log10
def print_det(M):
print("Determinante: "+str(np.around(np.linalg.det(M))))
def print_rank(M):
print("Rang: "+str(np.linalg.matrix_rank(M)))
from systheo2functions import *
%matplotlib inline
```
%% Cell type:markdown id: tags:
## <span style='color:Gray'>Beispiel #1 </span>
%% Cell type:markdown id: tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
Es wird das folgende Eingrößensystem betrachtet:
<br>$\dot{x}(t)$= $Ax(t)$ + $bu(t)$
<br>$y(t)$=$c^Tx(t)$
<br><br> $x$ = $\left[ \begin{array}{rrrr}
x_1 \\
x_2 \\
x_3 \\
\end{array}\right] $
<br><br> $A$ = $\left[ \begin{array}{rrrr}
-1 & -2 & -2 \\
0 & -1 & 1 \\
1 & 0 & -1 \\
\end{array}\right] $
%% Cell type:code id: tags:
``` python
A = np.array([[-1,-1,-2],[0,-1,1],[1,0,-1]]);
```
%% Cell type:markdown id: tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
$b$ = $\left[ \begin{array}{rrrr}
2 \\
0 \\
1 \\
\end{array}\right] $
%% Cell type:code id: tags:
``` python
b = np.array([[2],[0],[1]]);
```
%% Cell type:markdown id: tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
$c^T$ = $\left[ \begin{array}{rrrr}
1 & 1 & 0 \\
\end{array}\right] $
%% Cell type:code id: tags:
``` python
c = np.array([1,1,0]);
```
%% Cell type:markdown id: tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
<b>Zielsetzung</b>: Überprüfung der Steuerbarkeit und Beobachtbarkeit.
<br>Zuerst betrachten wir die <span style='color:red'>Steuerbarkeit</span>:
<br>Ein System 3. Ordnung ist vollständig zustandssteuerbar, wenn gilt:
$Rang$[$B\,|\,AB\,|\,A^2B$]=$Rang$($S_C$) = $n$ = $3$
<br><b>Mit</b>:
<br><br> $A$ = $\left[ \begin{array}{rrrr}
-1 & -2 & -2 \\
0 & -1 & 1 \\
1 & 0 & -1 \\
\end{array}\right] $
<br><br> $B$ = $b$ = $\left[ \begin{array}{rrrr}
2 \\
0 \\
1 \\
\end{array}\right] $
<br><b>Wird</b>:
<br><br> $Ab$ = $\left[ \begin{array}{rrrr}
-4 \\
1 \\
1 \\
\end{array}\right] $
<br><br> $A^2b$ = $\left[ \begin{array}{rrrr}
0 \\
0 \\
-5 \\
\end{array}\right] $
<br>Damit erhalten wir die Steuerbarkeitsmatrix:
<br>$Rang$[$b\,|\,Ab\,|\,A^2b$] = $\left[ \begin{array}{rrrr}
2 & -4 & 0 \\
0 & 1 & 0 \\
1 & 1 & -5 \\
\end{array}\right] $
%% Cell type:code id: tags:
``` python
column1 = b
column2 = np.matmul(A,b)
column3 = np.matmul(np.matmul(A,A),b)
S_C = np.c_[column1,column2,column3]
print("S_C:\n"+str(S_C))
```
%% Output
S_C:
[[ 2 -4 1]
[ 0 1 0]
[ 1 1 -5]]
%% Cell type:code id: tags:
``` python
print_det(S_C)
```
%% Output
Determinante: -11.0
%% Cell type:code id: tags:
``` python
print_rank(S_C)
```
%% Output
Rang: 3
%% Cell type:markdown id: tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
<code>det(S_C)</code> $\ne$ 0 und <code>rank(S_C)</code> = $n$ = $3$
<br>Damit ist das gegebene System <span style='color:red'>vollständig steuerbar</span>!
%% Cell type:markdown id: tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
<br>Jetzt betrachten wir die <span style='color:red'>Beobachtbarkeit</span>:
<br>Ein Eingrößensystem 3. Ordnung ist genau dann beobachtbar, wenn: $Rang$$\left[ \begin{array}{rrrr}
c^T \\
c^TA\\
c^TA^2\\
\end{array}\right] $ =$Rang$($S_O$) = $n$ = $3$
<br>Im vorliegenden Fall erhält man mit:
$c^T$ = [$1$ $1$ $0$], $c^TA$ = [$-1$ $-3$ $-1$], $c^TA^2$ = [$0$ $5$ $0$]
<br> Damit erhalten wir die Beobachtbarkeitsmatrix:
<br><br> $S_O$ = $\left[ \begin{array}{rrrr}
1 & 1 & 0 \\
-1 & -3 & -1 \\
0 & 5 & 0 \\
\end{array}\right] $
%% Cell type:code id: tags:
``` python
S_O = np.c_[c, np.matmul(c,A), np.matmul(np.matmul(c,A),A)]
print("S_C:\n"+str(S_O))
```
%% Output
S_C:
[[ 1 -1 0]
[ 1 -2 3]
[ 0 -1 1]]
%% Cell type:code id: tags:
``` python
print_det(S_O)
```
%% Output
Determinante: 2.0
%% Cell type:code id: tags:
``` python
print_rank(S_O)
```
%% Output
Rang: 3
%% Cell type:markdown id: tags:
<div style="font-family: 'times'; font-size: 13pt; text-align: justify">
<code>det(S_O)</code> $\ne$ 0 und <code>rank(S_O)</code> = $n$ = $3$
<br>Damit ist das gegebene System <span style='color:red'>vollständig beobachtbar</span>!
%% Cell type:code id: tags:
``` python
```
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment