aboutsummaryrefslogtreecommitdiffstats
path: root/FuVar.tex
blob: 13b0d2d78c958e35bf7d0c9fb43c7429204fce92 (plain)
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
% !TeX program = xelatex
% !TeX encoding = utf8
% !TeX root = FuVar.tex

%% TODO: publish to CTAN
\documentclass[twocolumn, margin=normal]{tex/hsrzf}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Packages

%% TODO: publish to CTAN
\usepackage{tex/hsrstud}

%% Language configuration
\usepackage{polyglossia}
\setdefaultlanguage{english}

%% License configuration
\usepackage[
    type={CC},
    modifier={by-nc-sa},
    version={4.0},
    lang={english},
]{doclicense}

%% Math
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{mathtools}

%% Layout
\usepackage{enumitem}

%% Nice drwaings
\usepackage{tikz}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Metadata

\course{Elektrotechnik}
\module{FuVar}
\semester{Spring Semseter 2021}

\authoremail{naoki.pross@ost.ch}
\author{\textsl{Naoki Pross} -- \texttt{\theauthoremail}}

\title{\texttt{\themodule} Notes}
\date{\thesemester}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Macros and settings

%% Theorems
\newtheoremstyle{fuvarzf} % name of the style to be used
  {\topsep}
  {\topsep}
  {}
  {0pt}
  {\bfseries}
  {.}
  { }
  { }

\theoremstyle{fuvarzf}
\newtheorem{theorem}{Theorem}
\newtheorem{proposition}{Proposition}
\newtheorem{method}{Method}
\newtheorem{definition}{Definition}
\newtheorem{lemma}{Lemma}
\newtheorem{remark}{Remark}

\DeclareMathOperator{\tr}{\mathrm{tr}}


