Robust Initialization of Differential Algebraic Equations · Robust Initialization of Differential Algebraic Equations ... 2007-07-30 Robust Initialization of Differential Algebraic
Post on 25-Apr-2018
238 Views
Preview:
Transcript
Robust Initialization ofDifferential Algebraic Equations
Bernhard BachmannFachhochschule Bielefeld
Bielefeld
EOOLT'07 Berlin
Peter AronssonMathCore Engineering AB
Linköping
Peter FritzsonLinköping University
Linköping
2007-07-30 Robust Initialization of Differential Algebraic Equations
2B. Bachmann, P. Aronsson, P. Fritzson
Outline
Mathematical Formulation of Hybrid DAEsSymbolic Transformation StepsInitialization in Modelica (Conventional)Higher-Index DAEsSystem versus Component initializationExample (3-Phase System)
2007-07-30 Robust Initialization of Differential Algebraic Equations
3B. Bachmann, P. Aronsson, P. Fritzson
Mathematical Formalism
( )0 , ( ), ( ), ( ), ( ), ( ), ( ), ( ),
time( ) vector of differentiated state variables( ) vector of state variables( ) vector of algebraic variables
( )
e pre e ef t x t x t y t u t q t q t c t p
tx tx ty t
u t
=
vector of input variables( ), ( ) vectors of discrete variables
( ) vector of condition expressions vector of parameters and/or constants
e pre e
e
q t q t
c tp
General representation of hybrid DAEs:
2007-07-30 Robust Initialization of Differential Algebraic Equations
4B. Bachmann, P. Aronsson, P. Fritzson
Numerical Aspects for Simulation(Explicit Euler Method)
( ) 00( ) , ( ), ( ), , ( ) x t f t x t u t p x t x= =
Integration of explicit ordinary differential equations (ODEs):
Numerical approximation of the derivativeand/or right-hand-side:
( )1
1
( ) ( )( ) , ( ), ( ),n nn n n n
n n
x t x tx t f t x t u t pt t+
+
−≈ ≈−
Iteration scheme:
( ) ( )1 1( ) ( ) , ( ), ( ),n n n n n n nx t x t t t f t x t u t p+ +≈ + − ⋅
Calculating an approximation of x(tn+1) based on the values of x(tn)
Here:Explicit Euler integration method
Convergence?
2007-07-30 Robust Initialization of Differential Algebraic Equations
5B. Bachmann, P. Aronsson, P. Fritzson
Basic Transformation StepsMathematical View
( )0 , ( ), ( ), ( ), ( ),f t x t x t y t u t p=
Transformation to explicit state-space representation:
Implicit function theorem:Necessary condition for the existence of the transformation is that the following matrix is regular at the point of interest:
( )det , ( ), ( ), ( ), 0f t z t x t u t pz
⎛ ∂ ⎞ ≠⎜ ⎟∂⎝ ⎠
( ) ( )0 , ( ), ( ), ( ), , ( )
( )x t
f t z t x t u t p z ty t
⎛ ⎞= = ⎜ ⎟
⎝ ⎠
( )( )( ) , ( ), ( ),
( )x t
z t g t x t u t py t
⎛ ⎞= =⎜ ⎟⎝ ⎠
( )( )
( ) , ( ), ( ),
( ) , ( ), ( ),
x t h t x t u t p
y t k t x t u t p
=
=
2007-07-30 Robust Initialization of Differential Algebraic Equations
6B. Bachmann, P. Aronsson, P. Fritzson
Symbolic TransformationAlgorithmic Steps
Construct bipartite graph representation – Structural representation of the equation system
Solve the matching problem– Assign to each variable exact one equation– Same number of equations and unknowns
Construct a directed graph – Find sinks, sources and strong components– Sorting the equation system
( )0 , ( ), ( ), ( ), ( ),f t x t x t y t u t p=
( ) ( )0 , ( ), ( ), ( ), , ( )
( )x t
f t z t x t u t p z ty t
⎛ ⎞= = ⎜ ⎟
⎝ ⎠
( )( )( ) , ( ), ( ),
( )x t
z t g t x t u t py t
⎛ ⎞= =⎜ ⎟⎝ ⎠
( )( )
( ) , ( ), ( ),
( ) , ( ), ( ),
x t h t x t u t p
y t k t x t u t p
=
=
2007-07-30 Robust Initialization of Differential Algebraic Equations
7B. Bachmann, P. Aronsson, P. Fritzson
Initialization of Dynamic ModelsConventional
Initialization of “free” state variables– Transformed DAE after index-reduction– States can be chosen at start time
• same number of additional equationsand “free” states
Initialization of parameters– Determine parameter settings– Parameters can be calculated at start time
• same number of additional equationsand “free” parameters
Initialization mechanism in Modelica– attribute start– initial equation section
• attribute fixed for parameters
( )0 , ( ), ( ), ( ), ( ),f t x t x t y t u t p=
( ) ( )0 , ( ), ( ), ( ), , ( )
( )x t
f t z t x t u t p z ty t
⎛ ⎞= = ⎜ ⎟
⎝ ⎠
( )( )( ) , ( ), ( ),
( )x t
z t g t x t u t py t
⎛ ⎞= =⎜ ⎟⎝ ⎠
( )( )
( ) , ( ), ( ),
( ) , ( ), ( ),
x t h t x t u t p
y t k t x t u t p
=
=
2007-07-30 Robust Initialization of Differential Algebraic Equations
8B. Bachmann, P. Aronsson, P. Fritzson
Steady-state initialization?- States I1.i, I2.i, I3.i are not constant!- Here: Initial values set to 0 (standard settings, attribute start)- Transformation to rotating reference system necessary
Example: 3-Phase Electrical System
2007-07-30 Robust Initialization of Differential Algebraic Equations
9B. Bachmann, P. Aronsson, P. Fritzson
( )
( )
2 4sin sin sin3 3
2 2 4cos cos cos3 33
1 1 12 2 2
t t t
P t t t
π πω ω ω
π πω ω ω
⎛ ⎞⎛ ⎞ ⎛ ⎞+ +⎜ ⎟ ⎜ ⎟⎜ ⎟⎝ ⎠ ⎝ ⎠⎜ ⎟
⎜ ⎟⎜ ⎟⎛ ⎞ ⎛ ⎞= + +⎜ ⎟⎜ ⎟ ⎜ ⎟
⎝ ⎠ ⎝ ⎠⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠
_ 0 _i dq P i abc= ⋅
Example: 3-Phase Electrical System
Park-Transformation to rotating reference system:- Write states as vector i_abc[3] = {I1.i, I2.i, I3.i}
- Park-transformation to dq0-reference frame
2007-07-30 Robust Initialization of Differential Algebraic Equations
10B. Bachmann, P. Aronsson, P. Fritzson
Example: 3-Phase Electrical SystemInitialize States
model Test3PhaseSystemparameter Real shift=0.4;Real i_abc[3]={I1.i,I2.i,I3.i};Real i_dq0[3];…
initial equationder(i_dq0)={0,0,0};
equation…i_dq0 = P*i_abc;
end Test3PhaseSystem
Steady-state initialization:- Derivatives of i_dq0 are only
introduced during initialization- Differentiation of i_dq0 = P*i_abc
necessary- No higher-index problem
2007-07-30 Robust Initialization of Differential Algebraic Equations
11B. Bachmann, P. Aronsson, P. Fritzson
Example: 3-Phase Electrical SystemInitialize Parameters
model Test3PhaseSystemparameter Real shift(fixed=false,start=0.1);Real i_abc[3]={I1.i,I2.i,I3.i}, u_abc[3]={S1.v,S2.v,S3.v}; …
initial equationder(i_dq0)={0,0,0};power = -0.12865;
equation…u_dq0 = P*u_abc;i_dq0 = P*i_abc;power = u_dq0*i_dq0;
end Test3PhaseSystem
Parameter initialization:- Non-linear equation, no unique solution
power=u_dq0*i_dq0=-0.12865
- Attribute fixed (default true)- Attribute start (default 0)
2007-07-30 Robust Initialization of Differential Algebraic Equations
12B. Bachmann, P. Aronsson, P. Fritzson
model LR…Real i_abc[3]={I1.i,I2.i,I3.i}Real i_dq0[3]=P*i_abc;
initial equationder(i_dq0)={0,0,0};
equation…
end LR
Define new LR – Component:- States are LR1.I1.i, LR1.I2.i, LR1.I3.i- Connectors based on rotating reference system- Initial equations defined locally- no higher-index problem
Example: 3-Phase Electrical SystemHierarchical Definition
2007-07-30 Robust Initialization of Differential Algebraic Equations
13B. Bachmann, P. Aronsson, P. Fritzson
Higher-Index-DAEs
General representation of DAEs:
The minimal number of analytical differentiations of the equation system necessary to extract by algebraic manipulations an explicit ODE for all unknowns.
Differential index of a DAE:
( )0 , ( ), ( ), ( ), ( ),
time( ) vector of differentiated state variables( ) vector of state variables( ) vector of algebraic variables
( ) vector of input variables v
f t x t x t y t u t p
tx tx ty t
u tp
=
ector of parameters and/or constants
2007-07-30 Robust Initialization of Differential Algebraic Equations
14B. Bachmann, P. Aronsson, P. Fritzson
Higher-Index-DAEs
DAE with differential index 0:
( )0 , ( ), ( ), ( ),f t x t x t u t p= ( )( ) , ( ), ( ),x t g t x t u t p=
DAE with differential index 1:
( )0 , ( ), ( ), ( ), ( ),f t x t x t y t u t p=
( )( )
( ) , ( ), ( ),
( ) , ( ), ( ),
x t h t x t u t p
y t k t x t u t p
=
=
( )( )
( ) , ( ), ( ),
( ) , ( ), ( ),
x t h t x t u t p
dy t k t x t u t pdt
=
=
2007-07-30 Robust Initialization of Differential Algebraic Equations
15B. Bachmann, P. Aronsson, P. Fritzson
Higher Index ProblemsStructurally Singular Systems
Higher-index DAEs– Differential index of a DAE– Structural singularity of the adjacence matrix– Index reduction method using symbolic
differentiation of equations
Numerical issues– Consistent initialization– Drift phenomenon– Dummy derivative method
State selection mechanism in Modelica– Attribute StateSelect:
never, avoid, default, prefer, always
( )0 , ( ), ( ), ( ), ( ),f t x t x t y t u t p=
( ) ( )0 , ( ), ( ), ( ), , ( )
( )x t
f t z t x t u t p z ty t
⎛ ⎞= = ⎜ ⎟
⎝ ⎠
( )( )( ) , ( ), ( ),
( )x t
z t g t x t u t py t
⎛ ⎞= =⎜ ⎟⎝ ⎠
( )( )
( ) , ( ), ( ),
( ) , ( ), ( ),
x t h t x t u t p
y t k t x t u t p
=
=
2007-07-30 Robust Initialization of Differential Algebraic Equations
16B. Bachmann, P. Aronsson, P. Fritzson
Higher-Index-DAEs -- Numerical Problems
Consistent initial conditions– Relation between states are eliminated when differentiating– Initial conditions need to be determined using the algebraic
constrains– Automatic procedure possible using assign algorithm on the
constrained equations
Drift phenomenon– Algebraic constrained no longer fulfilled during simulation– Even worse when simulating stiff problems
=> Dummy-Derivative method
2007-07-30 Robust Initialization of Differential Algebraic Equations
17B. Bachmann, P. Aronsson, P. Fritzson
Principles of the Dummy-Derivative Method
Matching algorithm fails– System is structurally singular– Find minimal subset of equations
• more equations than unknown variables– Singularity is due to equations constraining states
Differentiate subset of equations– Static state selection during compile time
• choose one state and corresponding derivative as purely algebraic variableo so-called dummy-state and dummy derivative
• by differentiation introduced variables are algebraic• continue matching algorithm• check initial conditions
– Dynamic state selection during simulation time• store information on constrained states• make selection dynamically based on heuristic criteria • new state selection triggers an event (re-initialize states)
2007-07-30 Robust Initialization of Differential Algebraic Equations
18B. Bachmann, P. Aronsson, P. Fritzson
Initialization of Higher-Index Problems
Initialization (conventional)– Transformed DAE after index-reduction– Define initial equations on system level
• same number of additional equationsand “free” states
Initialization (advanced)– Transformed DAE after index-reduction– Define initial equations on component level
• same number of additional equationsand “free” states locally
• consistent overdetermined system
( )0 , ( ), ( ), ( ), ( ),f t x t x t y t u t p=
( ) ( )0 , ( ), ( ), ( ), , ( )
( )x t
f t z t x t u t p z ty t
⎛ ⎞= = ⎜ ⎟
⎝ ⎠
( )( )( ) , ( ), ( ),
( )x t
z t g t x t u t py t
⎛ ⎞= =⎜ ⎟⎝ ⎠
( )( )
( ) , ( ), ( ),
( ) , ( ), ( ),
x t h t x t u t p
y t k t x t u t p
=
=
2007-07-30 Robust Initialization of Differential Algebraic Equations
19B. Bachmann, P. Aronsson, P. Fritzson
Solving Overdetermined Systems
1 1
1
( ,..., ) 0
( ,..., ) 0
n
m n
f z z
f z z
=
=
Derivative-free methods implemented in OpenModelica- Simplex method of Nelder and Mead- Minimization method of Brent
Nonlinear system of equations- m, number of equations- n, number of variables- m ≥ n
( ) 21 1
1,..., ( ,..., ) min
m
n i ni
F z z f z z=
= →∑
Corresponding minimization problem- solution solves the nonlinear system of
equations
2007-07-30 Robust Initialization of Differential Algebraic Equations
20B. Bachmann, P. Aronsson, P. Fritzson
Higher Index problem:- Algebraic dependency between differentiated variables LR1.I1.i,
LR1.I2.i, LR1.I3.i and LR2.I1.i, LR2.I2.i, LR2.I3.i
- Only 3 states are left after index-reduction- Define initial equations globally (Cumbersome)
Example: 3-Phase Electrical SystemHigher-Index-Problem (Conventional)
model Test3PhaseSystem…initial equationder(LR1.i_dq0)={0,0,0};
equation…
end Test3PhaseSystem
2007-07-30 Robust Initialization of Differential Algebraic Equations
21B. Bachmann, P. Aronsson, P. Fritzson
Higher Index problem:- Algebraic dependency between differentiated variables LR1.I1.i,
LR1.I2.i, LR1.I3.i and LR2.I1.i, LR2.I2.i, LR2.I3.i
- Initial equations still defined locally- Overdetermined equation system during initial time!
Example: 3-Phase Electrical SystemHigher-Index-Problem (Advanced)
model LR…initial equationder(i_dq0)={0,0,0};
equation…
end LR
2007-07-30 Robust Initialization of Differential Algebraic Equations
22B. Bachmann, P. Aronsson, P. Fritzson
Conclusions and Future Work
Advanced Initialization of DAEs– System versus component initialization– Well-posed overdetermined systems
Prototype in OpenModelica– Implementation of concept
• derivative-free minimization algorithms– Thorough testing necessary– Improve efficiency– Use advanced numerical minimization algorithms
• Globally convergent methods• Calculation of Jacobian matrix of the equation system
top related