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: julia/chapter6.md
+7
Original file line number
Diff line number
Diff line change
@@ -109,6 +109,7 @@ using FundamentalsNumericalComputation
109
109
FNC.init_format()
110
110
```
111
111
112
+
### Section 6.1
112
113
(demo-basics-first-julia)=
113
114
``````{dropdown} Solving an IVP
114
115
The `DifferentialEquations` package offers solvers for IVPs. Let's use it to define and solve an initial-value problem for $u'=\sin[(u+t)^2]$ over $t \in [0,4]$, such that $u(0)=-1$.
@@ -208,6 +209,7 @@ plot(t, u, l=:black, ribbon=(lower, upper),
208
209
In this case the actual condition number is one, because the initial difference between solutions is the largest over all time. Hence the exponentially growing bound $e^{b-a}$ is a gross overestimate.
209
210
``````
210
211
212
+
### Section 6.2
211
213
(demo-euler-converge-julia)=
212
214
``````{dropdown} Convergence of Euler's method
213
215
We consider the IVP $u'=\sin[(u+t)^2]$ over $0\le t \le 4$, with $u(0)=-1$.
We study the convergence of AB4 using the IVP $u'=\sin[(u+t)^2]$ over $0\le t \le 4$, with $u(0)=-1$. As usual, `solve` is called to give an accurate reference solution.
@@ -581,6 +587,7 @@ plt
581
587
So AB4, which is supposed to be _more_ accurate than AM2, actually needs something like 8 times as many steps to get a reasonable-looking answer!
Copy file name to clipboardexpand all lines: python/chapter6.md
+6
Original file line number
Diff line number
Diff line change
@@ -225,6 +225,7 @@ title("Exponential convergence of solutions")
225
225
In this case the actual condition number is one, because the initial difference between solutions is the largest over all time. Hence, the exponentially growing upper bound $e^{b-a}$ is a gross overestimate.
226
226
``````
227
227
228
+
### Section 6.2
228
229
(demo-euler-converge-python)=
229
230
``````{dropdown} Convergence of Euler's method
230
231
We consider the IVP $u'=\sin[(u+t)^2]$ over $0\le t \le 4$, with $u(0)=-1$.
@@ -285,6 +286,7 @@ legend()
285
286
```
286
287
``````
287
288
289
+
### Section 6.3
288
290
(demo-systems-predator-python)=
289
291
``````{dropdown} Predator-prey model
290
292
We encode the predator–prey equations via a function.
@@ -390,6 +392,7 @@ title("Coupled pendulums");
390
392
The coupling makes the pendulums swap energy back and forth.
391
393
``````
392
394
395
+
### Section 6.4
393
396
(demo-rk-converge-python)=
394
397
``````{dropdown} Convergence of Runge–Kutta methods
395
398
We solve the IVP $u'=\sin[(u+t)^2]$ over $0\le t \le 4$, with $u(0)=-1$. We start by getting a reference solution to validate against.
@@ -435,6 +438,7 @@ title("Convergence of RK methods");
435
438
The fourth-order variant is more efficient in this problem over a wide range of accuracy.
436
439
``````
437
440
441
+
### Section 6.5
438
442
(demo-adapt-basic-python)=
439
443
``````{dropdown} Adaptive step size
440
444
Let's run adaptive RK on $u'=e^{t-u\sin u}$.
@@ -496,6 +500,7 @@ legend();
496
500
```
497
501
``````
498
502
503
+
### Section 6.6
499
504
(demo-implicit-ab4-python)=
500
505
``````{dropdown} Convergence of Adams–Bashforth
501
506
We study the convergence of AB4 using the IVP $u'=\sin[(u+t)^2]$ over $0\le t \le 4$, with $u(0)=-1$. As usual, `solve_ivp` is called to give an accurate reference solution.
@@ -582,6 +587,7 @@ legend()
582
587
So AB4, which is supposed to be _more_ accurate than AM2, actually needs something like 8 times as many steps to get a reasonable-looking answer!
0 commit comments