.Modelica_LinearSystems2.StateSpace.Transformation.toBalancedForm

Information

Syntax

ssBalanced = StateSpace.Transformation.toBalancedForm(ss);

Description

Balancing a linear dynamic system in state space form ss means to find a state transformation x_new = T*x = diagonal(scale)*x so that the transformed system is better suited for numerical algorithms. In more detail:

This function performs a similarity transformation with T=diagonal(scale) such that S_scale

| inv(T)*A*T inv(T)*B |
S_scale = | |
| C*T 0 |

has a better condition then the system matrix S

| A B |
S = | |
| C 0 |

that is, conditionNumber(S_scale) ≤ conditionNumber(S). The elements of vector scale are multiples of 2 which means that this function does not introduce round-off errors.

Example

import Modelica.Math.Matrices.norm;
ss = Modelica_LinearSystems2.StateSpace(A=[1, -10,  1000; 0.01,  0,  10; 0.005,  -0.01,  10],
                                        B=[100, 10; 1,0; -0.003, 1],
                                        C=[-0.5, 1, 100],
                                        D=[0,0]);
sb = Modelica_LinearSystems2.StateSpace.Transformation.toBalancedForm(ss);

// norm(ss.A) = 1000.15, norm(ss.B) = 100.504, norm(ss.C) = 100.006
// norm(sb.A) = 10.8738, norm(sb.B) = 16.0136, norm(sb.C) = 10.2011

The algorithm is taken from

H. D. Joos, G. Grübel:
RASP'91 Regulator Analysis and Synthesis Programs
DLR - Control Systems Group 1991

which is based on the balance function from EISPACK.

Interface

encapsulated function toBalancedForm
  import Modelica;
  import Modelica_LinearSystems2;
  import Modelica_LinearSystems2.StateSpace;
  input StateSpace ss "State space system";
  output StateSpace ssBalanced(redeclare Real A[size(ss.A, 1), size(ss.A, 2)], redeclare Real B[size(ss.B, 1), size(ss.B, 2)], redeclare Real C[size(ss.C, 1), size(ss.C, 2)], redeclare Real D[size(ss.D, 1), size(ss.D, 2)]) "Balanced state space system";
end toBalancedForm;

Generated at 2024-12-26T19:25:54Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos