Merge branch 'main' into coryab/edit-problem-1
This commit is contained in:
commit
4e633d13b5
3
.gitignore
vendored
3
.gitignore
vendored
@ -36,6 +36,9 @@
|
|||||||
*.log
|
*.log
|
||||||
*.out
|
*.out
|
||||||
*.bib
|
*.bib
|
||||||
|
*.synctex.gz
|
||||||
|
*.bbl
|
||||||
|
|
||||||
|
# C++ specifics
|
||||||
src/*
|
src/*
|
||||||
!src/*.cpp
|
!src/*.cpp
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
\documentclass[english,notitlepage]{revtex4-1} % defines the basic parameters of the document
|
\documentclass[english,notitlepage]{revtex4-1} % defines the basic parameters of the document
|
||||||
%For preview: skriv i terminal: latexmk -pdf -pvc filnavn
|
%For preview: skriv i terminal: latexmk -pdf -pvc filnavn
|
||||||
|
|
||||||
|
% Silence warning of revtex4-1
|
||||||
|
\usepackage{silence}
|
||||||
|
\WarningFilter{revtex4-1}{Repair the float}
|
||||||
|
|
||||||
% if you want a single-column, remove reprint
|
% if you want a single-column, remove reprint
|
||||||
|
|
||||||
@ -13,7 +15,7 @@
|
|||||||
%% I recommend downloading TeXMaker, because it includes a large library of the most common packages.
|
%% I recommend downloading TeXMaker, because it includes a large library of the most common packages.
|
||||||
|
|
||||||
\usepackage{physics,amssymb} % mathematical symbols (physics imports amsmath)
|
\usepackage{physics,amssymb} % mathematical symbols (physics imports amsmath)
|
||||||
\include{amsmath}
|
\usepackage{amsmath}
|
||||||
\usepackage{graphicx} % include graphics such as plots
|
\usepackage{graphicx} % include graphics such as plots
|
||||||
\usepackage{xcolor} % set colors
|
\usepackage{xcolor} % set colors
|
||||||
\usepackage{hyperref} % automagic cross-referencing (this is GODLIKE)
|
\usepackage{hyperref} % automagic cross-referencing (this is GODLIKE)
|
||||||
|
|||||||
@ -1,3 +1,44 @@
|
|||||||
\section*{Problem 4}
|
\section*{Problem 4}
|
||||||
|
|
||||||
% Show that each iteration of the discretized version naturally creates a matrix equation.
|
% Show that each iteration of the discretized version naturally creates a matrix equation.
|
||||||
|
|
||||||
|
The value of $u(x_{0})$ and $u(x_{1})$ is known, using the discretized equation we can approximate the value of $f(x_{i}) = f_{i}$. This will result in a set of equations
|
||||||
|
\begin{align*}
|
||||||
|
- v_{0} + 2 v_{1} - v_{2} &= h^{2} \cdot f_{1} \\
|
||||||
|
- v_{1} + 2 v_{2} - v_{3} &= h^{2} \cdot f_{2} \\
|
||||||
|
\vdots & \\
|
||||||
|
- v_{m-2} + 2 v_{m-1} - v_{m} &= h^{2} \cdot f_{m-1} \\
|
||||||
|
\end{align*}
|
||||||
|
|
||||||
|
Rearranging the first and last equation, moving terms of known boundary values to the RHS
|
||||||
|
\begin{align*}
|
||||||
|
2 v_{1} - v_{2} &= h^{2} \cdot f_{1} + v_{0} \\
|
||||||
|
- v_{1} + 2 v_{2} - v_{3} &= h^{2} \cdot f_{2} \\
|
||||||
|
\vdots & \\
|
||||||
|
- v_{m-2} + 2 v_{m-1} &= h^{2} \cdot f_{m-1} + v_{m} \\
|
||||||
|
\end{align*}
|
||||||
|
|
||||||
|
We now have a number of linear eqations, corresponding to the number of unknown values, which can be represented as an augmented matrix
|
||||||
|
\begin{align*}
|
||||||
|
\left[
|
||||||
|
\begin{matrix}
|
||||||
|
2v_{1} & -v_{2} & 0 & \dots & 0 \\
|
||||||
|
-v_{1} & 2v_{2} & -v_{3} & 0 & \\
|
||||||
|
0 & -v_{2} & 2v_{3} & -v_{4} & \\
|
||||||
|
\vdots & & & \ddots & \vdots \\
|
||||||
|
0 & & & -v_{m-2} & 2v_{m-1} \\
|
||||||
|
\end{matrix}
|
||||||
|
\left|
|
||||||
|
\,
|
||||||
|
\begin{matrix}
|
||||||
|
g_{1} \\
|
||||||
|
g_{2} \\
|
||||||
|
g_{2} \\
|
||||||
|
\vdots \\
|
||||||
|
g_{m-1} \\
|
||||||
|
\end{matrix}
|
||||||
|
\right.
|
||||||
|
\right]
|
||||||
|
\end{align*}
|
||||||
|
where $g_{i} = h^{2} f_{i}$. An augmented matrix can be represented as $\boldsymbol{A} \vec{x} = \vec{b}$. In this case $\boldsymbol{A}$ is the coefficient matrix with a tridiagonal signature $(-1, 2, -1)$ and dimension $n \cross n$, where $n=m-2$.
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user