Companion to the University-Style Practice Set配套大学水平练习题集
Sections 1 to 7: power-series manipulations, ordinary vs singular points, series solutions and recurrence relations, Frobenius method and indicial equations, Euler, improved Euler (Heun), RK4, and global error order第1至7节:幂级数运算、常点与奇点、级数解与递推关系、Frobenius方法与指标方程、欧拉法、改进欧拉法(Heun法)、RK4及全局误差阶CALC IV
$(x^2-9)\,y''+x\,y'+y=0$: (a) singular points and classification; (b) ordinary point $x_0=0$ and radius bound; (c) ordinary point $x_0=1$ and radius bound.$(x^2-9)\,y''+x\,y'+y=0$:(a) 奇点及其分类;(b) 常点 $x_0=0$ 及收敛半径下界;(c) 常点 $x_0=1$ 及收敛半径下界。
Divide by $(x^2-9)$: (M1)两边除以 $(x^2-9)$:(M1)
$$ y'' + \frac{x}{x^2-9}\,y' + \frac{1}{x^2-9}\,y = 0, $$so $p(x)=\dfrac{x}{x^2-9}$ and $q(x)=\dfrac{1}{x^2-9}$. Both functions fail to be analytic at $x^2-9=0$, i.e. at $x=3$ and $x=-3$. These are the only singular points. (A1)得 $p(x)=\dfrac{x}{x^2-9}$,$q(x)=\dfrac{1}{x^2-9}$。两个函数在 $x^2-9=0$ 处不解析,即在 $x=3$ 和 $x=-3$ 处。这两点是仅有的奇点。(A1)
To classify $x=3$: compute $(x-3)p(x)=\dfrac{x(x-3)}{(x-3)(x+3)}=\dfrac{x}{x+3}$, which is analytic at $x=3$, and $(x-3)^2 q(x)=\dfrac{(x-3)^2}{(x-3)(x+3)}=\dfrac{x-3}{x+3}$, analytic at $x=3$. Both limits exist and are analytic, so $x=3$ is a regular singular point. By the same test (replacing $(x-3)$ by $(x+3)$), $x=-3$ is also a regular singular point. (A1)对 $x=3$ 的分类:计算 $(x-3)p(x)=\dfrac{x(x-3)}{(x-3)(x+3)}=\dfrac{x}{x+3}$,在 $x=3$ 处解析;$(x-3)^2 q(x)=\dfrac{(x-3)^2}{(x-3)(x+3)}=\dfrac{x-3}{x+3}$,在 $x=3$ 处也解析。两者极限存在且解析,故 $x=3$ 是正则奇点。用同样方法(将 $(x-3)$ 换成 $(x+3)$),$x=-3$ 也是正则奇点。(A1)
At $x_0=0$, both $p(x)$ and $q(x)$ are analytic (the denominator $x^2-9=-9\ne0$ there), so $x_0=0$ is an ordinary point. (M1) The nearest singular points are $x=\pm3$, both at distance $3$ from $x_0=0$. By the existence theorem for series solutions near an ordinary point, the radius of convergence of any series solution centred at $0$ is at least the distance to the nearest singularity: (A1)在 $x_0=0$ 处,分母 $x^2-9=-9\ne0$,故 $p(x)$ 和 $q(x)$ 均解析,$x_0=0$ 是常点。(M1) 最近奇点为 $x=\pm3$,到 $x_0=0$ 的距离均为 $3$。由常点处级数解的存在性定理,以 $0$ 为中心的任意级数解收敛半径至少为到最近奇点的距离:(A1)
$$ R \ge 3. $$(A1)
At $x_0=1$, $x^2-9=-8\ne0$, so both $p$ and $q$ are analytic there, making $x_0=1$ an ordinary point. (M1) The distance from $1$ to the nearest singular point (at $x=3$) is $2$, so (A1)在 $x_0=1$ 处,$x^2-9=-8\ne0$,故 $p$ 和 $q$ 在此处均解析,$x_0=1$ 是常点。(M1) 从 $1$ 到最近奇点($x=3$)的距离为 $2$,故 (A1)
$$ R \ge 2. $$$y''+y=0$, $y(0)=1$, $y'(0)=0$. Derive the recurrence, apply ICs, compute coefficients, identify the closed form.$y''+y=0$,$y(0)=1$,$y'(0)=0$。推导递推关系,应用初始条件,计算系数,识别闭合形式。
Write $y=\displaystyle\sum_{n=0}^{\infty}a_n x^n$. Differentiating twice and shifting the index $k=n-2$ gives (M1)设 $y=\displaystyle\sum_{n=0}^{\infty}a_n x^n$,对其求两阶导数并令 $k=n-2$ 进行指标移位得 (M1)
$$ y'' = \sum_{n=2}^{\infty} n(n-1)a_n x^{n-2} = \sum_{n=0}^{\infty}(n+2)(n+1)a_{n+2}\,x^n. $$Substitute into $y''+y=0$: (M1)代入 $y''+y=0$:(M1)
$$ \sum_{n=0}^{\infty}\big[(n+2)(n+1)a_{n+2}+a_n\big]x^n = 0. $$For this to hold for all $x$, every bracket must vanish: (A1)对所有 $x$ 成立,每个括号必须为零:(A1)
$$ (n+2)(n+1)a_{n+2}+a_n=0 \quad\Longrightarrow\quad a_{n+2}=-\frac{a_n}{(n+2)(n+1)}. \tag{A1} $$From $y(0)=a_0=1$ and $y'(0)=a_1=0$. (M1) Apply the recurrence to the even chain (the odd chain is zero throughout since $a_1=0$): (A1 for each correct pair of coefficients)由 $y(0)=a_0=1$ 和 $y'(0)=a_1=0$。(M1) 将递推关系应用于偶数链(由于 $a_1=0$,奇数链全为零):(每对正确系数得 A1)
$$ a_2 = -\frac{a_0}{2\cdot1} = -\frac{1}{2}, \quad a_3 = -\frac{a_1}{3\cdot2} = 0, $$ $$ a_4 = -\frac{a_2}{4\cdot3} = \frac{1/2}{12} = \frac{1}{24}, \quad a_5 = -\frac{a_3}{5\cdot4} = 0. $$(A1 for $a_2$, A1 for $a_4$) Hence($a_2$ 得 A1,$a_4$ 得 A1)因此
$$ y = 1 - \frac{x^2}{2} + \frac{x^4}{24} + \cdots = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots $$The series is the Maclaurin series of $\cos x$. (A1) Verification: $(\cos x)''=-\cos x$, so $y''+y=0$; and $\cos 0=1$, $-\sin 0=0$, confirming both initial conditions. (R1)该级数是 $\cos x$ 的Maclaurin展开式。(A1) 验证:$(\cos x)''=-\cos x$,故 $y''+y=0$;且 $\cos 0=1$,$-\sin 0=0$,两个初始条件均满足。(R1)
$y'=y-x$, $y(0)=2$, exact solution $y=x+1+e^x$. (a) Two Euler steps, $h=0.2$; (b) one Heun step, $h=0.4$; (c) exact value and errors.$y'=y-x$,$y(0)=2$,精确解 $y=x+1+e^x$。(a) 两步欧拉法,$h=0.2$;(b) 一步Heun法,$h=0.4$;(c) 精确值与误差。
Here $f(x,y)=y-x$. Step 1 from $(0,2)$: slope $f(0,2)=2-0=2$, so (M1)这里 $f(x,y)=y-x$。从 $(0,2)$ 出发第1步:斜率 $f(0,2)=2-0=2$,故 (M1)
$$ y_1 = 2 + 0.2(2) = 2.4, \quad x_1 = 0.2. $$(A1) Step 2 from $(0.2, 2.4)$: slope $f(0.2,2.4)=2.4-0.2=2.2$, so (M1)(A1) 从 $(0.2, 2.4)$ 出发第2步:斜率 $f(0.2,2.4)=2.4-0.2=2.2$,故 (M1)
$$ y_2 = 2.4 + 0.2(2.2) = 2.4 + 0.44 = 2.84, \quad x_2 = 0.4. $$(A1)
Left slope: $k_L = f(0,2)=2$. Euler predictor: (M1)左端斜率:$k_L = f(0,2)=2$。欧拉预测值:(M1)
$$ \tilde{y}_1 = 2 + 0.4(2) = 2.8. $$Right slope at the predicted point: $k_R=f(0.4, 2.8)=2.8-0.4=2.4$. (A1) Corrector average: (M1)预测点处的右端斜率:$k_R=f(0.4, 2.8)=2.8-0.4=2.4$。(A1) 校正平均值:(M1)
$$ y_1 = 2 + \frac{0.4}{2}(k_L+k_R) = 2 + 0.2(2+2.4) = 2 + 0.2(4.4) = 2.88. $$(A1)
$y(0.4)=0.4+1+e^{0.4}=1.4+1.4918=2.8918$ (using $e^{0.4}\approx1.4918$). (A1)$y(0.4)=0.4+1+e^{0.4}=1.4+1.4918=2.8918$(取 $e^{0.4}\approx1.4918$)。(A1)
Euler absolute error: $|2.84-2.8918|=0.0518$. Heun absolute error: $|2.88-2.8918|=0.0118$. Heun is more accurate, with error roughly $4\times$ smaller for the same total interval covered. (A1)欧拉绝对误差:$|2.84-2.8918|=0.0518$。Heun绝对误差:$|2.88-2.8918|=0.0118$。Heun更精确,在覆盖相同区间的情况下误差约小 $4$ 倍。(A1)
$y''-xy=0$: (a) series for $y''$ and $xy$, handling the constant term; (b) recurrence and coefficients $a_3,a_4,a_5,a_6$; (c) general solution and infinite radius.$y''-xy=0$:(a) $y''$ 和 $xy$ 的级数表达式,处理常数项;(b) 递推关系及系数 $a_3,a_4,a_5,a_6$;(c) 通解与无穷收敛半径。
With $y=\sum_{n=0}^\infty a_n x^n$, differentiating twice and shifting: (M1)设 $y=\sum_{n=0}^\infty a_n x^n$,对其求两阶导数并移位:(M1)
$$ y'' = \sum_{n=0}^{\infty}(n+2)(n+1)a_{n+2}\,x^n. $$For the right side, multiply $y$ by $x$: (M1)对右侧,将 $y$ 乘以 $x$:(M1)
$$ xy = \sum_{n=0}^{\infty} a_n x^{n+1} = \sum_{n=1}^{\infty} a_{n-1}\,x^n. $$The $y''$ series starts at $n=0$, but the $xy$ series starts at $n=1$. The equation $y''-xy=0$ therefore reads, at $n=0$: $2\cdot1\cdot a_2 = 0$, so (A1)$y''$ 的级数从 $n=0$ 开始,而 $xy$ 的级数从 $n=1$ 开始。因此,方程 $y''-xy=0$ 在 $n=0$ 处给出:$2\cdot1\cdot a_2 = 0$,故 (A1)
$$ a_2 = 0. $$For $n\ge 1$ both series contribute, giving (A1)对 $n\ge 1$,两个级数均有贡献,得 (A1)
$$ (n+2)(n+1)a_{n+2} - a_{n-1} = 0. $$Re-index by setting $m=n-1$: for $n\ge1$, $a_{n+2}=\dfrac{a_{n-1}}{(n+2)(n+1)}$. Equivalently, replacing $n$ by $n+1$, the recurrence linking coefficients three apart is (M1)令 $m=n-1$ 重新指标:对 $n\ge1$,$a_{n+2}=\dfrac{a_{n-1}}{(n+2)(n+1)}$。将 $n$ 换成 $n+1$,联系相差三位系数的递推关系为 (M1)
$$ a_{n+3} = \frac{a_n}{(n+3)(n+2)}, \quad n\ge 0. \quad (A1) $$Starting from free values $a_0$, $a_1$ with $a_2=0$ fixed above:以自由参数 $a_0$、$a_1$ 和已固定的 $a_2=0$ 为起点:
$$ a_3 = \frac{a_0}{3\cdot2} = \frac{a_0}{6}, \quad a_4 = \frac{a_1}{4\cdot3} = \frac{a_1}{12}. \quad (A1) $$ $$ a_5 = \frac{a_2}{5\cdot4} = 0, \quad a_6 = \frac{a_3}{6\cdot5} = \frac{a_0}{180}. \quad (A1) $$The entire chain $a_2, a_5, a_8, \ldots$ is zero because $a_2=0$ propagates through the three-step recurrence.整个链 $a_2, a_5, a_8, \ldots$ 均为零,因为 $a_2=0$ 通过三步递推关系传递。
The general solution is通解为
$$ y = a_0\!\left(1+\frac{x^3}{6}+\frac{x^6}{180}+\cdots\right)+a_1\!\left(x+\frac{x^4}{12}+\cdots\right). $$(A1) Because the coefficients $p(x)=0$ and $q(x)=-x$ are polynomials, they are entire (analytic on all of $\mathbb{C}$), so there are no singular points. The radius of convergence of every solution is therefore infinite. (R1)(A1) 由于系数 $p(x)=0$ 和 $q(x)=-x$ 均为多项式,它们在整个 $\mathbb{C}$ 上解析(整函数),没有奇点。因此每个解的收敛半径均为无穷大。(R1)
$2xy''+y'+y=0$: (a) show $x=0$ is regular singular; (b) Frobenius ansatz, indicial equation, both roots; (c) larger root, recurrence, $a_1$ and $a_2$.$2xy''+y'+y=0$:(a) 证明 $x=0$ 是正则奇点;(b) Frobenius试探解、指标方程及两个根;(c) 较大的根、递推关系、$a_1$ 和 $a_2$。
Write the equation in standard form: (M1)将方程化为标准形式:(M1)
$$ y'' + \frac{1}{2x}\,y' + \frac{1}{2x}\,y = 0, $$so $p(x)=\dfrac{1}{2x}$ and $q(x)=\dfrac{1}{2x}$. Neither is analytic at $x=0$, so $x=0$ is a singular point. (A1) Test for regularity: $xp(x)=\dfrac{1}{2}$ is analytic at $x=0$, and $x^2 q(x)=\dfrac{x}{2}$ is analytic at $x=0$. Because both limits are analytic, $x=0$ is a regular singular point. (R1)得 $p(x)=\dfrac{1}{2x}$,$q(x)=\dfrac{1}{2x}$。两者在 $x=0$ 处均不解析,故 $x=0$ 是奇点。(A1) 正则性检验:$xp(x)=\dfrac{1}{2}$ 在 $x=0$ 处解析,$x^2 q(x)=\dfrac{x}{2}$ 在 $x=0$ 处也解析。因为两个极限均解析,$x=0$ 是正则奇点。(R1)
Try $y=x^r\sum_{n=0}^\infty a_n x^n$ with $a_0\ne0$. Then $y'=\sum(n+r)a_n x^{n+r-1}$ and $y''=\sum(n+r)(n+r-1)a_n x^{n+r-2}$. Substituting: (M1)令 $y=x^r\sum_{n=0}^\infty a_n x^n$,其中 $a_0\ne0$。则 $y'=\sum(n+r)a_n x^{n+r-1}$,$y''=\sum(n+r)(n+r-1)a_n x^{n+r-2}$。代入方程:(M1)
$$ 2x\sum(n+r)(n+r-1)a_n x^{n+r-2}+\sum(n+r)a_n x^{n+r-1}+\sum a_n x^{n+r}=0. $$The lowest power is $x^{r-1}$, contributed only by the first two terms at $n=0$:最低次幂为 $x^{r-1}$,仅由 $n=0$ 时前两项贡献:
$$ \big[2r(r-1)+r\big]a_0\,x^{r-1} = r(2r-1)\,a_0\,x^{r-1} = 0. $$Since $a_0\ne0$, the indicial equation is (A1)由于 $a_0\ne0$,指标方程为 (A1)
$$ r(2r-1)=0, $$with roots $r=0$ and $r=\dfrac{1}{2}$. (A1)根为 $r=0$ 和 $r=\dfrac{1}{2}$。(A1)
Use the larger root $r=\dfrac{1}{2}$. The coefficient of $x^{n+r-1}$ for $n\ge1$ gives: (M1)使用较大的根 $r=\dfrac{1}{2}$。对 $n\ge1$,$x^{n+r-1}$ 的系数给出:(M1)
$$ \big[2(n+r)(n+r-1)+(n+r)\big]a_n + a_{n-1} = (n+r)(2n+2r-1)\,a_n + a_{n-1} = 0. $$With $r=\tfrac{1}{2}$: $(n+\tfrac{1}{2})(2n)=n(2n+1)$. So $a_n=-\dfrac{a_{n-1}}{n(2n+1)}$. Applying: $a_1=-\dfrac{a_0}{3}$ and $a_2=-\dfrac{a_1}{2\cdot5}=\dfrac{a_0}{30}$. (A1)取 $r=\tfrac{1}{2}$:$(n+\tfrac{1}{2})(2n)=n(2n+1)$。故 $a_n=-\dfrac{a_{n-1}}{n(2n+1)}$。代入:$a_1=-\dfrac{a_0}{3}$,$a_2=-\dfrac{a_1}{2\cdot5}=\dfrac{a_0}{30}$。(A1)
(a) Taylor expansion, Euler update, local truncation error; (b) why global error is $O(h)$; (c) RK4 error estimate after halving $h$.(a) 泰勒展开、欧拉更新公式、局部截断误差;(b) 全局误差为何是 $O(h)$;(c) 步长减半后RK4的误差估计。
Expand the exact solution $y(x_0+h)$ about $x_0$ via Taylor's theorem: (M1)由泰勒定理将精确解 $y(x_0+h)$ 在 $x_0$ 处展开:(M1)
$$ y(x_0+h) = y(x_0) + h\,y'(x_0) + \frac{h^2}{2}\,y''(\xi) $$for some $\xi\in(x_0,x_0+h)$. (A1) Since $y'(x_0)=f(x_0,y_0)$ by the ODE, the first two terms are exactly the Euler update $y_1=y_0+h\,f(x_0,y_0)$. (A1) The discrepancy in one step is therefore其中 $\xi\in(x_0,x_0+h)$。(A1) 由常微分方程 $y'(x_0)=f(x_0,y_0)$,前两项恰好是欧拉更新公式 $y_1=y_0+h\,f(x_0,y_0)$。(A1) 因此一步中的误差为
$$ y(x_0+h) - y_1 = \frac{h^2}{2}\,y''(\xi) = O(h^2). $$This is the local truncation error: $O(h^2)$ per step. (A1)这就是局部截断误差:每步 $O(h^2)$。(A1)
To reach a fixed endpoint $X$ from $x_0$, the number of Euler steps is $N=X/h$, which is of order $1/h$. (M1) Each step introduces a local error of size $O(h^2)$, and these errors accumulate (via a Lipschitz-bounded propagation argument) to a total global error of order从 $x_0$ 到固定终点 $X$,欧拉步数为 $N=X/h$,量级为 $1/h$。(M1) 每步引入 $O(h^2)$ 的局部误差,这些误差通过Lipschitz有界传播论证累积,总全局误差量级为
$$ \frac{1}{h}\cdot O(h^2) = O(h). $$This is why Euler is called a first-order method: even though the per-step error is second order, the sum over $1/h$ steps costs one power of $h$, leaving a first-order global rate. (A1)这就是为什么欧拉法被称为一阶方法:虽然每步误差是二阶的,但对 $1/h$ 步求和损失了一个 $h$ 的幂次,最终全局精度为一阶。(A1)
RK4 is fourth order: its global error scales like $h^4$. Halving $h$ multiplies the error by $(1/2)^4=1/16$. (M1)RK4是四阶方法:全局误差按 $h^4$ 缩放。步长减半,误差乘以 $(1/2)^4=1/16$。(M1)
$$ \text{new error} \approx \frac{3.2\times10^{-6}}{16} = 2.0\times10^{-7}. $$(A1)
$x^2\,y''-x\,y'-3\,y=0$, $x>0$: (a) indicial equation, both roots; (b) general solution, Wronskian; (c) IVP with $y(1)=2$, $y'(1)=10$.$x^2\,y''-x\,y'-3\,y=0$,$x>0$:(a) 指标方程及两个根;(b) 通解、朗斯基行列式;(c) 满足 $y(1)=2$,$y'(1)=10$ 的初值问题。
The equation is already in standard Euler form $x^2y''+\alpha x y'+\beta y=0$ with $\alpha=-1$, $\beta=-3$. Substitute $y=x^r$ to get $y'=rx^{r-1}$, $y''=r(r-1)x^{r-2}$: (M1)方程已为标准欧拉形式 $x^2y''+\alpha x y'+\beta y=0$,其中 $\alpha=-1$,$\beta=-3$。代入 $y=x^r$,得 $y'=rx^{r-1}$,$y''=r(r-1)x^{r-2}$:(M1)
$$ x^2\cdot r(r-1)x^{r-2}-x\cdot rx^{r-1}-3x^r = \big[r(r-1)-r-3\big]x^r = 0. $$The indicial equation is $r^2-2r-3=0$, i.e. $(r-3)(r+1)=0$. (A1) The roots are指标方程为 $r^2-2r-3=0$,即 $(r-3)(r+1)=0$。(A1) 两根为
$$ r_1 = 3, \quad r_2 = -1. $$(A1) Since the roots are distinct real numbers, we proceed directly to the general solution.(A1) 两根为互不相同的实数,直接写出通解。
The two basis solutions are $y_1=x^3$ and $y_2=x^{-1}$, so (M1)两个基础解为 $y_1=x^3$ 和 $y_2=x^{-1}$,故 (M1)
$$ y = c_1 x^3 + c_2 x^{-1}. $$(A1) The Wronskian confirms independence: (A1)(A1) 朗斯基行列式确认线性无关:(A1)
$$ W = \begin{vmatrix} x^3 & x^{-1} \\ 3x^2 & -x^{-2} \end{vmatrix} = x^3(-x^{-2})-x^{-1}(3x^2) = -x - 3x = -4x \ne 0 \text{ for } x>0. $$Apply $y(1)=c_1+c_2=2$ and $y'=3c_1x^2-c_2x^{-2}$, giving $y'(1)=3c_1-c_2=10$. (M1) Adding the two equations: $4c_1=12$, so $c_1=3$ and $c_2=2-3=-1$. (A1)由 $y(1)=c_1+c_2=2$ 以及 $y'=3c_1x^2-c_2x^{-2}$ 得 $y'(1)=3c_1-c_2=10$。(M1) 两式相加:$4c_1=12$,故 $c_1=3$,$c_2=2-3=-1$。(A1)
$$ y = 3x^3 - x^{-1}. $$$y'=x^2+y$, $y(0)=1$, exact $y=3e^x-x^2-2x-2$. (a) Euler, $h=0.4$; (b) full RK4 step, $h=0.4$; (c) exact value and errors.$y'=x^2+y$,$y(0)=1$,精确解 $y=3e^x-x^2-2x-2$。(a) 欧拉法,$h=0.4$;(b) 完整RK4一步,$h=0.4$;(c) 精确值与误差。
$f(x,y)=x^2+y$. At $(0,1)$: slope $f(0,1)=0+1=1$. (M1)$f(x,y)=x^2+y$。在 $(0,1)$ 处:斜率 $f(0,1)=0+1=1$。(M1)
$$ y_1 = 1 + 0.4(1) = 1.4. \quad (A1) $$With $h=0.4$ and $f(x,y)=x^2+y$: (M1 for correct RK4 structure)取 $h=0.4$,$f(x,y)=x^2+y$:(RK4结构正确得 M1)
$$ k_1 = f(0,\ 1) = 0^2+1 = 1. \quad (A1) $$ $$ k_2 = f\!\left(0+0.2,\ 1+0.2k_1\right) = f(0.2,\ 1.2) = (0.2)^2+1.2 = 0.04+1.2 = 1.24. \quad (A1) $$ $$ k_3 = f\!\left(0+0.2,\ 1+0.2k_2\right) = f(0.2,\ 1+0.248) = f(0.2,\ 1.248) = 0.04+1.248 = 1.288. \quad (A1) $$ $$ k_4 = f\!\left(0+0.4,\ 1+0.4k_3\right) = f(0.4,\ 1+0.5152) = f(0.4,\ 1.5152) = 0.16+1.5152 = 1.6752. \quad (A1) $$ $$ y_1 = 1 + \frac{0.4}{6}(k_1+2k_2+2k_3+k_4) = 1 + \frac{0.4}{6}(1+2.48+2.576+1.6752). $$ $$ y_1 = 1 + \frac{0.4}{6}(7.7312) = 1 + \frac{3.09248}{6} = 1 + 0.51541 = 1.51541. \quad (A1) $$Exact: $y(0.4)=3e^{0.4}-(0.4)^2-2(0.4)-2=3(1.49182)-0.16-0.80-2=4.47546-2.96=1.51546$. (M1)精确值:$y(0.4)=3e^{0.4}-(0.4)^2-2(0.4)-2=3(1.49182)-0.16-0.80-2=4.47546-2.96=1.51546$。(M1)
Euler absolute error: $|1.4-1.51546|=0.11546$. RK4 absolute error: $|1.51541-1.51546|=0.00005$. (A1) RK4 is over two thousand times more accurate in a single step of the same size.欧拉绝对误差:$|1.4-1.51546|=0.11546$。RK4绝对误差:$|1.51541-1.51546|=0.00005$。(A1) 在相同步长下,RK4一步的精度比欧拉法高两千倍以上。
$y''-2xy'+4y=0$, $y(0)=1$, $y'(0)=0$. (a) recurrence; (b) even-solution coefficients; (c) polynomial identification.$y''-2xy'+4y=0$,$y(0)=1$,$y'(0)=0$。(a) 递推关系;(b) 偶次解系数;(c) 多项式识别。
With $y=\sum a_n x^n$: (M1)设 $y=\sum a_n x^n$:(M1)
$$ y'' = \sum_{n=0}^{\infty}(n+2)(n+1)a_{n+2}\,x^n, \quad -2xy'=-2\sum_{n=0}^{\infty} n\,a_n x^n, \quad 4y=4\sum_{n=0}^{\infty}a_n x^n. $$Collecting the coefficient of $x^n$: (M1)收集 $x^n$ 的系数:(M1)
$$ (n+2)(n+1)a_{n+2}+(-2n+4)a_n = 0. $$Solving for $a_{n+2}$: (A1)解出 $a_{n+2}$:(A1)
$$ a_{n+2} = \frac{2n-4}{(n+2)(n+1)}\,a_n = \frac{2(n-2)}{(n+2)(n+1)}\,a_n. $$Initial conditions: $a_0=y(0)=1$, $a_1=y'(0)=0$. (A1)初始条件:$a_0=y(0)=1$,$a_1=y'(0)=0$。(A1)
Since $a_1=0$, every odd coefficient $a_3=a_5=\cdots=0$ (the recurrence propagates zero through the odd chain). For the even chain: (M1)由于 $a_1=0$,每个奇数系数 $a_3=a_5=\cdots=0$(零通过奇数链传递)。对偶数链:(M1)
$$ a_2 = \frac{2(0-2)}{2\cdot1}\,a_0 = \frac{-4}{2} = -2, \quad a_4 = \frac{2(2-2)}{4\cdot3}\,a_2 = 0, \quad a_6 = \frac{2(4-2)}{6\cdot5}\,a_4 = 0. $$(A1 for $a_2=-2$ and $a_4=0$) The even solution is($a_2=-2$ 和 $a_4=0$ 各得 A1)偶次解为
$$ y = 1 - 2x^2. $$Because $a_4=0$ and the recurrence gives $a_{n+2}\propto a_n$, all even coefficients from $a_4$ onward vanish. The series terminates: $y=1-2x^2$ is a polynomial. (A1) Verification: $y'=-4x$, $y''=-4$, so $y''-2xy'+4y=-4-2x(-4x)+4(1-2x^2)=-4+8x^2+4-8x^2=0$. The polynomial satisfies both the ODE and both initial conditions.因为 $a_4=0$ 且递推关系给出 $a_{n+2}\propto a_n$,从 $a_4$ 起所有偶数系数均为零。级数终止:$y=1-2x^2$ 是多项式。(A1) 验证:$y'=-4x$,$y''=-4$,故 $y''-2xy'+4y=-4-2x(-4x)+4(1-2x^2)=-4+8x^2+4-8x^2=0$。该多项式满足方程和两个初始条件。
$y'=-2y$, $y(0)=1$, exact $y=e^{-2x}$, $h=0.2$. (a) Three-step table; (b) error scaling when $h$ is halved.$y'=-2y$,$y(0)=1$,精确解 $y=e^{-2x}$,$h=0.2$。(a) 三步数值表;(b) 步长减半时的误差缩放。
Euler.欧拉法。 With $f(x,y)=-2y$ and $h=0.2$, each step multiplies by $(1+h\cdot(-2))=1-0.4=0.6$: (M1)取 $f(x,y)=-2y$,$h=0.2$,每步乘以 $(1+h\cdot(-2))=1-0.4=0.6$:(M1)
$$ y_1^E = 0.6(1) = 0.6000, \quad y_2^E = 0.6(0.6000) = 0.3600, \quad y_3^E = 0.6(0.3600) = 0.2160. $$RK4.RK4法。 For $f=-2y$ and $h=0.2$, one step starting from $y_n$:取 $f=-2y$,$h=0.2$,从 $y_n$ 出发一步:
$$ k_1=-2y_n,\quad k_2=-2(y_n+0.1k_1)=-2(0.8y_n)=-1.6y_n, $$ $$ k_3=-2(y_n+0.1k_2)=-2(0.84y_n)=-1.68y_n,\quad k_4=-2(y_n+0.2k_3)=-2(0.664y_n)=-1.328y_n. $$ $$ y_{n+1}=y_n+\tfrac{0.2}{6}(-2y_n-3.2y_n-3.36y_n-1.328y_n)=y_n\!\left(1-\tfrac{0.2\cdot9.888}{6}\right)=0.6704\,y_n. $$ $$ y_1^{RK4}=0.6704,\quad y_2^{RK4}=0.4494,\quad y_3^{RK4}=0.3013. $$Exact values and completed table (B1 for Euler column; B1 for RK4 column):精确值及完整表格(欧拉列得 B1;RK4列得 B1):
| $n$ | $x_n$ | Euler $y_n$ | Euler error | RK4 $y_n$ | RK4 error | Exact $e^{-2x_n}$ |
|---|---|---|---|---|---|---|
| 0 | 0.0 | 1.0000 | 0.0000 | 1.0000 | 0.0000 | 1.0000 |
| 1 | 0.2 | 0.6000 | 0.0703 | 0.6704 | 0.0001 | 0.6703 |
| 2 | 0.4 | 0.3600 | 0.0893 | 0.4494 | 0.0001 | 0.4493 |
| 3 | 0.6 | 0.2160 | 0.0852 | 0.3013 | 0.0001 | 0.3012 |
Euler is first order ($\sim h^1$): halving $h$ multiplies the global error by $\tfrac{1}{2}$, so the Euler error decreases by a factor of approximately $2$. RK4 is fourth order ($\sim h^4$): halving $h$ multiplies the error by $(1/2)^4=\tfrac{1}{16}$, so the RK4 error decreases by a factor of approximately $16$. (A1)欧拉法为一阶($\sim h^1$):步长减半使全局误差乘以 $\tfrac{1}{2}$,欧拉误差约缩小2倍。RK4为四阶($\sim h^4$):步长减半使误差乘以 $(1/2)^4=\tfrac{1}{16}$,RK4误差约缩小16倍。(A1)