Presentation is loading. Please wait.

Presentation is loading. Please wait.

Start of Presentation Maple soft Conference 2006 The Need for Formulae Manipulation in the Object-oriented Modeling of Physical Systems François E. Cellier,

Similar presentations


Presentation on theme: "Start of Presentation Maple soft Conference 2006 The Need for Formulae Manipulation in the Object-oriented Modeling of Physical Systems François E. Cellier,"— Presentation transcript:

1 Start of Presentation Maple soft Conference 2006 The Need for Formulae Manipulation in the Object-oriented Modeling of Physical Systems François E. Cellier, Ph.D. Institute of Computational Science ETH Zurich Switzerland July 26, 2006

2 Start of Presentation Maple soft Conference 2006 Today’s modeling needs extend to physical systems that are described by many thousands of mathematical equations. Such models are being created and maintained by employing the principles of object-oriented graphical modeling. Each object contains a number of different layers (aspects, realities) that are to be described shortly. Symbolic formula manipulation plays a central role in converting these object-oriented descriptions to a form that can be simulated effectively and efficiently. Object-oriented Modeling

3 Start of Presentation Maple soft Conference 2006 Object Descriptions Objects may contain an iconic representation that is being used to embed the object at the next higher hierarchical level. Objects may contain a geometric representation that is being used for animation. Objects may contain a topological description that shows its decomposition structure. Objects may contain a mathematical description that shows the equations that the model is formed of. Objects may contain a parametric description that shows parameters and their default values. Objects may contain a documentation layer that describes the object verbally.

4 Start of Presentation Maple soft Conference 2006 Heterogeneous Modeling Formalisms

5 Start of Presentation Maple soft Conference 2006 Heterogeneous Modeling Formalisms II

6 Start of Presentation Maple soft Conference 2006 A First Example

7 Start of Presentation Maple soft Conference 2006 The circuit contains 5 components and 3 nodes.  We require 13 equations in 13 unknowns. Component equations: U 0 = f(t)U 0 = v 1 – v 0 u R1 = R 1 · i R1 u R1 = v 1 – v 2 u R2 = R 2 · i R2 u R2 = v 2 – v 0 i C = C 1 · du C /dt u C = v 2 – v 0 u L = L 1 · di L /dt u L = v 1 – v 0 v 0 = 0 Node equations: i 0 = i R1 + i L i R1 = i R2 + i C A First Example II

8 Start of Presentation Maple soft Conference 2006 The Structure Incidence Matrix 1: U 0 = f(t) 2: i 0 = i L + i R1 3: u L = U 0 4: di L /dt = u L / L 1 5: v 1 = U 0 6: u R1 = v 1 – v 2 7: i R1 = u R1 / R 1 8: v 2 = u C 9: i C = i R1 – i R2 10: du C /dt = i C / C 1 11: u R2 = u C 12: i R2 = u R2 / R 2 di L dt du C dt S = 01 02 03 04 05 06 07 08 09 10 11 12 101010000000101010000000 010000000000010000000000 001100000000001100000000 000100000000000100000000 000011000000000011000000 000001100000000001100000 010000101000010000101000 000001010000000001010000 000000001100000000001100 000000000100000000000100 000000000011000000000011 000000001001000000001001 U0U0 i0i0 uLuL v1v1 v2v2 iCiC u R1 i R1 i R2 u R2 

9 Start of Presentation Maple soft Conference 2006 The Structure Digraph 1: U 0 = f(t) 2: i 0 = i L + i R1 3: u L = U 0 4: di L /dt = u L / L 1 5: v 1 = U 0 6: u R1 = v 1 – v 2 7: i R1 = u R1 / R 1 8: v 2 = u C 9: i C = i R1 – i R2 10: du C /dt = i C / C 1 11: u R2 = u C 12: i R2 = u R2 / R 2  01 02 03 04 05 06 07 08 09 10 11 12 Equations U0U0 i0 i0 uLuL di L /dt v1 v1 u R1 i R1 v2 v2 iC iC du C /dt u R2 i R2 Unknowns