\setlist[description]{
  format = { \normalfont\itshape }
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Document

\begin{document}

\maketitle
% \tableofcontents

\section{Preface}

These are just my personal notes of the \themodule{} course, and definitively
not a rigorously constructed mathematical text. The good looking \LaTeX{}
typesetting may trick you into thinking it is rigorous, but really, it is not.

\section{Derivatives of vector valued scalar functions}

\begin{definition}[Partial derivative]
  A vector values function \(f: \mathbb{R}^m\to\mathbb{R}\), with
  \(\vec{v}\in\mathbb{R}^m\), has a partial derivative with respect to \(v_i\)
  defined as
  \[
    \partial_{v_i} f(\vec{v})
      = f_{v_i}(\vec{v})
      = \lim_{h\to 0} \frac{f(\vec{v} + h\vec{e}_j) - f(\vec{v})}{h}
  \]
\end{definition}

\begin{proposition}
  Under some generally satisfied conditions (continuity of \(n\)-th order
  partial derivatives) Schwarz's theorem states that it is possible to swap
  the order of differentiation.
  \[
    \partial_x \partial_y f(x,y) = \partial_y \partial_x f(x,y)
  \]
\end{proposition}

\begin{definition}[Linearization]
  A function \(f: \mathbb{R}^m\to\mathbb{R}\) has a linearization \(g\) at
  \(\vec{x}_0\) given by
  \[
    g(\vec{x}) = f(\vec{x}_0) 
      + \sum_{i=1}^m \partial_{x_i} f(\vec{x}_0)(x_i - x_{i,0}) ,
  \]
  if all partial derviatives are defined at \(\vec{x}_0\).
\end{definition}

\begin{theorem}[Propagation of uncertanty]
  Given a measurement of \(m\) values in a vector \(\vec{x}\in\mathbb{R}^m\)
  with values given in the form \(x_i = \bar{x}_i \pm \sigma_{x_i}\), a linear
  approximation the error of a dependent variable \(y\) is computed with
  \[
    y = \bar{y} \pm \sigma_y \approx f(\bar{\vec{x}})
      \pm \sqrt{\sum_{i=1}^m \left(
        \partial_{x_i} f(\bar{\vec{x}}) \sigma_{x_i}\right)^2}
  \]
\end{theorem}

\begin{definition}[Gradient vector]
  The \emph{gradient} of a function \(f(\vec{x}), \vec{x}\in\mathbb{R}^m\) is a
  vector containing the derivatives in each direction.
  \[
    \grad f (\vec{x}) = \sum_{i=1}^m \partial_{x_i} f(\vec{x}) \vec{e}_i
      = \begin{pmatrix}
        \partial_{x_1} f(\vec{x}) \\
        \vdots \\
        \partial_{x_m} f(\vec{x}) \\
      \end{pmatrix}
  \]
\end{definition}

\begin{definition}[Directional derivative]
  A function \(f(\vec{x})\) has a directional derivative in direction
  \(\vec{r}\) (with \(|\vec{r}| = 1\)) given by
  \[
    \frac{\partial f}{\partial\vec{r}} 
      = \nabla_\vec{r} f = \vec{r} \dotp \grad f
  \]
\end{definition}

\begin{theorem}
  The gradient vector always points towards \emph{the direction of steepest
  ascent}.
\end{theorem}

\section{Methods for maximization and minimization problems}

\begin{method}[Find stationary points]
  Given a function \(f: D \subseteq \mathbb{R}^m \to \mathbb{R}\), to
  find its maxima and minima we shall consider the points
  \begin{itemize}
    \item that are on the boundary of the domain \(\partial D\),
    \item where the gradient \(\grad f\) is not defined,
    \item that are stationary, i.e. where \(\grad f = \vec{0}\).
  \end{itemize}
\end{method}

\begin{method}[Determine the type of stationary point for 2 dimensions]
  Given a scalar function of two variables \(f(x,y)\) and a stationary point
  \(\vec{x}_s\) (where \(\grad f(\vec{x}_s) = \vec{0}\)), we define the
  \emph{discriminant}
  \[
    \Delta = \partial_x^2 f \partial_y^2 f - \partial_y \partial_x f
  \]
  \begin{itemize}
    \item if \(\Delta > 0\) then \(\vec{x}_s\) is an extrema, if \(\partial_x^2
      f(\vec{x}_s) < 0\) it is a maximum, whereas if \(\partial_x^2
      f(\vec{x}_s) > 0\) it is a minimum;

    \item if \(\Delta < 0\) then \(\vec{x}_s\) is a saddle point;

    \item if \(\Delta = 0\) we need to analyze further.
  \end{itemize}
\end{method}

\begin{remark}
  The previous method is obtained by studying the second directional derivative
  \(\nabla_\vec{r}\nabla_\vec{r} f\) at the stationary point in direction of a
  vector \(\vec{r} = \vec{e}_1\cos(\alpha) + \vec{e}_2\sin(\alpha)\)
\end{remark}

\begin{definition}[Hessian matrix]
  Given a function \(f: \mathbb{R}^m \to \mathbb{R}\), the square matrix whose
  entry at the \(i\)-th row and \(j\)-th column is the second derivative of
  \(f\) first with respect to \(x_j\) and then to \(x_i\) is know as the
  \emph{Hessian} matrix.
  \(
    \left(\mtx{H}_f\right)_{i,j} = \partial_{x_i}\partial_{x_j} f
  \)
  or
  \[
    \mtx{H}_f = \begin{pmatrix}
      \partial_{x_1}\partial_{x_1} f & \cdots & \partial_{x_1}\partial_{x_m} f \\
      \vdots & \ddots & \vdots \\
      \partial_{x_m}\partial_{x_1} f & \cdots & \partial_{x_m}\partial_{x_m} f \\
    \end{pmatrix}
  \]
  Because (almost always) the order of differentiation
  does not matter, it is a symmetric matrix.
\end{definition}

\begin{method}[Determine the type of stationary point in higher dimensions]
  Given a scalar function of two variables \(f(x,y)\) and a stationary point
  \(\vec{x}_s\) (where \(\grad f(\vec{x}_s) = \vec{0}\)), we compute the
  Hessian matrix \(\mtx{H}_f(\vec{x}_s)\). Then we compute its eigenvalues
  \(\lambda_1, \ldots, \lambda_m\) and
  \begin{itemize}
    \item if all \(\lambda_i > 0\), the point is a minimum;
    \item if all \(\lambda_i < 0\), the point is a maximum;
    \item if there are both positive and negative eigenvalues,
      it is a saddle point.
  \end{itemize}
  In the other cases, when there are \(\lambda_i \leq 0\) and/or \(\lambda_i
  \geq 0\) further analysis is required.
\end{method}

\begin{remark}
  Recall that to compute the eigenvalues of a matrix, one must solve the
  equation \((\mtx{H} - \lambda\mtx{I})\vec{x} = \vec{0}\). Which can be done
  by solving the characteristic polynomial \(\det\left(\mtx{H} -
  \lambda\mtx{I}\right) = 0\) to obtain \(\dim(\mtx{H})\) \(\lambda_i\), which
  when plugged back in result in a overdetermined system of equations.
\end{remark}

\begin{method}[Quickly find the eigenvalues of a \(2\times 2\) matrix]
  Let
  \[
    m = \frac{1}{2}\tr \mtx{H} = \frac{a + d}{2}
    \text{  and  }
    p = \det\mtx{H} = ad - bc ,
  \]
  then
  \[
    \lambda = m \pm \sqrt{m^2 - p} .
  \]
\end{method}

\begin{method}[Search for a constrained extremum in 2 dimensions]
  Let \(n(x,y) = 0\) be a constraint in the search of the extrema of a function
  \(f: D \subseteq \mathbb{R}^2 \to \mathbb{R}\). To find the extrema we look for
  points
  \begin{itemize}
    \item on the boundary \(\vec{u} \in \partial D\) where \(n(\vec{u}) = 0\);

    \item \(\vec{u}\) where the gradient either does not exist or is
      \(\vec{0}\), and satisfy \(n(\vec{u}) = 0\);

    \item that solve the system of equations
      \[
        \begin{cases}
          \partial_x f(\vec{u}) \cdot \partial_y n(\vec{u})
            = \partial_y f(\vec{u}) \cdot \partial_x n(\vec{u}) \\
          n(\vec{u}) = 0
        \end{cases}
      \]
  \end{itemize}
\end{method}

\begin{method}[%
    Search for a constrained extremum in higher dimensions,
    method of Lagrange multipliers]
  We wish to find the extrema of \(f: D \subseteq \mathbb{R}^m \to \mathbb{R}\)
  under \(k < m\) constraints \(n_1 = 0, \cdots, n_k = 0\). To find the extrema 
  we consider the following points:
  \begin{itemize}
    \item Points on the boundary \(\vec{u} \in \partial D\) that satisfy
      \(n_i(\vec{u}) = 0\) for all \(1 \leq i \leq k\), 

    \item Points \(\vec{u} \in D\) where either
      \begin{itemize}
        \item any of \(\grad f, \grad n_1, \ldots, \grad n_k\) do not exist, or
        \item \(\grad n_1, \ldots, \grad n_k\) are linearly \emph{dependent},
      \end{itemize}
      and that satisfy \(0 = n_1(\vec{u}) = \ldots = n_k(\vec{u})\).

    \item Points that solve the system of \(m+k\) equations
      \[
        \begin{dcases}
          \grad f(\vec{u}) = \sum_{i = 1}^k \lambda_i \grad n_i(\vec{u})
            & (m\text{-dimensional}) \\
          n_i(\vec{u}) = 0  & \text{ for } 1 \leq i \leq k
        \end{dcases}
      \]
      The \(\lambda\) values are known as \emph{Lagrange multipliers}. The same
      calculation can be written more compactly by defining the
      \(m+k\) dimensional \emph{Lagrangian}
      \[
        \mathcal{L}(\vec{u}, \vec{\lambda}) 
          = f(\vec{u}) - \sum_{i = 0}^k \lambda_i n_i(\vec{u})
      \]
      where \(\vec{\lambda} = \lambda_1, \ldots, \lambda_k\) and then
      evaluating \(\grad \mathcal{L}(\vec{u}, \vec{\lambda}) = \vec{0}\).
  \end{itemize}
\end{method}

\section{Integration}
\begin{remark}
  
\end{remark}


\section*{License}
\doclicenseText

\begin{center}
  \doclicenseImage
\end{center}

\end{document}
% vim:ts=2 sw=2 et spell: