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
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
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.
Start of Presentation Maple soft Conference 2006 Heterogeneous Modeling Formalisms
Start of Presentation Maple soft Conference 2006 Heterogeneous Modeling Formalisms II
Start of Presentation Maple soft Conference 2006 A First Example
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
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 = U0U0 i0i0 uLuL v1v1 v2v2 iCiC u R1 i R1 i R2 u R2
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 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
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.
Start of Presentation Maple soft Conference 2006 The Tarjan Algorithm: An Example 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
Start of Presentation Maple soft Conference 2006 The Tarjan Algorithm: An Example II 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
Start of Presentation Maple soft Conference 2006 The Tarjan Algorithm: An Example III 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
Start of Presentation Maple soft Conference 2006 The Tarjan Algorithm: An Example IV 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: 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
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 = U0U0 i0i0 u R2 v2v2 v1v1 iCiC u R1 i R1 i R2 uLuL
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
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 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns
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 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns
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 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns The algorithm fails as there are no longer single black lines to either equations or unknowns.
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.
Start of Presentation Maple soft Conference 2006 Algebraic Loops: An Example IV Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns : 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
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 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns
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 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns
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 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns
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 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns
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 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns
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 = 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
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.
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 U0U Algebraic Loops Structure diagram
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.
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.
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 = 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.
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 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
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 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 u3u
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 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 u3u Constraint Equation All connections are blue
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.
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.
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.
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
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
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
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
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.
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 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 11 iLiL
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 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 11 iLiL
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 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 11 iLiL Choice 02
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 Equations U0U0 i0 i0 uLuL di L /dt u1 u1 i1i1 u2u2 i2 i2 u3 u3 i3i3 Unknowns 11 iLiL Choice
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.
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.)
Start of Presentation Maple soft Conference 2006 Mixed Symbolic and Numerical Processing