10 Start of Presentation Maple soft Conference 2006 The Tarjan Algorithm The Tarjan Algorithm is based on the structure digraph. It is a graph coloring algorithm.  equations with only a single black line leading to them, color that line in red and color all black lines that emanate from the indicated unknown in blue. Renumber the equations anew starting with 1.  unknowns with only a single black line leading to them, color that line in red and color all black lines that emanate from the indicated equation in blue. Renumber the equations anew starting with n, where n denotes the number of equations.

11 Start of Presentation Maple soft Conference 2006 The Tarjan Algorithm: An Example  01 02 03 04 05 06 07 08 09 10 11 12 Equations U0U0 i0 i0 uLuL di L /dt v1 v1 u R1 i R1 v2 v2 iC iC du C /dt u R2 i R2 Unknowns 1: U 0 = f(t) 2: i 0 = i L + i R1 3: u L = U 0 4: di L /dt = u L / L 1 5: v 1 = U 0 6: u R1 = v 1 – v 2 7: i R1 = u R1 / R 1 8: v 2 = u C 9: i C = i R1 – i R2 10: du C /dt = i C / C 1 11: u R2 = u C 12: i R2 = u R2 / R 2 01 U 0 U 0 U 0 02 v 2 v 2 03 u R2 u 12 du /dt C i C 11 di /dt L u L 10 i 0 i R1

12 Start of Presentation Maple soft Conference 2006 The Tarjan Algorithm: An Example II  01 02 03 04 05 06 07 08 09 10 11 12 Equations U0U0 i0 i0 uLuL di L /dt v1 v1 u R1 i R1 v2 v2 iC iC du C /dt u R2 i R2 Unknowns 1: U 0 = f(t) 2: i 0 = i L + i R1 3: u L = U 0 4: di L /dt = u L / L 1 5: v 1 = U 0 6: u R1 = v 1 – v 2 7: i R1 = u R1 / R 1 8: v 2 = u C 9: i C = i R1 – i R2 10: du C /dt = i C / C 1 11: u R2 = u C 12: i R2 = u R2 / R 2 01 U 0 U 0 U 0 02 v 2 v 2 03 u R2 u 12 du /dt C i C 11 di /dt L u L 10 i 0 i R1 04 u L 05 v 1 v 1 06 i R2 i 09 i C i R1

13 Start of Presentation Maple soft Conference 2006 The Tarjan Algorithm: An Example III  01 02 03 04 05 06 07 08 09 10 11 12 Equations U0U0 i0 i0 uLuL di L /dt v1 v1 u R1 i R1 v2 v2 iC iC du C /dt u R2 i R2 Unknowns 1: U 0 = f(t) 2: i 0 = i L + i R1 3: u L = U 0 4: di L /dt = u L / L 1 5: v 1 = U 0 6: u R1 = v 1 – v 2 7: i R1 = u R1 / R 1 8: v 2 = u C 9: i C = i R1 – i R2 10: du C /dt = i C / C 1 11: u R2 = u C 12: i R2 = u R2 / R 2 01 U 0 U 0 U 0 02 v 2 v 2 03 u R2 u 12 du /dt C i C 11 di /dt L u L 10 i 0 i R1 04 u L 05 v 1 v 1 06 i R2 i 09 i C i R1 07 u R1 u 08 i R1

14 Start of Presentation Maple soft Conference 2006 The Tarjan Algorithm: An Example IV 01 02 03 04 05 06 07 08 09 10 11 12 Equations U0U0 i0 i0 uLuL di L /dt v1 v1 u R1 i R1 v2 v2 iC iC du C /dt u R2 i R2 Unknowns 01 02 03 12 11 10 04 05 06 09 07 08  1: U 0 = f(t) 2: v 2 = u C 3: u R2 = u C 4: u L = U 0 5: v 1 = U 0 6: i R2 = u R2 / R 2 7: u R1 = v 1 – v 2 8: i R1 = u R1 / R 1 9: i C = i R1 – i R2 10: i 0 = i L + i R1 11: di L /dt = u L / L 1 12: du C /dt = i C / C 1

15 Start of Presentation Maple soft Conference 2006  The structure incidence matrix of the completely sorted equation system is brought into lower triangular form. The Structure Incidence Matrix II 1: U 0 = f(t) 2: v 2 = u C 3: u R2 = u C 4: u L = U 0 5: v 1 = U 0 6: i R2 = u R2 / R 2 7: u R1 = v 1 – v 2 8: i R1 = u R1 / R 1 9: i C = i R1 – i R2 10: i 0 = i L + i R1 11: di L /dt = u L / L 1 12: du C /dt = i C / C 1  di L dt du C dt S = 01 02 03 04 05 06 07 08 09 10 11 12 100110000000100110000000 010000100000010000100000 001001000000001001000000 000100000010000100000010 000010100000000010100000 000001001000000001001000 000000110000000000110000 000000011100000000011100 000000001001000000001001 000000000100000000000100 000000000010000000000010 000000000001000000000001 U0U0 i0i0 u R2 v2v2 v1v1 iCiC u R1 i R1 i R2 uLuL

16 Start of Presentation Maple soft Conference 2006 Algebraic Loops Component equations: U 0 = f(t)u 3 = R 3 · i 3 u 1 = R 1 · i 1 u L = L· di L /dt u 2 = R 2 · i 2 Node equations: i 0 = i 1 + i L i 1 = i 2 + i 3 Mesh equations: U 0 = u 1 + u 3 u L = u 1 + u 2 u 3 = u 2 The circuit contains 5 components  We require 10 equations in 10 unknowns

17 Start of Presentation Maple soft Conference 2006 Algebraic Loops: An Example 1: U 0 = f(t) 2: u 1 = R 1 · i 1 3: u 2 = R 2 · i 2 4: u 3 = R 3 · i 3 5: u L = L· di L /dt 6: i 0 = i 1 + i L 7: i 1 = i 2 + i 3 8: U 0 = u 1 + u 3 9: u 3 = u 2 10: u L = u 1 + u 2  01 02 03 04 05 06 07 08 09 10 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns

18 Start of Presentation Maple soft Conference 2006 Algebraic Loops: An Example II 1: U 0 = f(t) 2: u 1 = R 1 · i 1 3: u 2 = R 2 · i 2 4: u 3 = R 3 · i 3 5: u L = L· di L /dt 6: i 0 = i 1 + i L 7: i 1 = i 2 + i 3 8: U 0 = u 1 + u 3 9: u 3 = u 2 10: u L = u 1 + u 2  01 02 03 04 05 06 07 08 09 10 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 01 10 09

19 Start of Presentation Maple soft Conference 2006 Algebraic Loops: An Example III 1: U 0 = f(t) 2: u 1 = R 1 · i 1 3: u 2 = R 2 · i 2 4: u 3 = R 3 · i 3 5: u L = L· di L /dt 6: i 0 = i 1 + i L 7: i 1 = i 2 + i 3 8: U 0 = u 1 + u 3 9: u 3 = u 2 10: u L = u 1 + u 2  01 02 03 04 05 06 07 08 09 10 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 01 10 09 08  The algorithm fails as there are no longer single black lines to either equations or unknowns.

20 Start of Presentation Maple soft Conference 2006 The Tearing of Algebraic Loops The following heuristic may be used to find suitable tearing variables: Determine those equations in the digraph that contain the largest number of black lines. For each of these equations, find the unknown with the largest number of black lines emanating from it. Determine for each of these variables, how many additional equations can be causalized, when this variable is assumed known. Choose that variable as the next tearing variable that causalizes the largest number of additional equations.

21 Start of Presentation Maple soft Conference 2006 Algebraic Loops: An Example IV  10 09 08 01 02 03 04 05 06 07 08 09 10 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 01 02 1: U 0 = f(t) 2: u 1 = R 1 · i 1 3: u 2 = R 2 · i 2 4: u 3 = R 3 · i 3 5: u L = L· di L /dt 6: i 0 = i 1 + i L 7: i 1 = i 2 + i 3 8: U 0 = u 1 + u 3 9: u 3 = u 2 10: u L = u 1 + u 2 Choice

22 Start of Presentation Maple soft Conference 2006 Algebraic Loops: An Example V 1: U 0 = f(t) 2: u 1 = R 1 · i 1 3: u 2 = R 2 · i 2 4: u 3 = R 3 · i 3 5: u L = L· di L /dt 6: i 0 = i 1 + i L 7: i 1 = i 2 + i 3 8: U 0 = u 1 + u 3 9: u 3 = u 2 10: u L = u 1 + u 2 Choice  10 09 08 01 02 03 04 05 06 07 08 09 10 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 01 02 03

23 Start of Presentation Maple soft Conference 2006 Algebraic Loops: An Example VI 1: U 0 = f(t) 2: u 1 = R 1 · i 1 3: u 2 = R 2 · i 2 4: u 3 = R 3 · i 3 5: u L = L· di L /dt 6: i 0 = i 1 + i L 7: i 1 = i 2 + i 3 8: U 0 = u 1 + u 3 9: u 3 = u 2 10: u L = u 1 + u 2 Choice  10 09 08 01 02 03 04 05 06 07 08 09 10 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 01 02 03 07 06

24 Start of Presentation Maple soft Conference 2006 Algebraic Loops: An Example VII 1: U 0 = f(t) 2: u 1 = R 1 · i 1 3: u 2 = R 2 · i 2 4: u 3 = R 3 · i 3 5: u L = L· di L /dt 6: i 0 = i 1 + i L 7: i 1 = i 2 + i 3 8: U 0 = u 1 + u 3 9: u 3 = u 2 10: u L = u 1 + u 2 Choice  10 09 08 01 02 03 04 05 06 07 08 09 10 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 01 02 03 07 06 04

25 Start of Presentation Maple soft Conference 2006 Algebraic Loops: An Example VIII 1: U 0 = f(t) 2: u 1 = R 1 · i 1 3: u 2 = R 2 · i 2 4: u 3 = R 3 · i 3 5: u L = L· di L /dt 6: i 0 = i 1 + i L 7: i 1 = i 2 + i 3 8: U 0 = u 1 + u 3 9: u 3 = u 2 10: u L = u 1 + u 2 Choice  10 09 08 01 02 03 04 05 06 07 08 09 10 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 01 02 03 07 06 04 05

26 Start of Presentation Maple soft Conference 2006 Algebraic Loops: An Example IX 1: U 0 = f(t) 2: i 1 = i 2 + i 3 3: u 1 = R 1 · i 1 4: u 3 = U 0 - u 1 5: u 2 = u 3 6: i 2 = u 2 / R 2 7: i 3 = u 3 / R 3 8: u L = u 1 + u 2 9: i 0 = i 1 + i L 10: di L /dt = u L / L Choice  10 09 08 01 02 03 04 05 06 07 08 09 10 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 01 02 03 07 06 04 05

27 Start of Presentation Maple soft Conference 2006  The structure incidence matrix now assumes a block lower triangular (BLT) form. The Structure Incidence Matrix III  di L dt S = 01 02 03 04 05 06 07 08 09 10 10010000001001000000 01100000100110000010 00110001000011000100 00011010000001101000 00001101000000110100 01000100000100010000 01000010000100001000 00000001010000000101 00000000100000000010 00000000010000000001 U0U0 i0i0 i2i2 u3u3 i2i2 u1u1 i1i1 i3i3 uLuL 1: U 0 = f(t) 2: i 1 = i 2 + i 3 3: u 1 = R 1 · i 1 4: u 3 = U 0 - u 1 5: u 2 = u 3 6: i 2 = u 2 / R 2 7: i 3 = u 3 / R 3 8: u L = u 1 + u 2 9: i 0 = i 1 + i L 10: di L /dt = u L / L Choice u2u2

28 Start of Presentation Maple soft Conference 2006 The Solving of Algebraic Loops I The Tarjan algorithm identifies and isolates algebraic loops. It transforms the structure incidence matrix to BLT form, whereby the diagonal blocks are made as small as possible. The selection of the tearing variables is not done in a truly optimal fashion. This is not meaningful, because the optimal selection of tearing variables has been shown to be an np-complete problem. Instead, a set of heuristics is being used, which usually comes up with a small number of tearing variables, although the number may not be truly minimal. The Tarjan algorithm does not concern itself with how the resulting algebraic loops are being solved.

29 Start of Presentation Maple soft Conference 2006 The Solving of Algebraic Loops II 1. u 1 = R 1 · i 1 2. u 2 = R 2 · i 2 3. u 3 = R 3 · i 3 4. i 1 = i 2 + i 3 5. U 0 = u 1 + u 3 6. u 3 = u 2 i2i2 i1i1 u1u1 u3u3 i3i3 u2u2 U0U0 4. 1. 2. 3. 5. 6. Algebraic Loops Structure diagram

30 Start of Presentation Maple soft Conference 2006 Solution of Algebraic Loops III 1. u 1 = R 1 · i 1 2. u 2 = R 2 · i 2 3. u 3 = R 3 · i 3 4. i 1 = i 2 + i 3 5. U 0 = u 1 + u 3 6. u 3 = u 2 1. u 1 = R 1 · i 1 2. i 2 = u 2 / R 2 3. i 3 = u 3 / R 3 4. i 1 = i 2 + i 3 5. u 3 = U 0 - u 1 6. u 2 = u 3  i 1 = i 2 + i 3 = u 2 / R 2 + u 3 / R 3 = u 3 / R 2 + u 3 / R 3 = ((R 2 + R 3 ) / (R 2 · R 3 )) · u 3 = ((R 2 + R 3 ) / (R 2 · R 3 )) · (U 0 - u 1 ) = ((R 2 + R 3 ) / (R 2 · R 3 )) · (U 0 - R 1 · i 1 )  i 1 = R 2 + R 3 R 1 R 2 + R 1 R 3 + R 2 R 3 · U 0 Equation 4. is replaced by the new equation.

31 Start of Presentation Maple soft Conference 2006 The Solving of Algebraic Loops IV The algebraic loops can be solved either analytically or numerically. If the loop equations are non-linear, a Newton iteration on the tearing variables may be optimal. If the loop equations are linear and if the set is fairly large, Newton iteration may still be the method of choice. If the loop equations are linear and if the set is of modest size, the equations can either be solved by matrix techniques or by means of explicit formulae manipulation.

32 Start of Presentation Maple soft Conference 2006 Structural Singularities: An Example I I 1 I 2 I 3 i C i L1 i L2 i R v 1 v 2 v 3 v 0 We compose a model using the currents, the Voltages and the potentials. Consequently, the mesh equations are being ignored. We have 7 circuit components plus the ground, therefore 2  7 + 1 = 15 equations. In addition, there are 4 nodes giving rise to another 3 equations. Therefore, we expect 18 equations in 18 unknowns. For passive components, it is customary to normalize the Voltages in the same direction as the currents. For active components (sources), the reverse is true.

33 Start of Presentation Maple soft Conference 2006 Structural Singularities: An Example II 1: I 1 = f 1 (t) 2: I 2 = f 2 (t) 3: I 3 = f 3 (t) 4: u R = R · i R 5: u L1 = L 1 · di L1 /dt 6: u L2 = L 2 · di L2 /dt 7: i C = C · du C /dt 8: v 0 = 0 9: u 1 = v 0 – v 1 10: u 2 = v 3 – v 2 11: u 3 = v 0 – v 1 12: u R = v 3 – v 0 13: u L1 = v 2 – v 0 14: u L2 = v 1 – v 3 15: u C = v 1 – v 2 16: i C = i L1 + I 2 17: i R = i L2 + I 2 18: I 1 + i C + i L2 + I 3 = 0  01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 I1I1 I2I2 I3I3 uRuR iRiR u L1 di L1 /dt u L2 di L2 /dt iCiC du C /dt v0v0 v1v1 v2v2 v3v3 u1u1 u2u2 u3u3

