Skip to content

Commit 3189efd

Browse files
committed
Change figure width from 800px to 100% for PDF compatibility
1 parent 2bc9ec9 commit 3189efd

12 files changed

Lines changed: 56 additions & 56 deletions

chapters/advec/advec.qmd

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -822,9 +822,9 @@ one with a discontinuity in the first derivative (Figure
822822
the left plots in the figures, we get small ripples behind the main
823823
wave, and this main wave has the amplitude reduced.
824824
825-
![Advection of a Gaussian function with a leapfrog scheme and $C=0.8$, $\Delta t = 0.001$ (left) and $\Delta t=0.01$ (right).](fig/gaussian_LF_C08){#fig-advec-1D-LF-fig1-C08 width="800px"}
825+
![Advection of a Gaussian function with a leapfrog scheme and $C=0.8$, $\Delta t = 0.001$ (left) and $\Delta t=0.01$ (right).](fig/gaussian_LF_C08){#fig-advec-1D-LF-fig1-C08 width="100%"}
826826
827-
![Advection of half a cosine function with a leapfrog scheme and $C=0.8$, $\Delta t = 0.001$ (left) and $\Delta t=0.01$ (right).](fig/cosinehat_LF_C08){#fig-advec-1D-LF-fig2-C08 width="800px"}
827+
![Advection of half a cosine function with a leapfrog scheme and $C=0.8$, $\Delta t = 0.001$ (left) and $\Delta t=0.01$ (right).](fig/cosinehat_LF_C08){#fig-advec-1D-LF-fig2-C08 width="100%"}
828828
829829
### Analysis
830830
@@ -901,9 +901,9 @@ Experiments show, however, that
901901
reducing $\Delta t$ or $\Delta x$, while keeping $C$ reduces the
902902
error.
903903
904-
![Advection of a Gaussian function with a forward in time, upwind in space scheme and $C=0.8$, $\Delta t = 0.01$ (left) and $\Delta t=0.001$ (right).](fig/gaussian_UP_C08){#fig-advec-1D-UP-fig1-C08 width="800px"}
904+
![Advection of a Gaussian function with a forward in time, upwind in space scheme and $C=0.8$, $\Delta t = 0.01$ (left) and $\Delta t=0.001$ (right).](fig/gaussian_UP_C08){#fig-advec-1D-UP-fig1-C08 width="100%"}
905905
906-
![Advection of half a cosine function with a forward in time, upwind in space scheme and $C=0.8$, $\Delta t = 0.001$ (left) and $\Delta t=0.01$ (right).](fig/cosinehat_UP_08){#fig-advec-1D-UP-fig2-C08 width="800px"}
906+
![Advection of half a cosine function with a forward in time, upwind in space scheme and $C=0.8$, $\Delta t = 0.001$ (left) and $\Delta t=0.01$ (right).](fig/cosinehat_UP_08){#fig-advec-1D-UP-fig2-C08 width="100%"}
907907
908908
The amplification factor can be computed using the
909909
formula (@eq-form-exp-fd1-bw),
@@ -1219,9 +1219,9 @@ $$
12191219
A = \frac{1 - (1-\theta) i C\sin p}{1 + \theta i C\sin p}\tp
12201220
$$
12211221
1222-
![Crank-Nicolson in time, centered in space, Gaussian profile, $C=0.8$, $\Delta t = 0.01$ (left) and $\Delta t=0.005$ (right).](fig/gaussian_CN_C08){#fig-advec-1D-CN-fig-C08 width="800px"}
1222+
![Crank-Nicolson in time, centered in space, Gaussian profile, $C=0.8$, $\Delta t = 0.01$ (left) and $\Delta t=0.005$ (right).](fig/gaussian_CN_C08){#fig-advec-1D-CN-fig-C08 width="100%"}
12231223
1224-
![Backward-Euler in time, centered in space, half a cosine profile, $C=0.8$, $\Delta t = 0.01$ (left) and $\Delta t=0.005$ (right).](fig/cosinehat_BE_C08){#fig-advec-1D-BE-fig-C08 width="800px"}
1224+
![Backward-Euler in time, centered in space, half a cosine profile, $C=0.8$, $\Delta t = 0.01$ (left) and $\Delta t=0.005$ (right).](fig/cosinehat_BE_C08){#fig-advec-1D-BE-fig-C08 width="100%"}
12251225
12261226
Figure @fig-advec-1D-CN-fig-C08 depicts a numerical solution for $C=0.8$
12271227
and the Crank-Nicolson
@@ -1357,17 +1357,17 @@ The curves are labeled according to the table below.
13571357
| LW | Lax-Wendroff's method |
13581358
| BE | Backward Euler in time, centered difference in space |
13591359
1360-
![Dispersion relations for $C=1$.](fig/disprel_C1_LW_UP_LF){#fig-advec-1D-disprel-C1-1 width="800px"}
1360+
![Dispersion relations for $C=1$.](fig/disprel_C1_LW_UP_LF){#fig-advec-1D-disprel-C1-1 width="100%"}
13611361
1362-
![Dispersion relations for $C=1$.](fig/disprel_C1_CN_BE_FE){#fig-advec-1D-disprel-C1-2 width="800px"}
1362+
![Dispersion relations for $C=1$.](fig/disprel_C1_CN_BE_FE){#fig-advec-1D-disprel-C1-2 width="100%"}
13631363
1364-
![Dispersion relations for $C=0.8$.](fig/disprel_C0_8_LW_UP_LF){#fig-advec-1D-disprel-C08-1 width="800px"}
1364+
![Dispersion relations for $C=0.8$.](fig/disprel_C0_8_LW_UP_LF){#fig-advec-1D-disprel-C08-1 width="100%"}
13651365
1366-
![Dispersion relations for $C=0.8$.](fig/disprel_C0_8_CN_BE_FE){#fig-advec-1D-disprel-C08-2 width="800px"}
1366+
![Dispersion relations for $C=0.8$.](fig/disprel_C0_8_CN_BE_FE){#fig-advec-1D-disprel-C08-2 width="100%"}
13671367
1368-
![Dispersion relations for $C=0.5$.](fig/disprel_C0_5_LW_UP_LF){#fig-advec-1D-disprel-C05-1 width="800px"}
1368+
![Dispersion relations for $C=0.5$.](fig/disprel_C0_5_LW_UP_LF){#fig-advec-1D-disprel-C05-1 width="100%"}
13691369
1370-
![Dispersion relations for $C=0.5$.](fig/disprel_C0_5_CN_BE_FE){#fig-advec-1D-disprel-C05-2 width="800px"}
1370+
![Dispersion relations for $C=0.5$.](fig/disprel_C0_5_CN_BE_FE){#fig-advec-1D-disprel-C05-2 width="100%"}
13711371
13721372
The total damping after some time $T=n\Delta t$ is reflected by
13731373
$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.
15161516
Fortunately, this is not strictly necessary as we have methods in
15171517
the next section to overcome the problem!
15181518
1519-
![Comparison of exact and numerical solution for $\epsilon =0.1$ and $N_x=20,40$ with centered differences.](fig/twopt_BVP_cen_01){#fig-advec-1D-stationary-fdm-fig1 width="800px"}
1519+
![Comparison of exact and numerical solution for $\epsilon =0.1$ and $N_x=20,40$ with centered differences.](fig/twopt_BVP_cen_01){#fig-advec-1D-stationary-fdm-fig1 width="100%"}
15201520
1521-
![Comparison of exact and numerical solution for $\epsilon =0.01$ and $N_x=20,40$ with centered differences.](fig/twopt_BVP_cen_001){#fig-advec-1D-stationary-fdm-fig2 width="800px"}
1521+
![Comparison of exact and numerical solution for $\epsilon =0.01$ and $N_x=20,40$ with centered differences.](fig/twopt_BVP_cen_001){#fig-advec-1D-stationary-fdm-fig2 width="100%"}
15221522
15231523
:::{.callout-note title="Solver"}
15241524
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
15981598
@fig-advec-1D-stationary-upwind-fig1 and
15991599
@fig-advec-1D-stationary-upwind-fig2: no more oscillations!
16001600
1601-
![Comparison of exact and numerical solution for $\epsilon =0.1$ and $N_x=20,40$ with upwind difference.](fig/twopt_BVP_upw_01){#fig-advec-1D-stationary-upwind-fig1 width="800px"}
1601+
![Comparison of exact and numerical solution for $\epsilon =0.1$ and $N_x=20,40$ with upwind difference.](fig/twopt_BVP_upw_01){#fig-advec-1D-stationary-upwind-fig1 width="100%"}
16021602
1603-
![Comparison of exact and numerical solution for $\epsilon =0.01$ and $N_x=20,40$ with upwind difference.](fig/twopt_BVP_upw_001){#fig-advec-1D-stationary-upwind-fig2 width="800px"}
1603+
![Comparison of exact and numerical solution for $\epsilon =0.01$ and $N_x=20,40$ with upwind difference.](fig/twopt_BVP_upw_001){#fig-advec-1D-stationary-upwind-fig2 width="100%"}
16041604
16051605
We see that the upwind scheme is always stable, but it gives a thicker
16061606
boundary layer when the centered scheme is also stable.

chapters/diffu/diffu_analysis.qmd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ oscillations do not have a visible amplitude, while we have to wait
130130
until $t\sim 0.5$ before the amplitude of the long wave $\sin (\pi x)$
131131
becomes very small.
132132
133-
![Evolution of the solution of a diffusion problem: initial condition (upper left), 1/100 reduction of the small waves (upper right), 1/10 reduction of the long wave (lower left), and 1/100 reduction of the long wave (lower right).](fig/diffusion_damping){#fig-diffu-pde1-fig-damping width="800px"}
133+
![Evolution of the solution of a diffusion problem: initial condition (upper left), 1/100 reduction of the small waves (upper right), 1/10 reduction of the long wave (lower left), and 1/100 reduction of the long wave (lower right).](fig/diffusion_damping){#fig-diffu-pde1-fig-damping width="100%"}
134134
135135
## Analysis of discrete equations
136136
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
475475
as all schemes are stable, the amplification factor is positive,
476476
except for Crank-Nicolson when $F>0.5$.
477477
478-
![Amplification factors for large time steps.](fig/diffusion_A_F20_F2){#fig-diffu-pde1-fig-A-err-C20 width="800px"}
478+
![Amplification factors for large time steps.](fig/diffusion_A_F20_F2){#fig-diffu-pde1-fig-A-err-C20 width="100%"}
479479
480-
![Amplification factors for time steps around the Forward Euler stability limit.](fig/diffusion_A_F05_F025){#fig-diffu-pde1-fig-A-err-C05 width="800px"}
480+
![Amplification factors for time steps around the Forward Euler stability limit.](fig/diffusion_A_F05_F025){#fig-diffu-pde1-fig-A-err-C05 width="100%"}
481481
482-
![Amplification factors for small time steps.](fig/diffusion_A_F01_F001){#fig-diffu-pde1-fig-A-err-C01 width="800px"}
482+
![Amplification factors for small time steps.](fig/diffusion_A_F01_F001){#fig-diffu-pde1-fig-A-err-C01 width="100%"}
483483
484484
The effect of negative amplification factors is that $A^n$ changes
485485
sign from one time level to the next, thereby giving rise to

chapters/diffu/diffu_exer.qmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,9 +697,9 @@ time steps.
697697
698698
Running the `investigate` function, we get the following plots:
699699
700-
![FIGURE: [fig-diffu/welding_gamma0_2, width=800 frac=1]](fig/welding_gamma0_025){width="800px"}
700+
![FIGURE: [fig-diffu/welding_gamma0_2, width=800 frac=1]](fig/welding_gamma0_025){width="100%"}
701701
702-
![FIGURE: [fig-diffu/welding_gamma5, width=800 frac=1]](fig/welding_gamma1){width="800px"}
702+
![FIGURE: [fig-diffu/welding_gamma5, width=800 frac=1]](fig/welding_gamma1){width="100%"}
703703
704704
![For $\gamma\ll 1$ as in $\gamma = 0.025$, the heat source moves very
705705
slowly on the diffusion time scale and has hardly entered the medium,
@@ -709,7 +709,7 @@ each of the scalings work, but with the diffusion time scale, the heat
709709
source has not moved much into the domain. For $\gamma=1$, the
710710
mathematical problems are identical and hence the plots too. For
711711
$\gamma=5$, the time scale based on the source is clearly the best
712-
choice, and for $\gamma=40$, only this scale is appropriate.](fig/welding_gamma40){width="800px"}
712+
choice, and for $\gamma=40$, only this scale is appropriate.](fig/welding_gamma40){width="100%"}
713713
714714
A conclusion is that the scaling in b) works well for a range of $\gamma$
715715
values, also in the case $\gamma\ll 1$.

chapters/diffu/diffu_fd1.qmd

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,18 +1124,18 @@ Increasing $F$ slightly beyond the limit 0.5, to $F=0.51$,
11241124
gives growing, non-physical instabilities,
11251125
as seen in Figure @fig-diffu-pde1-FE-fig-F-051.
11261126
1127-
![Forward Euler scheme for $F=0.5$.](fig/plug_FE_F05){#fig-diffu-pde1-FE-fig-F-05 width="800px"}
1127+
![Forward Euler scheme for $F=0.5$.](fig/plug_FE_F05){#fig-diffu-pde1-FE-fig-F-05 width="100%"}
11281128
1129-
![Forward Euler scheme for $F=0.25$.](fig/plug_FE_F025){#fig-diffu-pde1-FE-fig-F-025 width="800px"}
1129+
![Forward Euler scheme for $F=0.25$.](fig/plug_FE_F025){#fig-diffu-pde1-FE-fig-F-025 width="100%"}
11301130
1131-
![Forward Euler scheme for $F=0.51$.](fig/plug_FE_F051){#fig-diffu-pde1-FE-fig-F-051 width="800px"}
1131+
![Forward Euler scheme for $F=0.51$.](fig/plug_FE_F051){#fig-diffu-pde1-FE-fig-F-051 width="100%"}
11321132
11331133
Instead of a discontinuous initial condition we now try the smooth
11341134
Gaussian function for $I(x)$. A simulation for $F=0.5$
11351135
is shown in Figure @fig-diffu-pde1-FE-fig-gauss-F-05. Now the numerical solution
11361136
is smooth for all times, and this is true for any $F\leq 0.5$.
11371137
1138-
![Forward Euler scheme for $F=0.5$.](fig/gaussian_FE_F05){#fig-diffu-pde1-FE-fig-gauss-F-05 width="800px"}
1138+
![Forward Euler scheme for $F=0.5$.](fig/gaussian_FE_F05){#fig-diffu-pde1-FE-fig-gauss-F-05 width="100%"}
11391139
11401140
Experiments with these two choices of $I(x)$ reveal some
11411141
important observations:
@@ -1575,7 +1575,7 @@ with sawtooth-like noise when starting with a discontinuous initial
15751575
condition. We can also verify that we can have $F>\half$,
15761576
which allows larger time steps than in the Forward Euler method.
15771577
1578-
![Backward Euler scheme for $F=0.5$.](fig/plug_BE_F05){#fig-diffu-pde1-BE-fig-F-05 width="800px"}
1578+
![Backward Euler scheme for $F=0.5$.](fig/plug_BE_F05){#fig-diffu-pde1-BE-fig-F-05 width="100%"}
15791579
15801580
The Backward Euler scheme always produces smooth solutions for any $F$.
15811581
Figure @fig-diffu-pde1-BE-fig-F-05 shows one example.
@@ -1592,9 +1592,9 @@ increases. Figures @fig-diffu-pde1-CN-fig-F-3 and @fig-diffu-pde1-CN-fig-F-10
15921592
demonstrate the effect for $F=3$ and $F=10$, respectively.
15931593
Section @sec-diffu-pde1-analysis explains why such noise occur.
15941594
1595-
![Crank-Nicolson scheme for $F=3$.](fig/plug_CN_F3){#fig-diffu-pde1-CN-fig-F-3 width="800px"}
1595+
![Crank-Nicolson scheme for $F=3$.](fig/plug_CN_F3){#fig-diffu-pde1-CN-fig-F-3 width="100%"}
15961596
1597-
![Crank-Nicolson scheme for $F=10$.](fig/plug_CN_F10){#fig-diffu-pde1-CN-fig-F-10 width="800px"}
1597+
![Crank-Nicolson scheme for $F=10$.](fig/plug_CN_F10){#fig-diffu-pde1-CN-fig-F-10 width="100%"}
15981598
15991599
## The Laplace and Poisson equation
16001600

chapters/diffu/diffu_rw.qmd

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ We introduce the symbol $N$ for the number of steps in a random walk.
4949
Figure @fig-diffu-randomwalk-1D-fig-ensemble shows four different
5050
random walks with $N=200$.
5151

52-
![Ensemble of 4 random walks, each with 200 steps.](fig/rw1D_ensemble4){#fig-diffu-randomwalk-1D-fig-ensemble width="800px"}
52+
![Ensemble of 4 random walks, each with 200 steps.](fig/rw1D_ensemble4){#fig-diffu-randomwalk-1D-fig-ensemble width="100%"}
5353

5454
## Statistical considerations {#sec-diffu-randomwalk-1D-EVar}
5555

@@ -215,7 +215,7 @@ at the origin and moves with $p=\half$. Since the seed is the same,
215215
the plot to the left is just a magnification of the first 1,000 steps in
216216
the plot to the right.
217217

218-
![1,000 (left) and 50,000 (right) steps of a random walk.](fig/rw1D_1sample){#fig-diffu-randomwalk-1D-code1-fig1 width="800px"}
218+
![1,000 (left) and 50,000 (right) steps of a random walk.](fig/rw1D_1sample){#fig-diffu-randomwalk-1D-code1-fig1 width="100%"}
219219

220220
### Verification
221221

@@ -790,11 +790,11 @@ arising from solving the diffusion equation
790790
that one needs significantly more statistical samples to estimate a
791791
histogram accurately than the expectation or variance.
792792
793-
![Estimated expected value for 1000 steps, using 100 walks (upper left), 10,000 (upper right), 100,000 (lower left), and 1,000,000 (lower right).](fig/rw1D_EX_100_10000_100000_1000000){#fig-diffu-randomwalk-1D-fig-demo1-EX width="800px"}
793+
![Estimated expected value for 1000 steps, using 100 walks (upper left), 10,000 (upper right), 100,000 (lower left), and 1,000,000 (lower right).](fig/rw1D_EX_100_10000_100000_1000000){#fig-diffu-randomwalk-1D-fig-demo1-EX width="100%"}
794794
795-
![Estimated variance over 1000 steps, using 100 walks (upper left), 10,000 (upper right), 100,000 (lower left), and 1,000,000 (lower right).](fig/rw1D_VarX_100_10000_100000_1000000){#fig-diffu-randomwalk-1D-fig-demo1-VarX width="800px"}
795+
![Estimated variance over 1000 steps, using 100 walks (upper left), 10,000 (upper right), 100,000 (lower left), and 1,000,000 (lower right).](fig/rw1D_VarX_100_10000_100000_1000000){#fig-diffu-randomwalk-1D-fig-demo1-VarX width="100%"}
796796
797-
![Estimated probability distribution at step 800, using 100 walks (upper left), 10,000 (upper right), 100,000 (lower left), and 1,000,000 (lower right).](fig/rw1D_HistX_100_10000_100000_1000000){#fig-diffu-randomwalk-1D-fig-demo1-HistX width="800px"}
797+
![Estimated probability distribution at step 800, using 100 walks (upper left), 10,000 (upper right), 100,000 (lower left), and 1,000,000 (lower right).](fig/rw1D_HistX_100_10000_100000_1000000){#fig-diffu-randomwalk-1D-fig-demo1-HistX width="100%"}
798798
799799
## Empty figure cache
800800
\clearpage
@@ -882,7 +882,7 @@ as a walk on a *rectangular mesh* as we move from any spatial
882882
mesh point $(i,j)$ to one of its four neighbors in the rectangular directions:
883883
$(i+1,j)$, $(i-1,j)$, $(i,j+1)$, or $(i,j-1)$.
884884
885-
![Random walks in 2D with 200 steps: rectangular mesh (left) and diagonal mesh (right).](fig/rw2D_sample200){#fig-diffu-randomwalk-2D-fig-rect-vs-diag width="800px"}
885+
![Random walks in 2D with 200 steps: rectangular mesh (left) and diagonal mesh (right).](fig/rw2D_sample200){#fig-diffu-randomwalk-2D-fig-rect-vs-diag width="100%"}
886886
887887
## Random walk in any number of space dimensions
888888
From a programming point of view, especially when implementing a random
@@ -1926,7 +1926,7 @@ def random_walkdD_vec(x0, N, p):
19261926
return position
19271927
```
19281928
1929-
![Four random walks with 5000 steps in 2D.](fig/rw2D_samples_5000){#fig-diffu-randomwalk-2D-fig-samples width="800px"}
1929+
![Four random walks with 5000 steps in 2D.](fig/rw2D_samples_5000){#fig-diffu-randomwalk-2D-fig-samples width="100%"}
19301930
19311931
## Multiple random walks in any number of space dimensions
19321932
As we did in 1D, we extend one single walk to a number of walks (`num_walks`

chapters/nonlin/nonlin_ode.qmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,9 +715,9 @@ value for $\omega$ in this case is 0.5, which results in an average of only
715715
$\Delta t = 1$: Picard iteration does not convergence in 1000 iterations,
716716
but $\omega=0.5$ again brings the average number of iterations down to 2.
717717
718-
![Impact of solution strategy and time step length on the solution.](fig/logistic_u){#fig-nonlin-timediscrete-logistic-impl-fig-u width="800px"}
718+
![Impact of solution strategy and time step length on the solution.](fig/logistic_u){#fig-nonlin-timediscrete-logistic-impl-fig-u width="100%"}
719719
720-
![Comparison of the number of iterations at various time levels for Picard and Newton iteration.](fig/logistic_iter){#fig-nonlin-timediscrete-logistic-impl-fig-iter width="800px"}
720+
![Comparison of the number of iterations at various time levels for Picard and Newton iteration.](fig/logistic_iter){#fig-nonlin-timediscrete-logistic-impl-fig-iter width="100%"}
721721
722722
__Remark.__
723723
The simple Crank-Nicolson method with a geometric mean for the quadratic

chapters/nonlin/nonlin_split.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ But in very simple problems, like the logistic ODE, splitting is just an
228228
inferior technique. Still, the logistic ODE is ideal for introducing all
229229
the mathematical details and for investigating the behavior.
230230
231-
![Effect of ordinary and Strange splitting for the logistic equation.](fig/split_logistic){#fig-nonlin-splitting-ODE-logistic-fig width="800px"}
231+
![Effect of ordinary and Strange splitting for the logistic equation.](fig/split_logistic){#fig-nonlin-splitting-ODE-logistic-fig width="100%"}
232232
233233
## Reaction-diffusion equation {#sec-nonlin-splitting-RD}
234234

0 commit comments

Comments
 (0)