-
Notifications
You must be signed in to change notification settings - Fork 1
/
multiphysicsL14.tex
182 lines (182 loc) · 5.16 KB
/
multiphysicsL14.tex
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
%
% 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}{multiphysicsL14}
%\renewcommand{\dirname}{notes/ece1254/}
%\newcommand{\keywords}{ECE1254H}
%\input{../peeter_prologue_print2.tex}
%
%\beginArtNoToc
%\generatetitle{ECE1254H Modeling of Multiphysics Systems. Lecture 14: Backward Euler method and trapezoidal methods. Taught by Prof.\ Piero Triverio}
%\chapter{Backward Euler method and trapazoidal methods}
\label{chap:multiphysicsL14}
%
%\section{Disclaimer}
%
%Peeter's lecture notes from class. These may be incoherent and rough.
%
\section{Backward Euler method.}
\index{Euler!backward method}
%
Discretized time dependent partial differential equations were seen to have the form
%
\begin{equation}\label{eqn:multiphysicsL14:20}
\BG \Bx(t) + \BC \dot{\Bx}(t) = \BB \Bu(t),
\end{equation}
%
where \( \BG, \BC, \BB \) are matrices, and \( \Bu(t) \) is a vector of sources.
%
The backward Euler method augments \cref{eqn:multiphysicsL14:20} with an initial condition. For a one dimensional system such an initial condition could a zero time specification
%
\begin{subequations}
\begin{equation}\label{eqn:multiphysicsL14:40}
G x(t) + C \dot{x}(t) = B u(t),
\end{equation}
\begin{equation}\label{eqn:multiphysicsL14:60}
x(0) = x_0
\end{equation}
\end{subequations}
%
Discretizing time as in \cref{fig:lecture14:lecture14Fig1}.
%
\imageFigure{../figures/ece1254-multiphysics/lecture14Fig1}{Discretized time.}{fig:lecture14:lecture14Fig1}{0.3}
%
The discrete derivative, using a backward difference, is
%
\begin{equation}\label{eqn:multiphysicsL14:80}
\dot{x}(t = t_n) \approx \frac{ x_n - x_{n-1} }{\Delta t}
\end{equation}
%
Evaluating \cref{eqn:multiphysicsL14:40} at \( t = t_n \) is
%
\begin{equation}\label{eqn:multiphysicsL14:100}
G x_n + C \dot{x}(t = t_n) = B u(t_n),
\end{equation}
%
or approximately
%
\begin{equation}\label{eqn:multiphysicsL14:120}
G x_n + C \frac{x_n - x_{n-1}}{\Delta t} = B u(t_n).
\end{equation}
%
Rearranging
%
\begin{equation}\label{eqn:multiphysicsL14:140}
\lr{ G + \frac{C}{\Delta t} } x_n = \frac{C}{\Delta t} x_{n-1}
+
B u(t_n).
\end{equation}
%
Assuming that matrices \( G, C \) are constant, and \( \Delta t \) is fixed, a matrix inversion can be avoided, and a single LU decomposition can be used. For \( N \) sampling points (not counting \( t_0 = 0 \)), \( N \) sets of backward and forward substitutions will be required to compute \( x_1 \) from \( x_0 \), and so forth.
%
Backwards Euler is an implicit method.
%
Recall that the forward Euler method gave
%
%FIXME: \cref{eqn:multiphysicsL13:400}
\begin{equation}\label{eqn:multiphysicsL14:160}
x_{n+1} =
x_n \lr{ I - C^{-1} \Delta t G }
+ C^{-1} \Delta t B u(t_n)
\end{equation}
%
This required
%
\begin{itemize}
\item \( C \) must be invertible.
\item \( C \) must be cheap to invert, perhaps \( C = I \), so that
\begin{equation}\label{eqn:multiphysicsL14:180}
x_{n+1} =
\lr{ I - \Delta t G } x_n
+ \Delta t B u(t_n)
\end{equation}
%\item This is an explicit method : <<< HAD this ?
\item This is an implicit method
\item This can be cheap but unstable.
\end{itemize}
%
\section{Trapezoidal rule (TR).}
\index{trapezoidal rule}
\index{TR|see {trapezoidal rule}}
%
The derivative can be approximated using an average of the pair of derivatives as illustrated in \cref{fig:lecture14:lecture14Fig2}.
%
\imageFigure{../figures/ece1254-multiphysics/lecture14Fig2}{Trapezoidal derivative approximation.}{fig:lecture14:lecture14Fig2}{0.3}
%
\begin{equation}\label{eqn:multiphysicsL14:200}
\frac{x_n - x_{n-1}}{\Delta t} \approx \frac{
\dot{x}(t_{n-1})
+
\dot{x}(t_{n})
}
{2}.
\end{equation}
%
Application to \cref{eqn:multiphysicsL14:40} for \( t_{n-1}, t_n \) respectively gives
%
\begin{equation}\label{eqn:multiphysicsL14:220}
\begin{aligned}
G x_{n-1} + C \dot{x}(t_{n-1}) &= B u(t_{n-1}) \\
G x_{n} + C \dot{x}(t_{n}) &= B u(t_{n}) \\
\end{aligned}
\end{equation}
%
Averaging these
%
\begin{equation}\label{eqn:multiphysicsL14:240}
G \frac{ x_{n-1} + x_n }{2} + C
\frac{
\dot{x}(t_{n-1})
+\dot{x}(t_{n})
}{2}
= B
\frac{u(t_{n-1})
+
u(t_{n}) }{2},
\end{equation}
%
and inserting the trapezoidal approximation
%
\begin{equation}\label{eqn:multiphysicsL14:280}
G \frac{ x_{n-1} + x_n }{2}
+
C
\frac{
x_{n} -
x_{n-1}
}{\Delta t}
= B
\frac{u(t_{n-1})
+
u(t_{n}) }{2},
\end{equation}
%
and a final rearrangement yields
%
%\begin{equation}\label{eqn:multiphysicsL14:260}
\boxedEquation{eqn:multiphysicsL14:260}{
\lr{ G + \frac{2}{\Delta t} C } x_n
=
-
\lr{ G - \frac{2}{\Delta t} C } x_{n_1}
+ B
\lr{u(t_{n-1})
+
u(t_{n}) }.
}
%\end{equation}
%
This is
\begin{itemize}
\item also an implicit method.
\item requires LU of \( G + 2 C /\Delta t \).
\item more accurate than BE, for the same computational cost.
\end{itemize}
%
In all of these methods, accumulation of error is something to be very careful of, and in some cases such error accumulation can even be exponential.
%
This is effectively a way to introduce central differences. On the slides this is seen to be more effective at avoiding either artificial damping and error accumulation that can be seen in backwards and forwards Euler method respectively.
%
%\EndNoBibArticle