34 Start of Presentation Maple soft Conference 2006 Structural Singularities: An Example III 1: I 1 = f 1 (t) 2: I 2 = f 2 (t) 3: I 3 = f 3 (t) 4: u R = R · i R 5: u L1 = L 1 · di L1 /dt 6: u L2 = L 2 · di L2 /dt 7: i C = C · du C /dt 8: v 0 = 0 9: u 1 = v 0 – v 1 10: u 2 = v 3 – v 2 11: u 3 = v 0 – v 1 12: u R = v 3 – v 0 13: u L1 = v 2 – v 0 14: u L2 = v 1 – v 3 15: u C = v 1 – v 2 16: i C = i L1 + I 2 17: i R = i L2 + I 2 18: I 1 + i C + i L2 + I 3 = 0  01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 I1I1 I2I2 I3I3 uRuR iRiR u L1 di L1 /dt u L2 di L2 /dt iCiC du C /dt v0v0 v1v1 v2v2 v3v3 u1u1 u2u2 u3u3 01 02 03 04 18 17 16 15 14 13

35 Start of Presentation Maple soft Conference 2006 Structural Singularities: An Example IV 1: I 1 = f 1 (t) 2: I 2 = f 2 (t) 3: I 3 = f 3 (t) 4: u R = R · i R 5: u L1 = L 1 · di L1 /dt 6: u L2 = L 2 · di L2 /dt 7: i C = C · du C /dt 8: v 0 = 0 9: u 1 = v 0 – v 1 10: u 2 = v 3 – v 2 11: u 3 = v 0 – v 1 12: u R = v 3 – v 0 13: u L1 = v 2 – v 0 14: u L2 = v 1 – v 3 15: u C = v 1 – v 2 16: i C = i L1 + I 2 17: i R = i L2 + I 2 18: I 1 + i C + i L2 + I 3 = 0  01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 I1I1 I2I2 I3I3 uRuR iRiR u L1 di L1 /dt u L2 di L2 /dt iCiC du C /dt v0v0 v1v1 v2v2 v3v3 u1u1 u2u2 u3u3 01 02 03 04 18 17 16 15 14 13 05 Constraint Equation All connections are blue

36 Start of Presentation Maple soft Conference 2006 The Algorithm by Pantelides As soon as a constraint equation has been found, this equation must be differentiated. In the algorithm of Pantelides, the differentiated constraint equation is added to the set of equations. Consequently, the set of equations has now one equation too many. In order to re-equalize the number of equations and unknowns, one of the integrators that is associated with the constraint equation is being eliminated.

37 Start of Presentation Maple soft Conference 2006 The Algorithm by Pantelides II dx dt x  unknown known, since this is a state variable dx dt x  unknown  dx x unknown  An additional unknown was created by the elimination of the integrator. x and dx are now algebraic variables, for which there must be found equations.

38 Start of Presentation Maple soft Conference 2006 The Algorithm by Pantelides III When differentiating constraint equations, it can happen that additional new variables are being created, e.g. v  dv, where v is an algebraic variable. Since v was already blue (otherwise, this would not have been a constraint equation), there already exists another equation to compute v. This equation must also be differentiated. The differentiation of additional equations continues until no additional variables are being created.

39 Start of Presentation Maple soft Conference 2006 The Algorithm by Pantelides : An Example 1: I 1 = f 1 (t) 2: I 2 = f 2 (t) 3: I 3 = f 3 (t) 4: u R = R · i R 5: u L1 = L 1 · di L1 /dt 6: u L2 = L 2 · di L2 /dt 7: i C = C · du C /dt 8: v 0 = 0 9: u 1 = v 0 – v 1 10: u 2 = v 3 – v 2 11: u 3 = v 0 – v 1 12: u R = v 3 – v 0 13: u L1 = v 2 – v 0 14: u L2 = v 1 – v 3 15: u C = v 1 – v 2 16: i C = i L1 + I 2 17: i R = i L2 + I 2 18: I 1 + i C + i L2 + I 3 = 0 dI 1 + di C + di L2 + dI 3 = 0 eliminated integrator newly introduced variables

