## Modelica_LinearSystems2.WorkInProgress.Tests.Design

Tests for controller design

### Package Content

Name | Description
--- | ---
conditionNumbers | Calculate several condition numbers to evaluate a pole assigment method
data_Chow_Kokotovic | Example for pole assignment
data_Kautsky1 | Example for pole assignment
data_Kautsky2 | Example for pole assignment
data_Laub | Example for pole assignment
data_Byers3 | Example for pole assignment
data_Byers4 | Example for pole assignment
data_Byers5 | Example for pole assignment
data_Byers6 | Example for pole assignment
data_Benner6 | Example for pole assignment
DesignData_Chow_Kokotovic | Contains the system matrix A, the input matrix B, the assigned Poles and optionally the ideal feedback matrix
DesignData_Benner6 | Contains the system matrix A, the input matrix B, the assigned Poles and optionally the ideal feedback matrix
testPoleAssignment | Function to assess algorithms for pole assignment
testPoleAssignment2 | Function to assess algorithms for pole assignment
testPoleAssignment3 | Function to assess algorithms for pole assignment
runAll | Executes controller design for the according data in directory Test\data
kalmanStep | Example for one recursion of the conventional Kalman filter equations
kalmanStep2 | Example for one recursion of the conventional Kalman filter equations

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.conditionNumbers

Calculate several condition numbers to evaluate a pole assigment method

### Information

Extends from Modelica.Icons.Function (Icon for functions).

### Inputs

Name | Description
--- | ---
K[:, :] | state feedback matrix
X[:, :] | right eigenvectors of the closed loop system
assignedPoles[size(X, 1)] |
calcPoles[size(X, 1)] |

### Outputs

Name | Description
--- | ---
kappa2X | condition number kappa_2(X) = ||X||_2 * ||inv(X)||_2
kappaFroX | condition number kappa_F(X) = ||X||_F * ||inv(X)||_F
kappaFroYT | condition number kappa_F(YT) = ||YT||_F * ||inv(YT)||_F
cInf | condition number vu1=||c||_inf = max(c_j)
norm2K | Euclidean norm of the feedback matrix
normFroK | Frobenius norm of the feedback matrix
kappa2X_B | condition number by Byers, kappa_2XB(X) = (||X||_F)^2 + (||inv(X)||_F)^2
JXK[11] | condition number by Varga, JKX=alpha*(kappa2X_B)/2 + (1-alpha)*normFroK^/22
dl | gap between the assigned and the calculated poles dl=norm(ap-cp)/max(1,norm(ap))

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.data_Chow_Kokotovic

Example for pole assignment

### Information

Extends from Modelica.Icons.Function (Icon for functions).

### Inputs

Name | Description
--- | ---
d |

### Outputs

Name | Description
--- | ---
data |

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.data_Kautsky1

Example for pole assignment

### Information

Extends from Modelica.Icons.Function (Icon for functions).

### Outputs

Name | Description
--- | ---
data |

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.data_Kautsky2

Example for pole assignment

### Information

Extends from Modelica.Icons.Function (Icon for functions).

### Outputs

Name | Description
--- | ---
data |

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.data_Laub

Example for pole assignment

### Information

Extends from Modelica.Icons.Function (Icon for functions).

### Inputs

Name | Description
--- | ---
n |
m |
alpha |

### Outputs

Name | Description
--- | ---
data |

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.data_Byers3

Example for pole assignment

### Information

Extends from Modelica.Icons.Function (Icon for functions).

### Outputs

Name | Description
--- | ---
data |

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.data_Byers4

Example for pole assignment

### Information

Extends from Modelica.Icons.Function (Icon for functions).

### Outputs

Name | Description
--- | ---
data |

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.data_Byers5

Example for pole assignment

### Information

Extends from Modelica.Icons.Function (Icon for functions).

### Outputs

Name | Description
--- | ---
data |

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.data_Byers6

Example for pole assignment

### Information

Extends from Modelica.Icons.Function (Icon for functions).

### Outputs

Name | Description
--- | ---
data |

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.data_Benner6

Example for pole assignment

### Information

Extends from Modelica.Icons.Function (Icon for functions).

### Inputs

Name | Description
--- | ---
nn |

### Outputs

Name | Description
--- | ---
data |

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.DesignData_Chow_Kokotovic

Contains the system matrix A, the input matrix B, the assigned Poles and optionally the ideal feedback matrix

### Information

Extends from Modelica.Icons.Record (Icon for records).

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.DesignData_Benner6

Contains the system matrix A, the input matrix B, the assigned Poles and optionally the ideal feedback matrix

### Information

Extends from Modelica.Icons.Record (Icon for records).

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.testPoleAssignment

Function to assess algorithms for pole assignment

### Information

Computes the gain vector k for the state space system

    ss = StateSpace(A=[-1,1;0,-2],B=[0, 1],C=[1,0; 0, 1],D=[0; 0])

