Solving Large Scale Linear Systems (in parallel)

Download Report

Transcript Solving Large Scale Linear Systems (in parallel)

Solving Scale Linear Systems
(Example system)
Lecture 13
MA/CS 471
Fall 2003
First – Brief Reintroduction to
Linear Systems
• First we will use an example physical
system to construct a set of 5 couple linear
equations in 5 unknowns.
• We will seek a solution using Matlab
• Later we will consider generalizations to
larger systems (with correspondingly more
unknowns to find).
Circuit Problem
5W
1W
4W
3W
30V
6W
7W
+
2W
1W
Problem: Find the current running through each closed loop
Circuit Problem
DC Battery
Resistor
(resistance in
ohms)
Resistance free wire
Notation
5W
1W
4W
3W
30V
6W
7W
+
2W
1W
Circuit Problem
5W
1W
4W
3W
6W
7W
30V
2W
1W
Find the current (in amperes) traveling
in the shown closed loops
Kirchoff’s Second Law
• Kirchoff's 2nd Law states that for any
closed loop path around a circuit the sum
of the voltage gains and voltage drops
equals zero. In the circuit shown, there is a
voltage gain for each electron traveling
through the voltage source and a voltage
drop across the resistor.
Loop 1 Balance
Consider LOOP 1
5W
1W
4W
3W
I2
6W
7W
30V
2W
I3
1W
The gain is 30V.
I1 1W  3W  2W 
The loop 1 loss (by Ohm’s law) is:
The gain due to current from loop 2 is:  I 2  3W 
The gain due to current from loop 3 is:  I 3  2W 
Kirchoff’s 2nd law states gain=loss, =>
30  I 2  3W   I 3  2W   I1 1W  3W  2W 
All Loop Balances
5
1W
30V
4W
3W
2
2W
3
5W
6W
7W
4
1
1W
Loop 1: 30V  I 2  3W   I 3  2W   I1 1W  3W  2W 
Loop 2: I1  3W   I 4  7W   I 2  3W  4W  7W 
Loop 3: I1  2W   I 3  2W  1W 
Loop 4: I 2  7W   I 5  6W   I 4  6W  7W 
Loop 5: I 4  6W   I 5  5W  6W 
Rearranging Linear System
 I1 1W  3W  2W   I 2  3W   I 3  2W   30V
Arranging unknown
Loop currents on left
hand side and known
voltage sources on
right hand side:
I1  3W   I 2  3W  4W  7W   I 4  7W   0
I1  2W   I 3  2W  1W   0
I 2  7W   I 4  6W  7W   I 5  6W   0
I 4  6W   I 5  5W  6W   0
 I1 1  3  2   I 2  3  I 3  2   30 A
I1  3  I 2  3  4  7   I 4  7   0
Divide through by Ohms:
I1  2   I 3  2  1  0
I 2  7   I 4  6  7   I5  6   0
I 4  6  I5 5  6  0
Final System
6 I1  3I 2  2 I 3  30 A
3I1  14 I 2  7 I 4  0
Simplifying the coefficients:
2 I1  3I 3  0
7I 2  13I 4  6 I 5  0
6 I 4  11I 5  0
Matrix form:
2
0
0   I1   30 A 
 6 3
 3 14 0
7
0   I2   0 

  

 2
0 3 0
0   I3    0 

  

I
0
7
0

13
6
0

 4  

 0



I 
0
0
6

11
0

 5  

Final Form
• Negating both sides:
 6 3 2 0 0   I1   30 A 
 3 14 0 7 0   I   0 

 2  

 2 0
3 0 0   I3    0 

  

 0 7 0 13 6   I 4   0 
 0 0 0 6 11   I   0 

 5  

• This is the enemy.
• We will create systems with a large
number of degrees of freedom later on.
Solution (by Matlab)
5W
1W
4W
3W
Solution:
1.08A
6W
2.74A
7W
8.19A
30V
5.46A
2W
1W
1.97A
Homework/Lab work
Q1)
a) Create a non-trivial circuit with 15 sub loops. Use a range of
resistor values between 1 and 10.
b) Using a sparse matrix (see MA375/Lecture 8 intro), solve for
loop currents with Matlab
c) Draw a diagram indicating current along each segment of
circuit (to two significant figures).
d) Verify Kerchoff’s first law (look it up) by checking the sum of
currents at three of the wire intersections.
e) Count the number of non-zeros of your 15x15 matrix and report
the amount of fill (i.e. number of non-zeros/225)
f)
Include print out of matlab window used for matrix solution.
Q2) Review:
a) LU factorization
b) condition number of a matrix