40 Start of Presentation Maple soft Conference 2006 The Algorithm by Pantelides : An Example II 1: I 1 = f 1 (t) 2: I 2 = f 2 (t) 3: I 3 = f 3 (t) 4: u R = R · i R 5: u L1 = L 1 · di L1 /dt 6: u L2 = L 2 · di L2 /dt 7: i C = C · du C /dt 8: v 0 = 0 9: u 1 = v 0 – v 1 10: u 2 = v 3 – v 2 11: u 3 = v 0 – v 1 12: u R = v 3 – v 0 13: u L1 = v 2 – v 0 14: u L2 = v 1 – v 3 15: u C = v 1 – v 2 16: i C = i L1 + I 2 17: i R = i L2 + I 2 18: I 1 + i C + i L2 + I 3 = 0 19: dI 1 + di C + di L2 + dI 3 = 0 9: u 1 = v 0 – v 1 10: u 2 = v 3 – v 2 11: u 3 = v 0 – v 1 12: u R = v 3 – v 0 13: u L1 = v 2 – v 0 14: u L2 = v 1 – v 3 15: u C = v 1 – v 2  1: I 1 = f 1 (t) 2: I 2 = f 2 (t) 3: I 3 = f 3 (t) 4: u R = R · i R 5: u L1 = L 1 · di L1 /dt 6: u L2 = L 2 · di L2 7: i C = C · du C /dt 8: v 0 = 0 16: i C = i L1 + I 2 17: i R = i L2 + I 2 18: I 1 + i C + i L2 + I 3 = 0 19: dI 1 + di C + di L2 + dI 3 = 0

41 Start of Presentation Maple soft Conference 2006 The Algorithm by Pantelides : An Example III 9: u 1 = v 0 – v 1 10: u 2 = v 3 – v 2 11: u 3 = v 0 – v 1 12: u R = v 3 – v 0 13: u L1 = v 2 – v 0 14: u L2 = v 1 – v 3 15: u C = v 1 – v 2 20: dI 1 = df 1 (t)/dt 21: dI 3 = df 3 (t)/dt 22: di C = di L1 /dt + dI 2 16: i C = i L1 + I 2 17: i R = i L2 + I 2 18: I 1 + i C + i L2 + I 3 = 0 19: dI 1 + di C + di L2 + dI 3 = 0 1: I 1 = f 1 (t) 2: I 2 = f 2 (t) 3: I 3 = f 3 (t) 4: u R = R · i R 5: u L1 = L 1 · di L1 /dt 6: u L2 = L 2 · di L2 7: i C = C · du C /dt 8: v 0 = 0 u L1 = L 1 · di L1 /dt newly introduced variable 23: dI 2 = df 2 (t)/dt

42 Start of Presentation Maple soft Conference 2006 The Algorithm by Pantelides : An Example IV 9: u 1 = v 0 – v 1 10: u 2 = v 3 – v 2 11: u 3 = v 0 – v 1 12: u R = v 3 – v 0 13: u L1 = v 2 – v 0 14: u L2 = v 1 – v 3 15: u C = v 1 – v 2 16: i C = i L1 + I 2 17: i R = i L2 + I 2 18: I 1 + i C + i L2 + I 3 = 0 19: dI 1 + di C + di L2 + dI 3 = 0 1: I 1 = f 1 (t) 2: I 2 = f 2 (t) 3: I 3 = f 3 (t) 4: u R = R · i R 5: u L1 = L 1 · di L1 /dt 6: u L2 = L 2 · di L2 7: i C = C · du C /dt 8: v 0 = 0 20: dI 1 = df 1 (t)/dt 21: dI 3 = df 3 (t)/dt 22: di C = di L1 /dt + dI 2 23: dI 2 = df 2 (t)/dt

43 Start of Presentation Maple soft Conference 2006 Inline Integration Higher-order models are almost invariably stiff. Stiff models require an implicit ODE solver for their simulation. Implicit ODE solvers call for an additional iteration during each integration step. Inline integration may be able to reduce the number of iteration variables by merging the solver equations with the model equations.

44 Start of Presentation Maple soft Conference 2006 Inline Integration: An Example 1: U 0 = f(t) 2: u 1 = R 1 · i 1 3: u 2 = R 2 · i 2 4: u 3 = R 3 · i 3 5: u L = L· di L /dt 6: i 0 = i 1 + i L 7: i 1 = i 2 + i 3 8: U 0 = u 1 + u 3 9: u 3 = u 2 10: u L = u 1 + u 2 11: i L = pre(i L ) + h · diL/dt  01 02 03 04 05 06 07 08 09 10 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 11 iLiL

45 Start of Presentation Maple soft Conference 2006 Inline Integration: An Example II 1: U 0 = f(t) 2: u 1 = R 1 · i 1 3: u 2 = R 2 · i 2 4: u 3 = R 3 · i 3 5: u L = L· di L /dt 6: i 0 = i 1 + i L 7: i 1 = i 2 + i 3 8: U 0 = u 1 + u 3 9: u 3 = u 2 10: u L = u 1 + u 2 11: i L = pre(i L ) + h · diL/dt  01 02 03 04 05 06 07 08 09 10 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 11 iLiL 01 11 10 09 08

46 Start of Presentation Maple soft Conference 2006 Inline Integration: An Example III 1: U 0 = f(t) 2: u 1 = R 1 · i 1 3: u 2 = R 2 · i 2 4: u 3 = R 3 · i 3 5: u L = L· di L /dt 6: i 0 = i 1 + i L 7: i 1 = i 2 + i 3 8: U 0 = u 1 + u 3 9: u 3 = u 2 10: u L = u 1 + u 2 11: i L = pre(i L ) + h · diL/dt  01 02 03 04 05 06 07 08 09 10 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 11 iLiL 01 11 10 09 08 Choice 02

47 Start of Presentation Maple soft Conference 2006 Inline Integration: An Example IV 1: U 0 = f(t) 2: u 1 = R 1 · i 1 3: u 2 = R 2 · i 2 4: u 3 = R 3 · i 3 5: u L = L· di L /dt 6: i 0 = i 1 + i L 7: i 1 = i 2 + i 3 8: U 0 = u 1 + u 3 9: u 3 = u 2 10: u L = u 1 + u 2 11: i L = pre(i L ) + h · diL/dt  01 02 03 04 05 06 07 08 09 10 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 11 iLiL 01 11 10 09 08 Choice 02 03 07 06 04 05

48 Start of Presentation Maple soft Conference 2006 Inline Integration II DASSL would have required to use all state variables (1) plus all tearing variables (1) as iteration variables. With inline integration, we got away with a single iteration variable in this example. Determining a good (small) set of tearing variables is thus essential, as it ultimately determines the efficiency of the simulation. Dymola offers a highly sophisticated selection of heuristics to determine small sets of tearing variables. These heuristics have not been published, as the company views them as their technological edge.

49 Start of Presentation Maple soft Conference 2006 Discontinuity Handling Discontinuity handling requires special considerations during the (symbolic) translation. (Switching equations change their computational causality as a function of the switch position.) Discontinuity handling also requires special considerations during the (numerical) simulation. (Extrapolation polynomials don’t exhibit discontinuities.)

50 Start of Presentation Maple soft Conference 2006 Mixed Symbolic and Numerical Processing


Download ppt "Start of Presentation Maple soft Conference 2006 The Need for Formulae Manipulation in the Object-oriented Modeling of Physical Systems François E. Cellier,"

Similar presentations


Ads by Google