such that for the state feedback

    u = -k*y = -k*x

the closed-loop poles are placed at

    p = {-3,-4}.

Extends from Modelica.Icons.Function (Icon for functions).

### Inputs

Name | Description
--- | ---
data |
method | method for pole assignment
isSI |

### Outputs

Name | Description
--- | ---
K[size(data.B, 2), size(data.A, 1)] | Feedback gain matrix
calcPoles[size(data.A, 1)] |
kappa2 | condition number kappa_2(X) = ||X||_2 * ||inv(X)||_2
kappaF | condition number kappa_F(X) = ||X||_F * ||inv(X)||_F
zeta | condition number by Byers, zeta(X) = (||X||_F)^2 + (||inv(X)||_F)^2
cInf | condition number vu1=||c||_inf = max(c_j)
nu2 | Euclidean norm of the feedback matrix
nuF | Frobenius norm of the feedback matrix
dlambda | Distance between the assigned and the calculated poles
gap |
Jalpha[11] | Combined condition number, JKX=alpha/2*(kappa2X_B) + (1-alpha)/2*normFroK^2
X[:, :] | right eigenvectors of the closed loop system

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.testPoleAssignment2

Function to assess algorithms for pole assignment

### Information

Computes the feedback gain K for the state space system according to assigned close loop poles

Extends from Modelica.Icons.Function (Icon for functions).

### Inputs

Name | Description
--- | ---
method | method for pole assignment
isSI |
outputFile |
deleteExistingOutputfile |
system data definition
dataFile |

### Outputs

Name | Description
--- | ---
K[size(B, 2), size(A, 1)] | Feedback gain matrix
calcPoles[:] |
kappa2 | condition number kappa_2(X) = ||X||_2 * ||inv(X)||_2
kappaF | condition number kappa_F(X) = ||X||_F * ||inv(X)||_F
zeta | condition number by Byers, zeta(X) = (||X||_F)^2 + (||inv(X)||_F)^2
cInf | condition number vu1=||c||_inf = max(c_j)
nu2 | Euclidean norm of the feedback matrix
nuF | Frobenius norm of the feedback matrix
dlambda | Distance between the assigned and the calculated poles
gap |
Jalpha[11] | Combined condition number, JKX=alpha/2*(kappa2X_B) + (1-alpha)/2*normFroK^2
X[:, :] | right eigenvectors of the closed loop system

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.testPoleAssignment3

Function to assess algorithms for pole assignment

### Information

Computes the gain vector k for the state space system

    ss = StateSpace(A=[-1,1;0,-2],B=[0, 1],C=[1,0; 0, 1],D=[0; 0])

such that for the state feedback

    u = -k*y = -k*x

the closed-loop poles are placed at

    p = {-3,-4}.

Extends from Modelica.Icons.Function (Icon for functions).

### Inputs

Name | Description
--- | ---
data |
method | method for pole assignment
isSI |

### Outputs

Name | Description
--- | ---
K[size(data.B, 2), size(data.A, 1)] | Feedback gain matrix
calcPoles[size(data.A, 1)] |
kappa2 | condition number kappa_2(X) = ||X||_2 * ||inv(X)||_2
kappaF | condition number kappa_F(X) = ||X||_F * ||inv(X)||_F
zeta | condition number by Byers, zeta(X) = (||X||_F)^2 + (||inv(X)||_F)^2
cInf | condition number vu1=||c||_inf = max(c_j)
nu2 | Euclidean norm of the feedback matrix
nuF | Frobenius norm of the feedback matrix
dlambda | Distance between the assigned and the calculated poles
gap |
Jalpha[11] | Combined condition number, JKX=alpha/2*(kappa2X_B) + (1-alpha)/2*normFroK^2
X[:, :] | right eigenvectors of the closed loop system

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.runAll

Executes controller design for the according data in directory Test\data

### Information

Extends from Modelica.Icons.Function (Icon for functions).

### Inputs

Name | Description
--- | ---
dataSpecifier |
fileSpecifier |
directoryName |
outputFile |
method | method for pole assignment
isSI |
fileNameSpec |

### Outputs

Name | Description
--- | ---
numberOfFunctions |
ok |

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.kalmanStep

Example for one recursion of the conventional Kalman filter equations

### Information

Extends from Modelica.Icons.Function (Icon for functions).

### Outputs

Name | Description
--- | ---
P_out[:, :] |
K[:, :] |
R_out[:, :] |

## Modelica_LinearSystems2.WorkInProgress.Tests.Design.kalmanStep2

Example for one recursion of the conventional Kalman filter equations

### Information

Extends from Modelica.Icons.Function (Icon for functions).

### Outputs

Name | Description
--- | ---
P_out[:, :] |
K[:, :] |
R_out[:, :] |