Skip to content

Commit 3626d30

Browse files
authored
Make some equations displaystyle (#323)
* Make the inline fraction displaystyle. * Make a bunch of equations displaystyle. * Reduce space between the 'v = ' and the text; increase spacing before and after the |.
1 parent 11feaf2 commit 3626d30

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

chapter1/fundamentals.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The Poisson problem, including both the PDE, $-\nabla^2 u = f$, and the boundary
2727

2828
In the two-dimensional space with coordinates $x$ and $y$, we can expand the Poisson equation as
2929

30-
$-\frac{\partial^2 u}{\partial x^2} - \frac{\partial^2 u}{\partial y^2} = f(x,y)$
30+
$$-\frac{\partial^2 u}{\partial x^2} - \frac{\partial^2 u}{\partial y^2} = f(x,y)$$
3131

3232
The unknown $u$ is now a function of two variables, $u=u(x,y)$, defined over the two-dimensional domain $\Omega$.
3333

@@ -65,7 +65,7 @@ The terms trial and test functions are used in FEniCSx too. The test and trial f
6565

6666
In the present case, we multiply the Poisson equation by a test function $v$ and integrate over $\Omega$:
6767

68-
$\int_\Omega (-\nabla^2 u) v~\mathrm{d} x = \int_\Omega f v~\mathrm{d} x.$
68+
$$\int_\Omega (-\nabla^2 u) v~\mathrm{d} x = \int_\Omega f v~\mathrm{d} x.$$
6969

7070
Here $\mathrm{d} x$ denotes the differential element for integration over the domain $\Omega$. We will later let $\mathrm{d} s$ denote the differential element for integration over $\partial\Omega$, the boundary of $\Omega$.
7171

@@ -74,29 +74,31 @@ Here, we have a second-order differential of $u$, which can be transformed to a
7474
[integration by parts](https://en.wikipedia.org/wiki/Integration_by_parts).
7575
The formula reads
7676

77-
$-\int_\Omega (\nabla^2 u)v~\mathrm{d}x
77+
$$-\int_\Omega (\nabla^2 u)v~\mathrm{d}x
7878
= \int_\Omega\nabla u\cdot\nabla v~\mathrm{d}x-
79-
\int_{\partial\Omega}\frac{\partial u}{\partial n}v~\mathrm{d}s,$
79+
\int_{\partial\Omega}\frac{\partial u}{\partial n}v~\mathrm{d}s,$$
8080

81-
where $\frac{\partial u}{\partial n}=\nabla u \cdot \vec{n}$ is the derivative of $u$ in the outward normal direction $\vec{n}$ on the boundary.
81+
where $\dfrac{\partial u}{\partial n}=\nabla u \cdot \vec{n}$ is the derivative of $u$ in the outward normal direction $\vec{n}$ on the boundary.
8282

8383
Another feature of variational formulations is that the test function $v$ is required to vanish on the parts of the boundary where the solution $u$ is known. See for instance {cite}`fd-Langtangen_Mardal_FEM_2019`.
8484

8585
In the present problem, this means that $v$ is $0$ on the whole boundary $\partial\Omega$. Thus, the second term in the integration by parts formula vanishes, and we have that
8686

87-
$\int_\Omega \nabla u \cdot \nabla v~\mathrm{d} x = \int_\Omega f v~\mathrm{d} x.$
87+
$$\int_\Omega \nabla u \cdot \nabla v~\mathrm{d} x = \int_\Omega f v~\mathrm{d} x.$$
8888

8989
If we require that this equation holds for all test functions $v$ in some suitable space $\hat{V}$, the so-called _test space_, we obtain a well-defined mathematical problem that uniquely determines the solution $u$ which lies in some function space $V$. Note that $V$ does not have to be the same space as
9090
$\hat{V}$. We call the space $V$ the _trial space_. We refer to the equation above as the _weak form_/_variational form_ of the original boundary-value problem. We now properly state our variational problem:
9191
Find $u\in V$ such that
9292

93-
$\int_\Omega \nabla u \cdot \nabla v~\mathrm{d} x = \int_\Omega f v~\mathrm{d} x\qquad \forall v \in \hat{V}.$
93+
$$\int_\Omega \nabla u \cdot \nabla v~\mathrm{d} x = \int_\Omega f v~\mathrm{d} x\qquad \forall v \in \hat{V}.$$
9494

9595
For the present problem, the trial and test spaces $V$ and $\hat{V}$ are defined as
96-
\begin{align}
97-
V&=\{v\in H^1(\Omega) \vert v=u_D&&\text{on } \partial \Omega \},\\
98-
\hat{V}&=\{v\in H^1(\Omega) \vert v=0 &&\text{on } \partial \Omega \}.
99-
\end{align}
96+
\begin{equation}
97+
\begin{alignedat}{2}
98+
V &= \{v \in H^1(\Omega) \mid v = u_D && \quad \text{on } \partial \Omega \}, \\
99+
\hat{V} &= \{v \in H^1(\Omega) \mid v = 0 && \quad \text{on } \partial \Omega \}.
100+
\end{alignedat}
101+
\end{equation}
100102
In short, $H^1(\Omega)$ is the Sobolev space containing functions $v$ such that $v^2$ and $\vert \nabla v \vert ^2$ have finite integrals over $\Omega$. The solution of the underlying
101103
PDE must lie in a function space where the derivatives are
102104
also continuous, but the Sobolev space $H^1(\Omega)$ allows functions with discontinuous derivatives.

0 commit comments

Comments
 (0)