-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmultiphysicsL4.tex
More file actions
242 lines (242 loc) · 5.79 KB
/
multiphysicsL4.tex
File metadata and controls
242 lines (242 loc) · 5.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
%
% Copyright © 2014 Peeter Joot. All Rights Reserved.
% Licenced as described in the file LICENSE under the root directory of this GIT repository.
%
%\input{../blogpost.tex}
%\renewcommand{\basename}{multiphysicsL4}
%\renewcommand{\dirname}{notes/ece1254/}
%\newcommand{\keywords}{ECE1254H}
%\input{../peeter_prologue_print2.tex}
%
%\usepackage{kbordermatrix}
%
%\beginArtNoToc
%\generatetitle{ECE1254H Modeling of Multiphysics Systems. Lecture 4: Modified nodal analysis. Taught by Prof.\ Piero Triverio}
%%\subsection{Modified nodal analysis}
\index{modified nodal analysis}
%\label{chap:multiphysicsL4}
%
%\subsection{Disclaimer}
%
%Peeter's lecture notes from class. These may be incoherent and rough.
%\chapter{Solving large systems}
%
The goal is to solve \textAndIndex{linear systems} of the form
%
\begin{equation}\label{eqn:multiphysicsL4:60}
M \Bx = \Bb,
\end{equation}
%
possibly with thousands of elements.
%
\sectionAndIndex{Gaussian elimination.}
%
\begin{equation}\label{eqn:multiphysicsL4:80}
\kbordermatrix{
& 1 & 2 & 3 \\
1 & M_{11} & M_{12} & M_{13} \\
2 & M_{21} & M_{22} & M_{23} \\
3 & M_{31} & M_{32} & M_{33} \\
}
\begin{bmatrix}
x_1 \\
x_2 \\
x_3 \\
\end{bmatrix}
=
\begin{bmatrix}
b_1 \\
b_2 \\
b_3 \\
\end{bmatrix}
\end{equation}
%
It's claimed for now, to be seen later, that back substitution is the fastest way to arrive at the solution, less computationally complex than completion the diagonalization.
%
Steps
%
\begin{equation}\label{eqn:multiphysicsL4:100}
(1) \cdot \frac{M_{21}}{M_{11}} \implies
\begin{bmatrix}
M_{21} & \frac{M_{21}}{M_{11}} M_{12} & \frac{M_{21}}{M_{11}} M_{13} \\
\end{bmatrix}
\end{equation}
%
\begin{equation}\label{eqn:multiphysicsL4:120}
(2) \cdot \frac{M_{31}}{M_{11}} \implies
\begin{bmatrix}
M_{31} & \frac{M_{31}}{M_{11}} M_{32} & \frac{M_{31}}{M_{11}} M_{33} \\
\end{bmatrix}
\end{equation}
%
This gives
%
\begin{equation}\label{eqn:multiphysicsL4:140}
\begin{bmatrix}
%\mathLabelBox
%{
M_{11}
%}
%{Pivot}
& M_{12} & M_{13} \\
0 & M_{22} - \frac{M_{21}}{
%\mathLabelBox
%{
M_{11}
%}{Multiplier}
} M_{12} & M_{23} - \frac{M_{21}}{M_{11}} M_{13} \\
0 & M_{32} - \frac{M_{31}}{M_{11}} M_{32} & M_{33} - \frac{M_{31}}{M_{11}} M_{33} \\
\end{bmatrix}
\begin{bmatrix}
x_1 \\
x_2 \\
x_3 \\
\end{bmatrix}
=
\begin{bmatrix}
b_1 \\
b_2 - \frac{M_{21}}{M_{11}} b_1 \\
b_3 - \frac{M_{31}}{M_{11}} b_1
\end{bmatrix}.
\end{equation}
%
Here the \(M_{11}\) element is called the \textAndIndex{pivot}. Each of the \(M_{j1}/M_{11}\) elements is called a \textAndIndex{multiplier}. This operation can be written as
%
\begin{equation}\label{eqn:multiphysicsL4:160}
\begin{bmatrix}
M_{11} & M_{12} & M_{13} \\
0 & M_{22}^{(2)} & M_{23}^{(3)} \\
0 & M_{32}^{(2)} & M_{33}^{(3)} \\
\end{bmatrix}
\begin{bmatrix}
x_1 \\
x_2 \\
x_3 \\
\end{bmatrix}
=
\begin{bmatrix}
b_1 \\
b_2^{(2)} \\
b_3^{(2)} \\
\end{bmatrix}.
\end{equation}
%
Using \( M_{22}^{(2)} \) as the pivot this time, form
\begin{equation}\label{eqn:multiphysicsL4:180}
\begin{bmatrix}
M_{11} & M_{12} & M_{13} \\
0 & M_{22}^{(2)} & M_{23}^{(3)} \\
0 & 0 & M_{33}^{(3)} - \frac{M_{32}^{(2)}}{M_{22}^{(2)}} M_{23}^{(2)} \\
\end{bmatrix}
\begin{bmatrix}
x_1 \\
x_2 \\
x_3 \\
\end{bmatrix}
=
\begin{bmatrix}
b_1 \\
b_2 - \frac{M_{21}}{M_{11}} b_1 \\
b_3 - \frac{M_{31}}{M_{11}} b_1
- \frac{M_{32}^{(2)}}{M_{22}^{(2)}} b_{2}^{(2)} \\
\end{bmatrix}.
\end{equation}
%
\section{LU decomposition.}
\index{LU decomposition}
%
Through Gaussian elimination, the system has been transformed from
%
\begin{equation}\label{eqn:multiphysicsL4:200}
M x = b
\end{equation}
%
to
\begin{equation}\label{eqn:multiphysicsL4:220}
U x = y.
\end{equation}
%
The Gaussian transformation written out in the form \( U \Bx = b \) is
%
\begin{equation}\label{eqn:multiphysicsL4:240}
U \Bx =
\begin{bmatrix}
1 & 0 & 0 \\
-\frac{M_{21}}{M_{11}} & 1 & 0 \\
\frac{M_{32}^{(2)}}{M_{22}^{(2)}}
\frac{M_{21}}{M_{11}}
-
\frac{M_{31}}{M_{11}}
&
-
\frac{M_{32}^{(2)}}{M_{22}^{(2)}}
& 1
\end{bmatrix}
\begin{bmatrix}
b_1 \\
b_2 \\
b_3
\end{bmatrix}.
\end{equation}
%
As a verification observe that the
operation matrix \( K^{-1} \), where \( K^{-1} U = M \) produces the original system
%
\begin{equation}\label{eqn:multiphysicsL4:260}
\begin{bmatrix}
1 & 0 & 0 \\
\frac{M_{21}}{M_{11}} & 1 & 0 \\
\frac{M_{31}}{M_{11}} &
\frac{M_{32}^{(2)}}{M_{22}^{(2)}} &
1
\end{bmatrix}
\begin{bmatrix}
U_{11} & U_{12} & U_{13} \\
0 & U_{22} & U_{23} \\
0 & 0 & U_{33} \\
\end{bmatrix}
\Bx = \Bb
\end{equation}
%
\index{LU decomposition}
Using this LU decomposition is generally superior to standard Gaussian elimination, since it can be used for many different \(\Bb\) vectors, and cost no additional work after the initial factorization.
%
The steps are
%
\begin{equation}\label{eqn:multiphysicsL4:280}
\begin{aligned}
b
&= M x
\\ &= L \lr{ U x}
\equiv L y.
\end{aligned}
\end{equation}
%
The matrix equation \( L y = b \) can now be solved by substituting first \( y_1 \), then \( y_2 \), and finally \( y_3 \). This is called \textAndIndex{forward substitution}.
%
The final solution is
%
\begin{equation}\label{eqn:multiphysicsL4:300}
U x = y,
\end{equation}
%
using \textAndIndex{back substitution}.
%
Note that this produced the vector \( y \) as a side effect of performing the Gaussian elimination process.
%
%\index{LU decomposition}
\makeexample{Numeric LU factorization.}{example:multiphysicsL4:1}{
\input{luExample.tex}
}
%
\index{LU decomposition!pivot}
\makeexample{Numeric LU factorization with pivots.}{example:multiphysicsL4:2}{
\input{luExample2.tex}
}
%
\makeexample{LU with pivots.}{example:multiphysicsL4:3}{
\input{luAlgorithm.tex}
}
%
%\EndArticle
%\EndNoBibArticle