4th Homework Solution In this homework problem, we wish to exercise the tearing and relaxation methods by means of a slightly larger problem than that.

Slides:



Advertisements
Similar presentations
4.1 Introduction to Matrices
Advertisements

Lecture 19: Parallel Algorithms
Start Presentation October 11, rd Homework Solution In this homework problem, we wish to exercise the application of the algorithms by Pantelides.
§ 3.4 Matrix Solutions to Linear Systems.
Start Presentation September 27, 2012 The Structural Singularity Removal Algorithm by Pantelides This lecture deals with a procedure that can be used to.
Lecture 9: Introduction to Matrix Inversion Gaussian Elimination Sections 2.4, 2.5, 2.6 Sections 2.2.3, 2.3.
Start Presentation October 4, rd Homework Problem In this homework problem, we wish to exercise the application of the algorithms by Pantelides.
Matrices & Systems of Linear Equations
1.2 Row Reduction and Echelon Forms
Linear Equations in Linear Algebra
Operation Research Chapter 3 Simplex Method.
Solving Systems of Linear Equations Part Pivot a Matrix 2. Gaussian Elimination Method 3. Infinitely Many Solutions 4. Inconsistent System 5. Geometric.
Start of Presentation Mathematical Modeling of Physical Systems © Prof. Dr. François E. Cellier September 20, st Homework Problem We wish to analyze.
Start of Presentation Mathematical Modeling of Physical Systems © Prof. Dr. François E. Cellier Electrical CircuitsI This lecture discusses the mathematical.
1 Lecture 25: Parallel Algorithms II Topics: matrix, graph, and sort algorithms Tuesday presentations:  Each group: 10 minutes  Describe the problem,
Start of Presentation Maple soft Conference 2006 The Need for Formulae Manipulation in the Object-oriented Modeling of Physical Systems François E. Cellier,
Part 3 Chapter 8 Linear Algebraic Equations and Matrices PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright © The.
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
Matrices Write and Augmented Matrix of a system of Linear Equations Write the system from the augmented matrix Solve Systems of Linear Equations using.
CHAPTER 2 MATRIX. CHAPTER OUTLINE 2.1 Introduction 2.2 Types of Matrices 2.3 Determinants 2.4 The Inverse of a Square Matrix 2.5 Types of Solutions to.
Matrices Addition & Subtraction Scalar Multiplication & Multiplication Determinants Inverses Solving Systems – 2x2 & 3x3 Cramer’s Rule.
Unit 3: Matrices.
Start of Presentation September 27, st Homework Problem We wish to analyze the following electrical circuit.
Lecture 7 - Systems of Equations CVEN 302 June 17, 2002.
H.Melikian/12101 Gauss-Jordan Elimination Dr.Hayk Melikyan Departhmen of Mathematics and CS Any linear system must have exactly one solution,
Start Presentation October 4, 2012 Efficient Solution of Equation Systems This lecture deals with the efficient mixed symbolic/numeric solution of algebraically.
Slide Copyright © 2009 Pearson Education, Inc. 7.4 Solving Systems of Equations by Using Matrices.
Unit 3: Matrices. Matrix: A rectangular arrangement of data into rows and columns, identified by capital letters. Matrix Dimensions: Number of rows, m,
Mathematics Medicine What is meant by a matrix A matrix is a set of numbers arranged in the form of a rectangle and enclosed in curved brackets.
Matrices. Matrix - a rectangular array of variables or constants in horizontal rows and vertical columns enclosed in brackets. Element - each value in.
Chapter 7: Systems of Equations and Inequalities; Matrices
Part 3 Chapter 9 Gauss Elimination
Chapter 4 Systems of Linear Equations; Matrices
Linear Algebraic Equations and Matrices
Chapter 4 Systems of Linear Equations; Matrices
Discussion D2.3 Chapter 2 Section 2-7
CHAPTER 2: DC Circuit Analysis and AC Circuit Analysis
Introduction to Matrices
Linear Algebraic Equations and Matrices
L9Matrix and linear equation
Linear Algebra Lecture 4.
Matrix Operations SpringSemester 2017.
PROGRAMME 4 DETERMINANTS.
Lecture 22: Parallel Algorithms
Systems of Linear Equations
1 Step Equation Practice + - x ÷
Warm-up a. Solve for k: 13 −5
7.3 Matrices.
MATRICES MATRIX OPERATIONS.
Ch. 3 Network Analysis- Part II
PROGRAMME 4 DETERMINANTS.
4th Homework Problem In this homework problem, we wish to exercise the tearing and relaxation methods by means of a slightly larger problem than that presented.
MATRICES MATRIX OPERATIONS.
Linear Equations in Linear Algebra
Unit 3: Matrices
Numerical Analysis Lecture14.
2.2 Introduction to Matrices
Solving Equations.
RECORD. RECORD COLLABORATE: Discuss: Is the statement below correct? Try a 2x2 example.
Numerical Analysis Lecture10.
Matrices.
Linear Algebra Lecture 18.
Warm Up 9/12/18 Solve x. 1) 3x – 7 = 5 + 2x
1.8 Matrices.
Matrix Operations Ms. Olifer.
Matrix Operations SpringSemester 2017.
1.8 Matrices.
Matrices are identified by their size.
3.5 Perform Basic Matrix Operations Algebra II.
Linear Equations in Linear Algebra
Presentation transcript:

4th Homework Solution In this homework problem, we wish to exercise the tearing and relaxation methods by means of a slightly larger problem than that presented in the lecture. We also wish to compare the computational efficiency of the simulation codes obtained by the two methods.

Tearing Algorithm Relaxation Algorithm Tearing vs. Relaxation

Tearing Algorithm I Given the electrical circuit of the figure on the left, determine a complete set of equations in currents and Voltages (by use of both node and mesh equations). Make the equation system causal, while trying to get by with two tearing variables (and residual equations). iq i1 i2 U0 i3 i4 ic

 U0 = f(t) uq = Rq · iq u1 = R1 · i1 u2 = R2 · i2 u3 = R3 · i3 ic = C · duc / dt iq = i1 + i2 i1 = i3 + i4 ic = i2 + i3 U0 = uq + u1 + u4 u2 = u1 + u3 u4 = u3 + uc U0 = f(t) uq = Rq · iq u1 = R1 · i1 u2 = R2 · i2 u3 = R3 · i3 u4 = R4 · i4 ic = C · duc / dt iq = i1 + i2 i1 = i3 + i4 ic = i2 + i3 U0 = uq + u1 + u4 u2 = u1 + u3 u4 = u3 + uc  selected tearing variable better choice (this choice would have allowed us to get by with a single tearing variable) – however, I prefer to demonstrate the algorithm with 2 tearing variables.

  U0 = f(t) uq = Rq · iq u1 = R1 · i1 u2 = R2 · i2 u3 = R3 · i3 ic = C · duc / dt iq = i1 + i2 i1 = i3 + i4 ic = i2 + i3 U0 = uq + u1 + u4 u2 = u1 + u3 u4 = u3 + uc  U0 = f(t) uq = Rq · iq u1 = R1 · i1 u2 = R2 · i2 u3 = R3 · i3 u4 = R4 · i4 ic = C · duc / dt iq = i1 + i2 i1 = i3 + i4 ic = i2 + i3 U0 = uq + u1 + u4 u2 = u1 + u3 u4 = u3 + uc U0 = f(t) uq = Rq · iq i1 = u1 / R1 i2 = u2 / R2 u3 = R3 · i3 i4 = u4 / R4 duc / dt = ic / C iq = i1 + i2 i3 = i1 - i4 ic = i2 + i3 u1 = U0 - uq - u4 u2 = u1 + u3 u4 = u3 + uc  2nd selected tearing variable

Tearing Algorithm II Solve symbolically for the tearing variables, and find replacement equations for the two residual equations, which permit to make the entire set of equations causal. Find an explicit DAE system by completely sorting the equations both horizontally and vertically.

i3 = i1 - i4 U0 = f(t) uq = Rq · iq i1 = u1 / R1 i2 = u2 / R2 u3 = R3 · i3 i4 = u4 / R4 duc / dt = ic / C iq = i1 + i2 i3 = i1 - i4 ic = i2 + i3 u1 = U0 - uq - u4 u2 = u1 + u3 u4 = u3 + uc = u1 / R1 - u4 / R4 = (U0 - uq - u4 ) / R1 – (u3 + uc ) / R4 = (U0 - Rq · iq - u3 - uc ) / R1 – (u3 + uc ) / R4 = (U0 - Rq · iq - R3 · i3 - uc ) / R1 – (R3 · i3 + uc ) / R4 (1 + R3 /R1 + R3 /R4 ) · i3 + (Rq /R1) · iq = U0 /R1 - uc/R1 - uc/R4 (R1 R3 + R1 R4 + R3R4 ) · i3 + R4Rq · iq = R4 · U0 - (R1+R4 ) · uc Expressions in the tearing variables Expressions in known variables

iq = i1 + i2 U0 = f(t) uq = Rq · iq i1 = u1 / R1 i2 = u2 / R2 u3 = R3 · i3 i4 = u4 / R4 duc / dt = ic / C iq = i1 + i2 i3 = i1 - i4 ic = i2 + i3 u1 = U0 - uq - u4 u2 = u1 + u3 u4 = u3 + uc = u1 / R1 + u2 / R2 = u1 / R1 + (u1 + u3 ) / R2 = (R1+R2 ) /(R1R2 ) · u1 + u3 /R2 = (R1+R2 ) /(R1R2 ) · (U0 - Rq · iq - R3 · i3 - uc ) + R3 /R2 · i3 R2R3 · i3 + (R1 R2 + R1 Rq + R2Rq ) · iq = (R1+R2 ) · (U0 - uc )

 (R1R3 + R1R4 + R3R4 ) R4Rq (R1R2 + R1Rq + R2Rq ) R2R3 · i3 iq = R4 · U0 - (R1+R4 ) · uc (R1+R2 ) · (U0 - uc ) a11 = R1·R3 + R1·R4 + R3·R4 a12 = R4·Rq a21 = R2·R3 a22 = R1·R2 + R1·Rq + R2·Rq b1 = R4 · U0 - (R1+R4 ) · uc b2 = (R1+R2 ) · (U0 - uc ) d = a11· a22 – a21· a12 i3 = (a22· b1 – a12· b2)/d iq = (a11· b2 – a21· b1)/d 

Tearing Algorithm III Solve symbolically for the tearing variables, and find replacement equations for the two residual equations, which permit to make the entire set of equations causal. Find an explicit DAE system by completely sorting the equations both horizontally and vertically.

 41 operations 20 equations U0 = f(t) u3 = R3 · i3 9 additions 7 subtractions 19 multiplications 6 divisions  41 operations U0 = f(t) a11 = R1·R3 + R1·R4 + R3·R4 a12 = R4·Rq a21 = R2·R3 a22 = R1·R2 + R1·Rq + R2·Rq b1 = R4 · U0 - (R1+R4 ) · uc b2 = (R1+R2 ) · (U0 - uc ) d = a11· a22 – a21· a12 i3 = (a22· b1 – a12· b2)/d iq = (a11· b2 – a21· b1)/d u3 = R3 · i3 uq = Rq · iq u4 = u3 + uc u1 = U0 - uq - u4 u2 = u1 + u3 i1 = u1 / R1 i2 = u2 / R2 i4 = u4 / R4 duc / dt = ic / C ic = i2 + i3

Relaxation Algorithm I Apply the relaxation algorithm to the same electrical circuit. For determining the sequence of equations and variables, make use of the following heuristics: Make the equations causal in the same way as for Problem 4.1. Start with the first residual equation. It is being placed as the last equation, whereby the corresponding tearing variable is the last variable. Number the equations, which can be made causal on the basis of the assumption that the tearing variable is already known, starting with equation #1, and set the variables for which these equations are being solved also at the beginning of the list of variables, starting with variable #1. In this way, the diagonal elements can be normalized to 1.

Relaxation Algorithm II Set the second residual equation as the second to last equation, whereby the corresponding tearing variable is also the second to last variable. Number the equations, which can be causalized based on the assumption that the second tearing variable is already known, in increasing order following the first set of equations (with the exception of the first residual equation, which comes at the very end). The resulting equation system in matrix form has diagonal elements that are all normalized to 1, and contains exactly two non-zero elements above the diagonal. These are located in the columns of the tearing variables and in the rows of the first equation of the causalized equation system. . Consequently, the problem of minimizing the number of non-zero elements above the diagonal in the case of the relaxation algorithm is indeed identical with the search for suitable tearing variables.

 uq = Rq · iq i1 = u1 / R1 i2 = u2 / R2 u3 = R3 · i3 i4 = u4 / R4 iq = i1 + i2 i3 = i1 - i4 u1 = U0 - uq - u4 u2 = u1 + u3 u4 = u3 + uc 4 u3 - R3 · i3 = 0 u4 - u3 = uc i4 - u4 /R4 = 0 uq - Rq · iq = 0 u1 + uq + u4 = U0 u2 - u1 - u3 = 0 i1 - u1 /R1 = 0 i2 - u2 /R2 = 0 iq - i1 - i2 = 0 i3 - i1 + i4 = 0  7 8 1 3 9 10 5 6 2

 u3 - R3 · i3 = 0 u4 - u3 = uc i4 - u4 /R4 = 0 uq - Rq · iq = 0 u1 + uq + u4 = U0 u2 - u1 - u3 = 0 i1 - u1 /R1 = 0 i2 - u2 /R2 = 0 iq - i1 - i2 = 0 i3 - i1 + i4 = 0 

u3 = R3· i3 c1 = -R3 u4 = uC –c1· i3

c2 = c1 /R4 c3 = uC /R4 c4 = -c1 c5 = U0 - uC i4 = c3 –c2· i3 c6 = 1 – c2 c7 = -c3 uq = Rq· iq

c8 = Rq u1 = c5 – c8· iq – c4· i3 c9 = c8 c10 = c1 + c4 c11 = c5 c12 = c8 /R1 c13 = c4 /R1 c14 = c5 /R1 u2 = c11 – c9· iq – c10· i3 c15 = c9 /R2 c16 = c10 /R2 c17 = c11 /R2 i1 = c14 – c12· iq – c13· i3

c18 = 1 + c12 c19 = c13 c20 = c14 c21 = c12 c22 = c6 + c13 c23 = c7 + c14 i2 = c17 – c15· iq – c16· i3 c24 = c18 + c15 c25 = c19 + c16 c26 = c20 + c17 iq = (c26 – c25· i3 ) / c24 c27 = c22 – c21· c25 / c24 c28 = c23 – c21· c26 / c24 i3 = c28 / c27

Tearing vs. Relaxation Apply the relaxation algorithm to the resulting set of equations, and determine an explicit DAE system in this way. Count the number of additions, subtractions, multiplications, and divisions of the two sets of equations that result from the two algorithms, and determine, which of the two algorithms is more economical in the case of the given example.

 54 operations U0 = f(t) c1 = -R3 c2 = c1 /R4 c3 = uC /R4 c4 = -c1 c5 = U0 - uC c6 = 1 – c2 c7 = -c3 c8 = Rq c9 = c8 c10 = c1 + c4 c11 = c5 c12 = c8 /R1 c13 = c4 /R1 c14 = c5 /R1 c15 = c9 /R2 c16 = c10 /R2 c17 = c11 /R2 c18 = 1 + c12 c19 = c13 c20 = c14 c21 = c12 c22 = c6 + c13 c23 = c7 + c14 c24 = c18 + c15 c25 = c19 + c16 c26 = c20 + c17 c27 = c22 – c21· c25 / c24 c28 = c23 – c21· c26 / c24 i3 = c28 / c27 iq = (c26 – c25· i3 ) / c24 i2 = c17 – c15· iq – c16· i3 i1 = c14 – c12· iq – c13· i3 u2 = c11 – c9· iq – c10· i3 u1 = c5 – c8· iq – c4· i3 uq = Rq· iq i4 = c3 –c2· i3 u4 = uC –c1· i3 u3 = R3· i3 duc / dt = ic / C ic = i2 + i3 41 equations 8 additions 18 subtractions 15 multiplications 13 divisions  54 operations

It is also possible to mix the relaxation algorithm and the tearing algorithm. U0 = f(t) c1 = -R3 c2 = c1 /R4 c3 = uC /R4 c4 = -c1 c5 = U0 - uC c6 = 1 – c2 c7 = -c3 c8 = Rq c9 = c8 c10 = c1 + c4 c11 = c5 c12 = c8 /R1 c13 = c4 /R1 c14 = c5 /R1 c15 = c9 /R2 c16 = c10 /R2 c17 = c11 /R2 c18 = 1 + c12 c19 = c13 c20 = c14 c21 = c12 c22 = c6 + c13 c23 = c7 + c14 c24 = c18 + c15 c25 = c19 + c16 c26 = c20 + c17 c27 = c22 – c21· c25 / c24 c28 = c23 – c21· c26 / c24 i3 = c28 / c27 iq = (c26 – c25· i3 ) / c24 u3 = R3 · i3 uq = Rq · iq u4 = u3 + uc u1 = U0 - uq - u4 u2 = u1 + u3 i1 = u1 / R1 i2 = u2 / R2 i4 = u4 / R4 duc / dt = ic / C ic = i2 + i3 41 equations 10 additions 10 subtractions 5 multiplications 16 divisions  41 operations