You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chapters/advec/advec.qmd
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -822,9 +822,9 @@ one with a discontinuity in the first derivative (Figure
822
822
the left plots in the figures, we get small ripples behind the main
823
823
wave, and this main wave has the amplitude reduced.
824
824
825
-
{#fig-advec-1D-LF-fig1-C08 width="800px"}
825
+
{#fig-advec-1D-LF-fig1-C08 width="100%"}
826
826
827
-
{#fig-advec-1D-LF-fig2-C08 width="800px"}
827
+
{#fig-advec-1D-LF-fig2-C08 width="100%"}
828
828
829
829
### Analysis
830
830
@@ -901,9 +901,9 @@ Experiments show, however, that
901
901
reducing $\Delta t$ or $\Delta x$, while keeping $C$ reduces the
902
902
error.
903
903
904
-
{#fig-advec-1D-UP-fig1-C08 width="800px"}
904
+
{#fig-advec-1D-UP-fig1-C08 width="100%"}
905
905
906
-
{#fig-advec-1D-UP-fig2-C08 width="800px"}
906
+
{#fig-advec-1D-UP-fig2-C08 width="100%"}
907
907
908
908
The amplification factor can be computed using the
909
909
formula (@eq-form-exp-fd1-bw),
@@ -1219,9 +1219,9 @@ $$
1219
1219
A = \frac{1 - (1-\theta) i C\sin p}{1 + \theta i C\sin p}\tp
1220
1220
$$
1221
1221
1222
-
{#fig-advec-1D-CN-fig-C08 width="800px"}
1222
+
{#fig-advec-1D-CN-fig-C08 width="100%"}
1223
1223
1224
-
{#fig-advec-1D-BE-fig-C08 width="800px"}
1224
+
{#fig-advec-1D-BE-fig-C08 width="100%"}
1225
1225
1226
1226
Figure @fig-advec-1D-CN-fig-C08 depicts a numerical solution for $C=0.8$
1227
1227
and the Crank-Nicolson
@@ -1357,17 +1357,17 @@ The curves are labeled according to the table below.
1357
1357
| LW | Lax-Wendroff's method |
1358
1358
| BE | Backward Euler in time, centered difference in space |
1359
1359
1360
-
{#fig-advec-1D-disprel-C1-1 width="800px"}
1360
+
{#fig-advec-1D-disprel-C1-1 width="100%"}
1361
1361
1362
-
{#fig-advec-1D-disprel-C1-2 width="800px"}
1362
+
{#fig-advec-1D-disprel-C1-2 width="100%"}
1363
1363
1364
-
{#fig-advec-1D-disprel-C08-1 width="800px"}
1364
+
{#fig-advec-1D-disprel-C08-1 width="100%"}
1365
1365
1366
-
{#fig-advec-1D-disprel-C08-2 width="800px"}
1366
+
{#fig-advec-1D-disprel-C08-2 width="100%"}
1367
1367
1368
-
{#fig-advec-1D-disprel-C05-1 width="800px"}
1368
+
{#fig-advec-1D-disprel-C05-1 width="100%"}
1369
1369
1370
-
{#fig-advec-1D-disprel-C05-2 width="800px"}
1370
+
{#fig-advec-1D-disprel-C05-2 width="100%"}
1371
1371
1372
1372
The total damping after some time $T=n\Delta t$ is reflected by
1373
1373
$A_r(C,p)^n$. Since normally $A_r<1$, the damping goes like
@@ -1516,9 +1516,9 @@ and millions of cells are required to resolve the boundary layer.
1516
1516
Fortunately, this is not strictly necessary as we have methods in
1517
1517
the next section to overcome the problem!
1518
1518
1519
-
{#fig-advec-1D-stationary-fdm-fig1 width="800px"}
1519
+
{#fig-advec-1D-stationary-fdm-fig1 width="100%"}
1520
1520
1521
-
{#fig-advec-1D-stationary-fdm-fig2 width="800px"}
1521
+
{#fig-advec-1D-stationary-fdm-fig2 width="100%"}
1522
1522
1523
1523
:::{.callout-note title="Solver"}
1524
1524
A suitable solver for doing the experiments is presented below.
@@ -1598,9 +1598,9 @@ in Section @sec-advec-1D-stationary-fdm. The results appear in Figures
1598
1598
@fig-advec-1D-stationary-upwind-fig1 and
1599
1599
@fig-advec-1D-stationary-upwind-fig2: no more oscillations!
1600
1600
1601
-
{#fig-advec-1D-stationary-upwind-fig1 width="800px"}
1601
+
{#fig-advec-1D-stationary-upwind-fig1 width="100%"}
1602
1602
1603
-
{#fig-advec-1D-stationary-upwind-fig2 width="800px"}
1603
+
{#fig-advec-1D-stationary-upwind-fig2 width="100%"}
1604
1604
1605
1605
We see that the upwind scheme is always stable, but it gives a thicker
1606
1606
boundary layer when the centered scheme is also stable.
Copy file name to clipboardExpand all lines: chapters/diffu/diffu_analysis.qmd
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -130,7 +130,7 @@ oscillations do not have a visible amplitude, while we have to wait
130
130
until $t\sim 0.5$ before the amplitude of the long wave $\sin (\pi x)$
131
131
becomes very small.
132
132
133
-
{#fig-diffu-pde1-fig-damping width="800px"}
133
+
{#fig-diffu-pde1-fig-damping width="100%"}
134
134
135
135
## Analysis of discrete equations
136
136
A counterpart to (@eq-diffu-pde1-sol1) is the complex representation
@@ -475,11 +475,11 @@ damped by the various schemes compared to the exact damping. As long
475
475
as all schemes are stable, the amplification factor is positive,
476
476
except for Crank-Nicolson when $F>0.5$.
477
477
478
-
{#fig-diffu-pde1-fig-A-err-C20 width="800px"}
478
+
{#fig-diffu-pde1-fig-A-err-C20 width="100%"}
479
479
480
-
{#fig-diffu-pde1-fig-A-err-C05 width="800px"}
480
+
{#fig-diffu-pde1-fig-A-err-C05 width="100%"}
481
481
482
-
{#fig-diffu-pde1-fig-A-err-C01 width="800px"}
482
+
{#fig-diffu-pde1-fig-A-err-C01 width="100%"}
483
483
484
484
The effect of negative amplification factors is that $A^n$ changes
485
485
sign from one time level to the next, thereby giving rise to
@@ -215,7 +215,7 @@ at the origin and moves with $p=\half$. Since the seed is the same,
215
215
the plot to the left is just a magnification of the first 1,000 steps in
216
216
the plot to the right.
217
217
218
-
{#fig-diffu-randomwalk-1D-code1-fig1 width="800px"}
218
+
{#fig-diffu-randomwalk-1D-code1-fig1 width="100%"}
219
219
220
220
### Verification
221
221
@@ -790,11 +790,11 @@ arising from solving the diffusion equation
790
790
that one needs significantly more statistical samples to estimate a
791
791
histogram accurately than the expectation or variance.
792
792
793
-
{#fig-diffu-randomwalk-1D-fig-demo1-EX width="800px"}
793
+
{#fig-diffu-randomwalk-1D-fig-demo1-EX width="100%"}
794
794
795
-
{#fig-diffu-randomwalk-1D-fig-demo1-VarX width="800px"}
795
+
{#fig-diffu-randomwalk-1D-fig-demo1-VarX width="100%"}
796
796
797
-
{#fig-diffu-randomwalk-1D-fig-demo1-HistX width="800px"}
797
+
{#fig-diffu-randomwalk-1D-fig-demo1-HistX width="100%"}
798
798
799
799
## Empty figure cache
800
800
\clearpage
@@ -882,7 +882,7 @@ as a walk on a *rectangular mesh* as we move from any spatial
882
882
mesh point $(i,j)$ to one of its four neighbors in the rectangular directions:
883
883
$(i+1,j)$, $(i-1,j)$, $(i,j+1)$, or $(i,j-1)$.
884
884
885
-
{#fig-diffu-randomwalk-2D-fig-rect-vs-diag width="800px"}
885
+
{#fig-diffu-randomwalk-2D-fig-rect-vs-diag width="100%"}
886
886
887
887
## Random walk in any number of space dimensions
888
888
From a programming point of view, especially when implementing a random
@@ -1926,7 +1926,7 @@ def random_walkdD_vec(x0, N, p):
1926
1926
return position
1927
1927
```
1928
1928
1929
-
{#fig-diffu-randomwalk-2D-fig-samples width="800px"}
1929
+
{#fig-diffu-randomwalk-2D-fig-samples width="100%"}
1930
1930
1931
1931
## Multiple random walks in any number of space dimensions
1932
1932
As we did in 1D, we extend one single walk to a number of walks (`num_walks`
Copy file name to clipboardExpand all lines: chapters/nonlin/nonlin_ode.qmd
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -715,9 +715,9 @@ value for $\omega$ in this case is 0.5, which results in an average of only
715
715
$\Delta t = 1$: Picard iteration does not convergence in 1000 iterations,
716
716
but $\omega=0.5$ again brings the average number of iterations down to 2.
717
717
718
-
{#fig-nonlin-timediscrete-logistic-impl-fig-u width="800px"}
718
+
{#fig-nonlin-timediscrete-logistic-impl-fig-u width="100%"}
719
719
720
-
{#fig-nonlin-timediscrete-logistic-impl-fig-iter width="800px"}
720
+
{#fig-nonlin-timediscrete-logistic-impl-fig-iter width="100%"}
721
721
722
722
__Remark.__
723
723
The simple Crank-Nicolson method with a geometric mean for the quadratic
0 commit comments