From f5db0b5613588eee61e2f788821aca93b9e7a4ac Mon Sep 17 00:00:00 2001 From: Raphael Kruse <65403623+rk-mlu@users.noreply.github.com> Date: Sun, 2 Mar 2025 23:14:22 +0100 Subject: [PATCH 1/2] Typo in class ForwardEuler_v0 --- book_src/chapters/chapter1.do.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book_src/chapters/chapter1.do.txt b/book_src/chapters/chapter1.do.txt index 3729df8..cf6d610 100644 --- a/book_src/chapters/chapter1.do.txt +++ b/book_src/chapters/chapter1.do.txt @@ -309,7 +309,7 @@ class ForwardEuler_v0: """Compute solution for t_span[0] <= t <= t_span[1], using N steps.""" t0, T = t_span - self.dt = T / N + self.dt = (T - t0) / N self.t = np.zeros(N + 1) # N steps ~ N+1 time points self.u = np.zeros(N + 1) From 86fd2ddcfbc059fc84faecec9a7509327e547a43 Mon Sep 17 00:00:00 2001 From: Raphael Kruse <65403623+rk-mlu@users.noreply.github.com> Date: Mon, 3 Mar 2025 10:29:47 +0100 Subject: [PATCH 2/2] Fixes a sign error in Section 1.3 --- book_src/chapters/chapter1.do.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book_src/chapters/chapter1.do.txt b/book_src/chapters/chapter1.do.txt index cf6d610..c97f98a 100644 --- a/book_src/chapters/chapter1.do.txt +++ b/book_src/chapters/chapter1.do.txt @@ -394,8 +394,8 @@ by systems of ODEs, i.e., multiple ODEs where the right-hand side of one equatio systems are also referred to as vector ODEs. One simple example is !bt \begin{alignat*}{2} -u' &= v, \quad &&u(0) = 1\\ -v' &= -u, \quad &&v(0) = 0. +u' &= -v, \quad &&u(0) = 1\\ +v' &= u, \quad &&v(0) = 0. \end{alignat*} !et The solution of this system is $u=\cos t, v=\sin t$, which can easily be verified by inserting the solution into the equations