Numerical Analysis HW #10
Use the Modified Euler method to approximate the solution to the initial -value problem
d y d t = 1 + t 1 + y 1 ≤ t ≤ 2 y ( 1 ) = 2
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\dd y t = \frac{ 1 + t }{ 1 + y } \qquad 1 \leq t \leq 2 \qquad y(1) = 2 d t d y = 1 + y 1 + t 1 ≤ t ≤ 2 y ( 1 ) = 2
with h = 1 / 2
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
h = 1/2 h = 1/2 and compare the result to the actual solution y ( t ) = t 2 + 2 t + 6 − 1
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
y(t) = \sqrt{t^2 + 2t + 6} - 1 y ( t ) = t 2 + 2 t + 6 − 1 .
Have f ( t , y ) = 1 + t 1 + y
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
f(t,y) = \frac{1 + t}{1 + y} f ( t , y ) = 1 + y 1 + t .
w 0 = 2 w 1 = w 0 + h 2 [ f ( t 0 , w 0 ) + f ( t 1 , w 0 + h f ( t 0 , w 0 ) ) ] = 2 + 1 4 [ f ( 1 , 2 ) + f ( 1.5 , 2 + 1 2 f ( 1 , 2 ) ) ] ≈ 2.354166 w 2 = w 1 + 1 4 [ f ( t 1 , w 1 ) + f ( t 2 , w 1 + 1 2 f ( t 1 , w 1 ) ) ] ≈ 2.741745
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\begin{align*} w_0 &= 2
\\ w_1 &= w_0 + \frac h 2 \tbrak{ f(t_0, w_0) + f(t_1, w_0 + h f(t_0, w_0)) }
\\ &= 2 + \frac 1 4 \tbrak{ f(1, 2) + f(1.5, 2 + \frac 1 2 f(1, 2)) }
\\ &\approx 2.354166
\\ w_2 &= w_1 + \frac 1 4 \tbrak{ f(t_1, w_1) + f(t_2, w_1 + \frac 1 2 f(t_1, w_1)) }
\\ &\approx 2.741745
\end{align*} w 0 w 1 w 2 = 2 = w 0 + 2 h [ f ( t 0 , w 0 ) + f ( t 1 , w 0 + h f ( t 0 , w 0 )) ] = 2 + 4 1 [ f ( 1 , 2 ) + f ( 1.5 , 2 + 2 1 f ( 1 , 2 )) ] ≈ 2.354166 = w 1 + 4 1 [ f ( t 1 , w 1 ) + f ( t 2 , w 1 + 2 1 f ( t 1 , w 1 )) ] ≈ 2.741745
Errors are:
∣ w 1 − y ( 1.5 ) ∣ ≈ 6.47 × 1 0 − 05 ∣ w 2 − y ( 2 ) ∣ ≈ 8.76 × 1 0 − 05
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\begin{align*} \mag{ w_1 - y(1.5) } &\approx 6.47 \times 10^{-05}
\\ \mag{ w_2 - y(2) } &\approx 8.76 \times 10^{-05}
\end{align*} ∣ w 1 − y ( 1.5 ) ∣ ∣ w 2 − y ( 2 ) ∣ ≈ 6.47 × 1 0 − 05 ≈ 8.76 × 1 0 − 05
Show that the difference method
w 0 = α w i + 1 = w i + a 1 f ( t i , w i ) + a 2 f ( t i + α 2 , w i + δ 2 f ( t i , w i ) )
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\begin{align*} w_0 &= \alpha
\\ w_{i+1} &= w_i + a_1 f(t_i, w_i) + a_2 f(t_i + \alpha_2, w_i + \delta_2 f(t_i, w_i))
\end{align*} w 0 w i + 1 = α = w i + a 1 f ( t i , w i ) + a 2 f ( t i + α 2 , w i + δ 2 f ( t i , w i ))
cannot have local truncation error O ( h 3 )
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
O(h^3) O ( h 3 ) for any choice of constants a 1 , a 2 , α 2 , δ 2
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
a_1, a_2, \alpha_2, \delta_2 a 1 , a 2 , α 2 , δ 2
This follows from the remark under eq (5.21) that using eq (5.12) as a step formula cannot produce better than O ( h 2 )
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
O(h^2) O ( h 2 ) local truncation error.
-
Use the Runge-Kutta-Fehlberg method with tolerances TOL = 10 − 6
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\text{TOL} = {10}^{-6} TOL = 10 − 6 , hmax = 0.5
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\text{hmax} = 0.5 hmax = 0.5 , and hmin = 0.05
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\text{hmin} = 0.{05} hmin = 0. 05 to approximate the solution to
d y d t = y 2 1 + t 1 ≤ t ≤ 4 y ( 1 ) = − ( ln 2 ) − 1
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\dd y t = \frac{ y^2 }{ 1 + t } \qquad 1 \leq t \leq 4 \qquad y(1) = -(\ln 2)^{-1} d t d y = 1 + t y 2 1 ≤ t ≤ 4 y ( 1 ) = − ( ln 2 ) − 1
Compare the result to the actual solution y ( t ) = − ( ln ( t + 1 ) ) − 1
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
y(t) = -(\ln (t+1))^{-1} y ( t ) = − ( ln ( t + 1 ) ) − 1 .
Approximations, actual values, and errors (all with numbers rounded) are as follows:
y ( 1.000 ) ≈ − 1 . 4426950409 y ( 1.000 ) = − 1 . 4426950409 err = 0.0000000000 y ( 1.152 ) ≈ − 1 . 3046976279 y ( 1.152 ) = − 1 . 3046976215 err = 0.0000000065 y ( 1.293 ) ≈ − 1 . 2049559247 y ( 1.293 ) = − 1 . 2049559226 err = 0.0000000021 y ( 1.474 ) ≈ − 1 . 1037400512 y ( 1.474 ) = − 1 . 1037400380 err = 0.0000000132 y ( 1.712 ) ≈ − 1 . 0021603567 y ( 1.712 ) = − 1 . 0021602956 err = 0.0000000611 y ( 2.054 ) ≈ − 0 . 8956377645 y ( 2.054 ) = − 0 . 8956374989 err = 0.0000002657 y ( 2.554 ) ≈ − 0 . 7885606277 y ( 2.554 ) = − 0 . 7885597697 err = 0.0000008580 y ( 3.054 ) ≈ − 0 . 7144103042 y ( 3.054 ) = − 0 . 7144094649 err = 0.0000008393 y ( 3.554 ) ≈ − 0 . 6596080673 y ( 3.554 ) = − 0 . 6596073105 err = 0.0000007568 y ( 4.000 ) ≈ − 0 . 6213356148 y ( 4.000 ) = − 0 . 6213349346 err = 0.0000006803
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\begin{align*} y(1.{000}) \approx {-1}.{4426950409} &&\quad y(1.{000}) = {-1}.{4426950409} &&\quad \text{err} = 0.{0000000000}
\\ y(1.{152}) \approx {-1}.{3046976279} &&\quad y(1.{152}) = {-1}.{3046976215} &&\quad \text{err} = 0.{0000000065}
\\ y(1.{293}) \approx {-1}.{2049559247} &&\quad y(1.{293}) = {-1}.{2049559226} &&\quad \text{err} = 0.{0000000021}
\\ y(1.{474}) \approx {-1}.{1037400512} &&\quad y(1.{474}) = {-1}.{1037400380} &&\quad \text{err} = 0.{0000000132}
\\ y(1.{712}) \approx {-1}.{0021603567} &&\quad y(1.{712}) = {-1}.{0021602956} &&\quad \text{err} = 0.{0000000611}
\\ y(2.{054}) \approx {-0}.{8956377645} &&\quad y(2.{054}) = {-0}.{8956374989} &&\quad \text{err} = 0.{0000002657}
\\ y(2.{554}) \approx {-0}.{7885606277} &&\quad y(2.{554}) = {-0}.{7885597697} &&\quad \text{err} = 0.{0000008580}
\\ y(3.{054}) \approx {-0}.{7144103042} &&\quad y(3.{054}) = {-0}.{7144094649} &&\quad \text{err} = 0.{0000008393}
\\ y(3.{554}) \approx {-0}.{6596080673} &&\quad y(3.{554}) = {-0}.{6596073105} &&\quad \text{err} = 0.{0000007568}
\\ y(4.{000}) \approx {-0}.{6213356148} &&\quad y(4.{000}) = {-0}.{6213349346} &&\quad \text{err} = 0.{0000006803}
\end{align*} y ( 1. 000 ) ≈ − 1 . 4426950409 y ( 1. 152 ) ≈ − 1 . 3046976279 y ( 1. 293 ) ≈ − 1 . 2049559247 y ( 1. 474 ) ≈ − 1 . 1037400512 y ( 1. 712 ) ≈ − 1 . 0021603567 y ( 2. 054 ) ≈ − 0 . 8956377645 y ( 2. 554 ) ≈ − 0 . 7885606277 y ( 3. 054 ) ≈ − 0 . 7144103042 y ( 3. 554 ) ≈ − 0 . 6596080673 y ( 4. 000 ) ≈ − 0 . 6213356148 y ( 1. 000 ) = − 1 . 4426950409 y ( 1. 152 ) = − 1 . 3046976215 y ( 1. 293 ) = − 1 . 2049559226 y ( 1. 474 ) = − 1 . 1037400380 y ( 1. 712 ) = − 1 . 0021602956 y ( 2. 054 ) = − 0 . 8956374989 y ( 2. 554 ) = − 0 . 7885597697 y ( 3. 054 ) = − 0 . 7144094649 y ( 3. 554 ) = − 0 . 6596073105 y ( 4. 000 ) = − 0 . 6213349346 err = 0. 0000000000 err = 0. 0000000065 err = 0. 0000000021 err = 0. 0000000132 err = 0. 0000000611 err = 0. 0000002657 err = 0. 0000008580 err = 0. 0000008393 err = 0. 0000007568 err = 0. 0000006803
This result was generated with the following Python program:
def runge_kutta_fehlberg (f, a, b, alpha, TOL, hmax, hmin ):
t = a
w = alpha
h = hmax
FLAG = 1
yield (t, w, None )
while FLAG == 1 :
K1 = h*f(t,w)
K2 = h*f(t + (1 /4 )*h, w + (1 /4 )*K1)
K3 = h*f(t + (3 /8 )*h, w + (3 /32 )*K1 + (9 /32 )*K2)
K4 = h*f(t + (12 /13 )*h, w + (1932 /2197 )*K1 - (7200 /2197 )*K2 + (7296 /2197 )*K3)
K5 = h*f(t + h, w + (439 /216 )*K1 - 8 *K2 + (3680 /513 )*K3 - (845 /4104 )*K4)
K6 = h*f(t + (1 /2 )*h, w - (8 /27 )*K1 + 2 *K2 - (3544 /2565 )*K3 + (1859 /4104 )*K4 - (11 /40 )*K5)
R = (1 /h) * abs ( (1 /360 )*K1 - (128 /4275 )*K3 - (2197 /75240 )*K4 + (1 /50 )*K5 + (2 /55 )*K6 )
if R <= TOL:
t += h
w += (25 /216 )*K1 + (1408 /2565 )*K3 + (2197 /4104 )*K4 - (1 /5 )*K5
yield (t, w, h)
delta = 0.84 * (TOL / R)**(1 /4 )
if delta <= 0.1 :
h *= 0.1
elif delta >= 4 :
h *= 4
else :
h *= delta
if h > hmax: h = hmax
if t >= b:
FLAG = 0
elif t + h > b:
h = b - t
elif h < hmin:
FLAG = 0
raise Exception(f'minimum h exceeded: {h} ' )
pass
f = lambda t, y: y**2 / (1 + t)
nodes = runge_kutta_fehlberg(
f=f, a=1 , b=4 , alpha=(-1 )/ln(2 ),
TOL=1e-6 , hmax=0.5 , hmin=0.05
)
actual_soln = lambda t: (-1 )/ln(t+1 )
for (t, w, h) in nodes:
actual = actual_soln(t)
err = abs (actual - w)
print (f"y({t:.3 f} ) \\approx {w:.10 f} && y({t:.3 f} ) = {actual:.10 f} && err = {err:.10 f} " )
Use each of the Adams-Bashforth methods to approximate the solution to
d y d t = y 2 1 + t 1 ≤ t ≤ 2 y ( 1 ) = − 1 ln 2
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\dd y t = \frac{y^2}{1+t} \qquad 1 \leq t \leq 2 \qquad y(1) = \frac{-1}{\ln 2} d t d y = 1 + t y 2 1 ≤ t ≤ 2 y ( 1 ) = ln 2 − 1
with h = 0.1
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
h = 0.1 h = 0.1 . Use starting values obtained from the Runge-Kutta method of order four. Compare the results to values of the actual solution y ( t ) = − 1 / ln ( t + 1 )
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
y(t) = {-1} / \ln (t+1) y ( t ) = − 1 / ln ( t + 1 ) .
Results are as follows
Adams Bashford 2-step:
t 0 = 1.0 w 0 ≈ − 1.44269504 y ( t 0 ) ≈ − 1.44269504 e r r ≈ 0.00000000 t 1 = 1.1 w 1 ≈ − 1.34782267 y ( t 1 ) ≈ − 1.34782271 e r r ≈ 0.00000003 t 2 = 1.2 w 2 ≈ − 1.27009790 y ( t 2 ) ≈ − 1.26829940 e r r ≈ 0.00179850 t 3 = 1.3 w 3 ≈ − 1.20336349 y ( t 3 ) ≈ − 1.20061117 e r r ≈ 0.00275232 t 4 = 1.4 w 4 ≈ − 1.14558572 y ( t 4 ) ≈ − 1.14224524 e r r ≈ 0.00334048 t 5 = 1.5 w 5 ≈ − 1.09504289 y ( t 5 ) ≈ − 1.09135667 e r r ≈ 0.00368622 t 6 = 1.6 w 6 ≈ − 1.05043672 y ( t 6 ) ≈ − 1.04655994 e r r ≈ 0.00387678 t 7 = 1.7 w 7 ≈ − 1.01076041 y ( t 7 ) ≈ − 1.00679407 e r r ≈ 0.00396633 t 8 = 1.8 w 8 ≈ − 0.97522238 y ( t 8 ) ≈ − 0.97123265 e r r ≈ 0.00398973 t 9 = 1.9 w 9 ≈ − 0.94319201 y ( t 9 ) ≈ − 0.93922224 e r r ≈ 0.00396977 t 10 = 2.0 w 10 ≈ − 0.91416083 y ( t 10 ) ≈ − 0.91023923 e r r ≈ 0.00392160
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\begin{align*} t_{0} = 1.0 && w_{0} \approx -1.44269504 && y(t_{0}) \approx -1.44269504 && \mathrm e \mathrm r \mathrm r \approx 0.00000000
\\ t_{1} = 1.1 && w_{1} \approx -1.34782267 && y(t_{1}) \approx -1.34782271 && \mathrm e \mathrm r \mathrm r \approx 0.00000003
\\ t_{2} = 1.2 && w_{2} \approx -1.27009790 && y(t_{2}) \approx -1.26829940 && \mathrm e \mathrm r \mathrm r \approx 0.00179850
\\ t_{3} = 1.3 && w_{3} \approx -1.20336349 && y(t_{3}) \approx -1.20061117 && \mathrm e \mathrm r \mathrm r \approx 0.00275232
\\ t_{4} = 1.4 && w_{4} \approx -1.14558572 && y(t_{4}) \approx -1.14224524 && \mathrm e \mathrm r \mathrm r \approx 0.00334048
\\ t_{5} = 1.5 && w_{5} \approx -1.09504289 && y(t_{5}) \approx -1.09135667 && \mathrm e \mathrm r \mathrm r \approx 0.00368622
\\ t_{6} = 1.6 && w_{6} \approx -1.05043672 && y(t_{6}) \approx -1.04655994 && \mathrm e \mathrm r \mathrm r \approx 0.00387678
\\ t_{7} = 1.7 && w_{7} \approx -1.01076041 && y(t_{7}) \approx -1.00679407 && \mathrm e \mathrm r \mathrm r \approx 0.00396633
\\ t_{8} = 1.8 && w_{8} \approx -0.97522238 && y(t_{8}) \approx -0.97123265 && \mathrm e \mathrm r \mathrm r \approx 0.00398973
\\ t_{9} = 1.9 && w_{9} \approx -0.94319201 && y(t_{9}) \approx -0.93922224 && \mathrm e \mathrm r \mathrm r \approx 0.00396977
\\ t_{10} = 2.0 && w_{10} \approx -0.91416083 && y(t_{10}) \approx -0.91023923 && \mathrm e \mathrm r \mathrm r \approx 0.00392160
\end{align*} t 0 = 1.0 t 1 = 1.1 t 2 = 1.2 t 3 = 1.3 t 4 = 1.4 t 5 = 1.5 t 6 = 1.6 t 7 = 1.7 t 8 = 1.8 t 9 = 1.9 t 10 = 2.0 w 0 ≈ − 1.44269504 w 1 ≈ − 1.34782267 w 2 ≈ − 1.27009790 w 3 ≈ − 1.20336349 w 4 ≈ − 1.14558572 w 5 ≈ − 1.09504289 w 6 ≈ − 1.05043672 w 7 ≈ − 1.01076041 w 8 ≈ − 0.97522238 w 9 ≈ − 0.94319201 w 10 ≈ − 0.91416083 y ( t 0 ) ≈ − 1.44269504 y ( t 1 ) ≈ − 1.34782271 y ( t 2 ) ≈ − 1.26829940 y ( t 3 ) ≈ − 1.20061117 y ( t 4 ) ≈ − 1.14224524 y ( t 5 ) ≈ − 1.09135667 y ( t 6 ) ≈ − 1.04655994 y ( t 7 ) ≈ − 1.00679407 y ( t 8 ) ≈ − 0.97123265 y ( t 9 ) ≈ − 0.93922224 y ( t 10 ) ≈ − 0.91023923 err ≈ 0.00000000 err ≈ 0.00000003 err ≈ 0.00179850 err ≈ 0.00275232 err ≈ 0.00334048 err ≈ 0.00368622 err ≈ 0.00387678 err ≈ 0.00396633 err ≈ 0.00398973 err ≈ 0.00396977 err ≈ 0.00392160
Adams Bashford 3-step:
t 0 = 1.0 w 0 ≈ − 1.44269504 y ( t 0 ) ≈ − 1.44269504 e r r ≈ 0.00000000 t 1 = 1.1 w 1 ≈ − 1.34782267 y ( t 1 ) ≈ − 1.34782271 e r r ≈ 0.00000003 t 2 = 1.2 w 2 ≈ − 1.26829936 y ( t 2 ) ≈ − 1.26829940 e r r ≈ 0.00000005 t 3 = 1.3 w 3 ≈ − 1.26716141 y ( t 3 ) ≈ − 1.20061117 e r r ≈ 0.06655024 t 4 = 1.4 w 4 ≈ − 1.25879418 y ( t 4 ) ≈ − 1.14224524 e r r ≈ 0.11654894 t 5 = 1.5 w 5 ≈ − 1.25538908 y ( t 5 ) ≈ − 1.09135667 e r r ≈ 0.16403242 t 6 = 1.6 w 6 ≈ − 1.25129155 y ( t 6 ) ≈ − 1.04655994 e r r ≈ 0.20473161 t 7 = 1.7 w 7 ≈ − 1.24761480 y ( t 7 ) ≈ − 1.00679407 e r r ≈ 0.24082072 t 8 = 1.8 w 8 ≈ − 1.24399225 y ( t 8 ) ≈ − 0.97123265 e r r ≈ 0.27275959 t 9 = 1.9 w 9 ≈ − 1.24049826 y ( t 9 ) ≈ − 0.93922224 e r r ≈ 0.30127603 t 10 = 2.0 w 10 ≈ − 1.23710551 y ( t 10 ) ≈ − 0.91023923 e r r ≈ 0.32686628
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\begin{align*} t_{0} = 1.0 && w_{0} \approx -1.44269504 && y(t_{0}) \approx -1.44269504 && \mathrm e \mathrm r \mathrm r \approx 0.00000000
\\ t_{1} = 1.1 && w_{1} \approx -1.34782267 && y(t_{1}) \approx -1.34782271 && \mathrm e \mathrm r \mathrm r \approx 0.00000003
\\ t_{2} = 1.2 && w_{2} \approx -1.26829936 && y(t_{2}) \approx -1.26829940 && \mathrm e \mathrm r \mathrm r \approx 0.00000005
\\ t_{3} = 1.3 && w_{3} \approx -1.26716141 && y(t_{3}) \approx -1.20061117 && \mathrm e \mathrm r \mathrm r \approx 0.06655024
\\ t_{4} = 1.4 && w_{4} \approx -1.25879418 && y(t_{4}) \approx -1.14224524 && \mathrm e \mathrm r \mathrm r \approx 0.11654894
\\ t_{5} = 1.5 && w_{5} \approx -1.25538908 && y(t_{5}) \approx -1.09135667 && \mathrm e \mathrm r \mathrm r \approx 0.16403242
\\ t_{6} = 1.6 && w_{6} \approx -1.25129155 && y(t_{6}) \approx -1.04655994 && \mathrm e \mathrm r \mathrm r \approx 0.20473161
\\ t_{7} = 1.7 && w_{7} \approx -1.24761480 && y(t_{7}) \approx -1.00679407 && \mathrm e \mathrm r \mathrm r \approx 0.24082072
\\ t_{8} = 1.8 && w_{8} \approx -1.24399225 && y(t_{8}) \approx -0.97123265 && \mathrm e \mathrm r \mathrm r \approx 0.27275959
\\ t_{9} = 1.9 && w_{9} \approx -1.24049826 && y(t_{9}) \approx -0.93922224 && \mathrm e \mathrm r \mathrm r \approx 0.30127603
\\ t_{10} = 2.0 && w_{10} \approx -1.23710551 && y(t_{10}) \approx -0.91023923 && \mathrm e \mathrm r \mathrm r \approx 0.32686628
\end{align*} t 0 = 1.0 t 1 = 1.1 t 2 = 1.2 t 3 = 1.3 t 4 = 1.4 t 5 = 1.5 t 6 = 1.6 t 7 = 1.7 t 8 = 1.8 t 9 = 1.9 t 10 = 2.0 w 0 ≈ − 1.44269504 w 1 ≈ − 1.34782267 w 2 ≈ − 1.26829936 w 3 ≈ − 1.26716141 w 4 ≈ − 1.25879418 w 5 ≈ − 1.25538908 w 6 ≈ − 1.25129155 w 7 ≈ − 1.24761480 w 8 ≈ − 1.24399225 w 9 ≈ − 1.24049826 w 10 ≈ − 1.23710551 y ( t 0 ) ≈ − 1.44269504 y ( t 1 ) ≈ − 1.34782271 y ( t 2 ) ≈ − 1.26829940 y ( t 3 ) ≈ − 1.20061117 y ( t 4 ) ≈ − 1.14224524 y ( t 5 ) ≈ − 1.09135667 y ( t 6 ) ≈ − 1.04655994 y ( t 7 ) ≈ − 1.00679407 y ( t 8 ) ≈ − 0.97123265 y ( t 9 ) ≈ − 0.93922224 y ( t 10 ) ≈ − 0.91023923 err ≈ 0.00000000 err ≈ 0.00000003 err ≈ 0.00000005 err ≈ 0.06655024 err ≈ 0.11654894 err ≈ 0.16403242 err ≈ 0.20473161 err ≈ 0.24082072 err ≈ 0.27275959 err ≈ 0.30127603 err ≈ 0.32686628
Adams Bashford 4-step:
t 0 = 1.0 w 0 ≈ − 1.44269504 y ( t 0 ) ≈ − 1.44269504 e r r ≈ 0.00000000 t 1 = 1.1 w 1 ≈ − 1.34782267 y ( t 1 ) ≈ − 1.34782271 e r r ≈ 0.00000003 t 2 = 1.2 w 2 ≈ − 1.26829936 y ( t 2 ) ≈ − 1.26829940 e r r ≈ 0.00000005 t 3 = 1.3 w 3 ≈ − 1.20061112 y ( t 3 ) ≈ − 1.20061117 e r r ≈ 0.00000006 t 4 = 1.4 w 4 ≈ − 1.14239593 y ( t 4 ) ≈ − 1.14224524 e r r ≈ 0.00015069 t 5 = 1.5 w 5 ≈ − 1.09156692 y ( t 5 ) ≈ − 1.09135667 e r r ≈ 0.00021026 t 6 = 1.6 w 6 ≈ − 1.04682225 y ( t 6 ) ≈ − 1.04655994 e r r ≈ 0.00026232 t 7 = 1.7 w 7 ≈ − 1.00706970 y ( t 7 ) ≈ − 1.00679407 e r r ≈ 0.00027563 t 8 = 1.8 w 8 ≈ − 0.97151632 y ( t 8 ) ≈ − 0.97123265 e r r ≈ 0.00028366 t 9 = 1.9 w 9 ≈ − 0.93950377 y ( t 9 ) ≈ − 0.93922224 e r r ≈ 0.00028154 t 10 = 2.0 w 10 ≈ − 0.91051639 y ( t 10 ) ≈ − 0.91023923 e r r ≈ 0.00027717
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\begin{align*} t_{0} = 1.0 && w_{0} \approx -1.44269504 && y(t_{0}) \approx -1.44269504 && \mathrm e \mathrm r \mathrm r \approx 0.00000000
\\ t_{1} = 1.1 && w_{1} \approx -1.34782267 && y(t_{1}) \approx -1.34782271 && \mathrm e \mathrm r \mathrm r \approx 0.00000003
\\ t_{2} = 1.2 && w_{2} \approx -1.26829936 && y(t_{2}) \approx -1.26829940 && \mathrm e \mathrm r \mathrm r \approx 0.00000005
\\ t_{3} = 1.3 && w_{3} \approx -1.20061112 && y(t_{3}) \approx -1.20061117 && \mathrm e \mathrm r \mathrm r \approx 0.00000006
\\ t_{4} = 1.4 && w_{4} \approx -1.14239593 && y(t_{4}) \approx -1.14224524 && \mathrm e \mathrm r \mathrm r \approx 0.00015069
\\ t_{5} = 1.5 && w_{5} \approx -1.09156692 && y(t_{5}) \approx -1.09135667 && \mathrm e \mathrm r \mathrm r \approx 0.00021026
\\ t_{6} = 1.6 && w_{6} \approx -1.04682225 && y(t_{6}) \approx -1.04655994 && \mathrm e \mathrm r \mathrm r \approx 0.00026232
\\ t_{7} = 1.7 && w_{7} \approx -1.00706970 && y(t_{7}) \approx -1.00679407 && \mathrm e \mathrm r \mathrm r \approx 0.00027563
\\ t_{8} = 1.8 && w_{8} \approx -0.97151632 && y(t_{8}) \approx -0.97123265 && \mathrm e \mathrm r \mathrm r \approx 0.00028366
\\ t_{9} = 1.9 && w_{9} \approx -0.93950377 && y(t_{9}) \approx -0.93922224 && \mathrm e \mathrm r \mathrm r \approx 0.00028154
\\ t_{10} = 2.0 && w_{10} \approx -0.91051639 && y(t_{10}) \approx -0.91023923 && \mathrm e \mathrm r \mathrm r \approx 0.00027717
\end{align*} t 0 = 1.0 t 1 = 1.1 t 2 = 1.2 t 3 = 1.3 t 4 = 1.4 t 5 = 1.5 t 6 = 1.6 t 7 = 1.7 t 8 = 1.8 t 9 = 1.9 t 10 = 2.0 w 0 ≈ − 1.44269504 w 1 ≈ − 1.34782267 w 2 ≈ − 1.26829936 w 3 ≈ − 1.20061112 w 4 ≈ − 1.14239593 w 5 ≈ − 1.09156692 w 6 ≈ − 1.04682225 w 7 ≈ − 1.00706970 w 8 ≈ − 0.97151632 w 9 ≈ − 0.93950377 w 10 ≈ − 0.91051639 y ( t 0 ) ≈ − 1.44269504 y ( t 1 ) ≈ − 1.34782271 y ( t 2 ) ≈ − 1.26829940 y ( t 3 ) ≈ − 1.20061117 y ( t 4 ) ≈ − 1.14224524 y ( t 5 ) ≈ − 1.09135667 y ( t 6 ) ≈ − 1.04655994 y ( t 7 ) ≈ − 1.00679407 y ( t 8 ) ≈ − 0.97123265 y ( t 9 ) ≈ − 0.93922224 y ( t 10 ) ≈ − 0.91023923 err ≈ 0.00000000 err ≈ 0.00000003 err ≈ 0.00000005 err ≈ 0.00000006 err ≈ 0.00015069 err ≈ 0.00021026 err ≈ 0.00026232 err ≈ 0.00027563 err ≈ 0.00028366 err ≈ 0.00028154 err ≈ 0.00027717
Adams Bashford 5-step:
t 0 = 1.0 w 0 ≈ − 1.44269504 y ( t 0 ) ≈ − 1.44269504 e r r ≈ 0.00000000 t 1 = 1.1 w 1 ≈ − 1.34782267 y ( t 1 ) ≈ − 1.34782271 e r r ≈ 0.00000003 t 2 = 1.2 w 2 ≈ − 1.26829936 y ( t 2 ) ≈ − 1.26829940 e r r ≈ 0.00000005 t 3 = 1.3 w 3 ≈ − 1.20061112 y ( t 3 ) ≈ − 1.20061117 e r r ≈ 0.00000006 t 4 = 1.4 w 4 ≈ − 1.14224518 y ( t 4 ) ≈ − 1.14224524 e r r ≈ 0.00000006 t 5 = 1.5 w 5 ≈ − 1.09130175 y ( t 5 ) ≈ − 1.09135667 e r r ≈ 0.00005491 t 6 = 1.6 w 6 ≈ − 1.04648605 y ( t 6 ) ≈ − 1.04655994 e r r ≈ 0.00007389 t 7 = 1.7 w 7 ≈ − 1.00669844 y ( t 7 ) ≈ − 1.00679407 e r r ≈ 0.00009564 t 8 = 1.8 w 8 ≈ − 0.97113853 y ( t 8 ) ≈ − 0.97123265 e r r ≈ 0.00009413 t 9 = 1.9 w 9 ≈ − 0.93912343 y ( t 9 ) ≈ − 0.93922224 e r r ≈ 0.00009881 t 10 = 2.0 w 10 ≈ − 0.91014422 y ( t 10 ) ≈ − 0.91023923 e r r ≈ 0.00009500
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\begin{align*} t_{0} = 1.0 && w_{0} \approx -1.44269504 && y(t_{0}) \approx -1.44269504 && \mathrm e \mathrm r \mathrm r \approx 0.00000000
\\ t_{1} = 1.1 && w_{1} \approx -1.34782267 && y(t_{1}) \approx -1.34782271 && \mathrm e \mathrm r \mathrm r \approx 0.00000003
\\ t_{2} = 1.2 && w_{2} \approx -1.26829936 && y(t_{2}) \approx -1.26829940 && \mathrm e \mathrm r \mathrm r \approx 0.00000005
\\ t_{3} = 1.3 && w_{3} \approx -1.20061112 && y(t_{3}) \approx -1.20061117 && \mathrm e \mathrm r \mathrm r \approx 0.00000006
\\ t_{4} = 1.4 && w_{4} \approx -1.14224518 && y(t_{4}) \approx -1.14224524 && \mathrm e \mathrm r \mathrm r \approx 0.00000006
\\ t_{5} = 1.5 && w_{5} \approx -1.09130175 && y(t_{5}) \approx -1.09135667 && \mathrm e \mathrm r \mathrm r \approx 0.00005491
\\ t_{6} = 1.6 && w_{6} \approx -1.04648605 && y(t_{6}) \approx -1.04655994 && \mathrm e \mathrm r \mathrm r \approx 0.00007389
\\ t_{7} = 1.7 && w_{7} \approx -1.00669844 && y(t_{7}) \approx -1.00679407 && \mathrm e \mathrm r \mathrm r \approx 0.00009564
\\ t_{8} = 1.8 && w_{8} \approx -0.97113853 && y(t_{8}) \approx -0.97123265 && \mathrm e \mathrm r \mathrm r \approx 0.00009413
\\ t_{9} = 1.9 && w_{9} \approx -0.93912343 && y(t_{9}) \approx -0.93922224 && \mathrm e \mathrm r \mathrm r \approx 0.00009881
\\ t_{10} = 2.0 && w_{10} \approx -0.91014422 && y(t_{10}) \approx -0.91023923 && \mathrm e \mathrm r \mathrm r \approx 0.00009500
\end{align*} t 0 = 1.0 t 1 = 1.1 t 2 = 1.2 t 3 = 1.3 t 4 = 1.4 t 5 = 1.5 t 6 = 1.6 t 7 = 1.7 t 8 = 1.8 t 9 = 1.9 t 10 = 2.0 w 0 ≈ − 1.44269504 w 1 ≈ − 1.34782267 w 2 ≈ − 1.26829936 w 3 ≈ − 1.20061112 w 4 ≈ − 1.14224518 w 5 ≈ − 1.09130175 w 6 ≈ − 1.04648605 w 7 ≈ − 1.00669844 w 8 ≈ − 0.97113853 w 9 ≈ − 0.93912343 w 10 ≈ − 0.91014422 y ( t 0 ) ≈ − 1.44269504 y ( t 1 ) ≈ − 1.34782271 y ( t 2 ) ≈ − 1.26829940 y ( t 3 ) ≈ − 1.20061117 y ( t 4 ) ≈ − 1.14224524 y ( t 5 ) ≈ − 1.09135667 y ( t 6 ) ≈ − 1.04655994 y ( t 7 ) ≈ − 1.00679407 y ( t 8 ) ≈ − 0.97123265 y ( t 9 ) ≈ − 0.93922224 y ( t 10 ) ≈ − 0.91023923 err ≈ 0.00000000 err ≈ 0.00000003 err ≈ 0.00000005 err ≈ 0.00000006 err ≈ 0.00000006 err ≈ 0.00005491 err ≈ 0.00007389 err ≈ 0.00009564 err ≈ 0.00009413 err ≈ 0.00009881 err ≈ 0.00009500
These results were generated by the following Python program:
def runge_kutta_order_four (f, a, b, alpha, N ):
h = (b - a) / N
t = a
w = alpha
yield (t, w)
for i in range (1 , N + 1 ):
K1 = h*f(t, w)
K2 = h*f(t + h/2 , w + K1/2 )
K3 = h*f(t + h/2 , w + K2/2 )
K4 = h*f(t + h, w + K3)
w += (K1 + 2 *K2 + 2 *K3 + K4) / 6
t = a + i*h
yield (t, w)
def mk_mstep (M, step ):
def adams_bashford_M_step (f, a, b, h, alpha ):
N = int ((b - a) / h)
_t, w = unzip(runge_kutta_order_four(f, a, a + (M-1 )*h, alpha, M-1 ))
t = [ a + i*h for i in range (N + 1 ) ]
for i in range (M-1 , N):
w.append(step(t, w, i))
return zip (t, w)
adams_bashford_M_step.name = f"Adams Bashford {M} -step"
return adams_bashford_M_step
adams_bashford_two_step = mk_mstep(M=2 , step=lambda t, w, i: w[i] + (h/2 )*( 3 *f(t[i] ,w[i]) - f(t[i-1 ], w[i-1 ]) ))
adams_bashford_three_step = mk_mstep(M=3 , step=lambda t, w, i: w[i] + (h/12 )*( 12 *f(t[i], w[i]) - 16 *f(t[i-1 ], w[i-1 ]) + 5 *f(t[i-2 ], w[i-2 ]) ))
adams_bashford_four_step = mk_mstep(M=4 , step=lambda t, w, i: w[i] + (h/24 )*( 55 *f(t[i], w[i]) - 59 *f(t[i-1 ], w[i-1 ]) + 37 *f(t[i-2 ], w[i-2 ]) - 9 *f(t[i-3 ], w[i-3 ]) ))
adams_bashford_five_step = mk_mstep(M=5 , step=lambda t, w, i: w[i] + (h/720 )*( 1901 *f(t[i], w[i]) - 2774 *f(t[i-1 ], w[i-1 ]) + 2616 *f(t[i-2 ], w[i-2 ]) - 1274 *f(t[i-3 ], w[i-3 ]) + 251 *f(t[i-4 ], w[i-4 ]) ))
f = lambda t, y: y**2 / (1 + t)
a, b = (1 , 2 )
alpha = -1 / ln(2 )
h = 0.1
soln = lambda t: -1 / ln(t + 1 )
for algo in [adams_bashford_two_step, adams_bashford_three_step, adams_bashford_four_step, adams_bashford_five_step]:
print ()
print (algo.name + ":" )
print ()
print (r"\katex align=y:" )
for (i, (t, w)) in enumerate (algo(f, a, b, h, alpha)):
y = soln(t)
err = abs (y - w)
si = "{" + str (i) + "}"
print (" " + (i != 0 ) * r"\\ " + fr"t_{si} = {t:.1 f} && w_{si} \approx {w:.8 f} && y(t_{si} ) \approx {y:.8 f} && \mathrm e \mathrm r \mathrm r \approx {err:.8 f} " )
Use the Adams Variable Step-Size Predictor-Corrector Algorithm with TOL = 10 − 4
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\text{TOL} = {10}^{-4} TOL = 10 − 4 to approximate the solution to the initial -value problem
d y d t = y 2 + y t 1 ≤ t ≤ 3 y ( 1 ) = − 2
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\dd y t = \frac{ y^2 + y }t \qquad 1 \leq t \leq 3 \qquad y(1) = -2 d t d y = t y 2 + y 1 ≤ t ≤ 3 y ( 1 ) = − 2
with hmax = 0.4
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\text{hmax} = 0.4 hmax = 0.4 and hmin = 0.01
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\text{hmin} = 0.{01} hmin = 0. 01
My algorithm implementation is failing with error hmin exceeded
. I’ve double-checked the code, and compared it to prof Ming Gu’s implementation, and don’t see any errors. I also tried to “hack” the algorithm a couple ways to “force” results, to no avail.
I’ve disabled the error and included below results from the algorithm up until the point it crashes due to dividing by h = 0
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
h = 0 h = 0 :
t ≈ 1.4 w ≈ − 1.5539889980952382 t ≈ 1.8 w ≈ − 1.3836172899114931 t ≈ 2.2 w ≈ − 1.2934015269193302
%% general %%
% shorthands
\newcommand{\cl}[1]{ \mathcal{#1} }
\newcommand{\sc}[1]{ \mathscr{#1} }
\newcommand{\bb}[1]{ \mathbb{#1} }
\newcommand{\fk}[1]{ \mathfrak{#1} }
\renewcommand{\bf}[1]{ \mathbf{#1} }
\renewcommand{\sf}[1]{ \mathsf{#1} }
\renewcommand{\rm}[1]{ \mathrm{#1} }
\newcommand{\floor}[1]{ { \lfloor {#1} \rfloor } }
\newcommand{\ceil}[1]{ { \lceil {#1} \rceil } }
\newcommand{\ol}[1]{ \overline{#1} }
\newcommand{\t}[1]{ \text{#1} }
\newcommand{\norm}[1]{ { \lvert {#1} \rvert } } % norm/magnitude (REMOVE)
\newcommand{\mag}[1]{ { \left\lvert {#1} \right\rvert } } % magnitude
\newcommand{\smag}[1]{ { \lvert {#1} \rvert } } % short mag
\newcommand{\card}{ \t{cd} } % cardinality
\newcommand{\dcup}{ \sqcup } % disjoint untion
\newcommand{\tup}[1]{ \langle {#1} \rangle } % tuples
\newcommand{\tl}{ \tilde }
\newcommand{\wt}{ \widetilde }
\newcommand{\To}{ \Rightarrow }
% draw a box outlining some math
\newcommand{\box}[1]{ \fbox{$ #1 $} }
% f \onall X = { f(x) : x ∈ X }
\newcommand{\onall}[1]{ { \llbracket {#1} \rrbracket } }
% shorthands: various brackets
\newcommand{\tpar}[1]{ \left( {#1} \right) } % "tall parens"
\newcommand{\tbrak}[1]{ \left[ {#1} \right] } % "tall brackets"
\newcommand{\tbrac}[1]{ \left\{ {#1} \right\} } % "tall braces"
% reverse \mapsto (FIXME: make better)
%\newcommand{\mapsfrom}{ \mathop{\leftarrow\!\mid} }
\newcommand{\mapsfrom}{ \mathrel{↤} }
% reverse-order composition
\newcommand{\then}{ \operatorname{\ ;\ } }
% Like f' represents "f after modification", \pre{f}
% represents "f before modification"
% TODO: remove this?
\newcommand{\pre}[1]{{ \small `{#1} }}
% hook arrows
\newcommand{\injects}{ \hookrightarrow }
\newcommand{\embeds}{ \hookrightarrow }
\newcommand{\surjects}{ \twoheadrightarrow }
\newcommand{\projects}{ \twoheadrightarrow }
\newcommand{\id}{ \,\mathrm d } % integration d
% derivatives: use {\ddn n x y} for (dy/dx)
\newcommand{\ddn}[3]{ \frac{ {\mathrm d}^{#1} {#2} }{ {\mathrm d} {#3}^{#1} } } % nth derivative
\newcommand{\dd}{ \ddn{} } % first derivative
\newcommand{\d}{ \dd{} } % first derivative (no numerator)
\newcommand{\dn}[1]{ \ddn{#1}{} } % nth derivative (no numerator)
% derivatives: use {\D n x y} for (∂_x y)
\newcommand{\Dn}[2]{ \partial^{#1}_{#2} }
\newcommand{\D}{ \Dn{} } % no power
\newcommand{\ig}[2]{ \int {#2} \, \mathrm d {#1} } % first integral
%% category theory %%
% category names
\newcommand{\cat}[1]{{ \sf{#1} }}
% yoneda embedding
\newcommand{\yo}{よ}
% extra long right-arrows
\newcommand{\X}{-\!\!\!-\!\!\!}
\newcommand{\xlongrightarrow}{ \mathop{ \, \X\longrightarrow \, } }
\newcommand{\xxlongrightarrow}{ \mathop{ \, \X\X\longrightarrow \, } }
\newcommand{\xxxlongrightarrow}{ \mathop{ \, \X\X\X\longrightarrow \, } }
\newcommand{\takenby}[1]{ \overset{#1}{\rightarrow} }
\newcommand{\longtakenby}[1]{ \overset{#1}{\longrightarrow} }
\newcommand{\xlongtakenby}[1]{ \overset{#1}{\xlongrightarrow} }
\newcommand{\xxlongtakenby}[1]{ \overset{#1}{\xxlongrightarrow} }
\newcommand{\xxxlongtakenby}[1]{ \overset{#1}{\xxxlongrightarrow} }
% represents an anonymous parameter
% eg. $f(\apar)$ usually denotes the function $x \mapsto f(x)$
% TODO: remove this?
\newcommand{\apar}{ {-} }
%% computability %%
% turing machines
\newcommand{\halts}{ {\downarrow} }
\newcommand{\loops}{ {\uparrow} }
\begin{align*} t \approx 1.4 && w \approx -1.5539889980952382
\\ t \approx 1.8 && w \approx -1.3836172899114931
\\ t \approx 2.2 && w \approx -1.2934015269193302
\end{align*} t ≈ 1.4 t ≈ 1.8 t ≈ 2.2 w ≈ − 1.5539889980952382 w ≈ − 1.3836172899114931 w ≈ − 1.2934015269193302
The algorithm is given below.
def adams_variable_step_size_predictor_corrector (f, a, b, alpha, TOL, hmin, hmax ):
t = [a]
w = [alpha]
h = hmax
FLAG = 1
LAST = 0
yield (None , t[0 ], w[0 ], None )
def runge_kutta (*, j0 ):
x = t
v = w
for j in [j0+1 , j0+2 , j0+3 ]:
K1 = h*f(x[j-1 ], v[j-1 ])
K2 = h*f(x[j-1 ] + h/2 , v[j-1 ] + K1/2 )
K3 = h*f(x[j-1 ] + h/2 , v[j-1 ] + K2/2 )
K4 = h*f(x[j-1 ] + h, v[j-1 ] + K3)
v.append(v[j-1 ] + (K1 + 2 *K2 + 2 *K3 + K4)/6 )
x.append(x[0 ] + j*h)
runge_kutta(j0=0 )
NFLAG = 1
i = 4
t_ = t[3 ] + h
while FLAG == 1 :
WP = w[i-1 ] + (h/24 )*(55 *f(t[i-1 ], w[i-1 ]) - 59 *f(t[i-2 ], w[i-2 ]) + 37 *f(t[i-3 ], w[i-3 ]) - 9 *f(t[i-4 ], w[i-4 ]))
WC = w[i-1 ] + (h/24 )*(9 *f(t_, WP) + 19 *f(t[i-1 ], w[i-1 ]) - 5 *f(t[i-2 ], w[i-2 ]) + f(t[i-3 ], w[i-3 ]))
sigma = 19 * abs (WC - WP) / (270 *h)
if sigma <= TOL:
w[i] = WC
t[i] = t_
if NFLAG == 1 :
for j in [i-3 , i-2 , i-1 , i]:
yield (j, t[j], w[j], h)
else :
yield (i, t[i], w[i], h)
if LAST == 1 :
FLAG = 0
else :
i += 1
NFLAG = 0
if sigma <= 0.1 * TOL or t[i-1 ] + h > b:
q = (TOL / (2 * sigma)) ** (1 /4 )
if q > 4 : h = 4 *h
else : h = q*h
if h > hmax:
h = hmax
if t[i-1 ] + 4 *h > b:
h = (b - t[i-1 ])/4
LAST = 1
runge_kutta(j0=i-1 )
NFLAG = 1
i += 3
else :
q = (TOL / (2 * sigma)) ** (1 /4 )
if q < 0.1 : h = 0.1 * h
else : h = q * h
if h < hmin:
print ('hmin exceeded' )
else :
if NFLAG == 1 :
i -= 3
runge_kutta(j0=i-1 )
i += 3
NFLAG = 1
t_ = t[i-1 ] + h
f = lambda t, y: (y**2 + y)/t
(a, b) = (1 , 3 )
alpha = -2
TOL = 1e-4
hmax = 0.4
hmin = 0.01
for (i, ti, wi, h) in adams_variable_step_size_predictor_corrector(f, a, b, alpha, TOL, hmin, hmax):
print (i, ti, wi, h)