AHL 5.16b — Euler’s method for coupled systems(連立系のオイラー法)
- coupled system(連立系)が何を表しているか説明できる。
- 公式集の \(3\) 本の式を使って、\(1\) 歩ずつ表を作れる。
- 新しい値を計算するときは、古い \(x\) と古い \(y\) の両方を使うことが分かる。
- predator–prey model(捕食者・被食者モデル)の結果を読み取れる。
- equilibrium point(平衡点)を求められる。
- \((x,\ y)\) 平面の trajectory(軌道)が何を表すか分かる。
The idea
1. Coupled systems(\(2\) つの量が影響しあう連立系)
AHL 5.16a では、変わる量が \(y\) の \(1\) つだけでした。
現実には、\(2\) つの量が絡み合っている場面がよくあります。
- ウサギの数とキツネの数
- \(2\) つのタンクの水量
- 感染している人の数と、回復した人の数
ウサギが増えればキツネの餌が増え、キツネが増えればウサギが減ります。片方だけを見ていても、話が進みません。
そこで、式を \(2\) 本立てます。
\[ \frac{dx}{dt} = f_1(x,\ y,\ t), \qquad \frac{dy}{dt} = f_2(x,\ y,\ t) \]
どちらの右辺にも、\(x\) と \(y\) の両方が出てきます。 これが「連立」の意味で、このような式の組を coupled system(連立系)といいます。
AHL 5.16 の内容は、\(2\) つの部分に分かれています。
| 部分 | 中身 | ページ |
|---|---|---|
| 前半 | \(1\) つの微分方程式 \(\dfrac{dy}{dx} = f(x,\ y)\) | AHL 5.16a |
| 後半 | 連立系 \(\dfrac{dx}{dt} = f_1\)、\(\dfrac{dy}{dt} = f_2\) | このページ |
やり方は AHL 5.16a とまったく同じです。歩き方が \(1\) 本から \(2\) 本に増えるだけです。先に AHL 5.16a を読んでください。
AHL 5.16a では \(\dfrac{dy}{dx}\) で、\(x\) が独立変数でした。
連立系では、\(x\) も \(y\) も変わる量です。ですから、時間 \(t\) を独立変数にします。
\[ x = x(t), \qquad y = y(t) \]
\(t\) が \(h\) ずつ進み、そのたびに \(x\) と \(y\) の両方が動きます。
公式は \(f_1(x,\ y,\ t)\) と書いてありますが、実際の問題では \(t\) が右辺に出てこないことがほとんどです。
\[ \frac{dx}{dt} = 0.4x - 0.002xy \]
\(t\) が無くても、式の形は変わりません。 \(t\) の列は「今、何時か」を数えるためだけに使います。
2. Reading the formula(公式の読み方)
連立系で、\(x\) と \(y\) を \(1\) 歩ずつ進めるための式です。公式集の 5.16 の欄の \(2\) つ目にあるので、覚える必要はありません。
\[ \begin{aligned} x_{n+1} &= x_n + h \times f_1(x_n,\ y_n,\ t_n) \\ y_{n+1} &= y_n + h \times f_2(x_n,\ y_n,\ t_n) \\ t_{n+1} &= t_n + h \end{aligned} \tag{1}\]
ここで \(h\) は定数(刻み幅)です。
覚えておくのは、右辺にはどこも「\(n\)」しか出てこないということです(第3節)。
\(1\) 本目だけ見れば、AHL 5.16a と同じ形です。
\[ (\text{次の } x) = (\text{今の } x) + (\text{時間の幅}) \times (\text{今の } x \text{ の変化率}) \]
\(2\) 本目も同じです。\(3\) 本目は、時計を進めるだけです。
| 記号 | 意味 |
|---|---|
| \(n\) | 何歩目か |
| \(x_n,\ y_n,\ t_n\) | \(n\) 歩目の \(x\)、\(y\)、時刻 |
| \(f_1(x_n,\ y_n,\ t_n)\) | その時点での \(\dfrac{dx}{dt}\) |
| \(f_2(x_n,\ y_n,\ t_n)\) | その時点での \(\dfrac{dy}{dt}\) |
3. Updating both values together(古い値で両方を計算してから、まとめて更新する)
連立系では、\(x\) と \(y\) を同時に \(1\) 歩進めます。そのときの計算の順番が大事です。この項目で、いちばん点を落とすところです。
公式の右辺を、もう一度よく見てください。
\[ y_{n+1} = y_n + h \times f_2(\underbrace{x_n}_{\text{古い } x},\ y_n,\ t_n) \]
\(x_{n+1}\) ではなく \(x_n\) です。 つまり、
- 古い \(x_n\) と \(y_n\) を使って、\(f_1\) と \(f_2\) を両方計算する
- そのあとで、\(x\) と \(y\) を同時に新しい値に置きかえる
\(x\) を先に更新して、その新しい \(x\) で \(y\) を計算してはいけません。
例で見ます。\(\dfrac{dx}{dt} = x + 2y\)、\(\dfrac{dy}{dt} = 3x - y\)、\((x,\ y) = (1,\ 2)\)、\(h = 0.1\) とします。
\[ f_1 = 1 + 2(2) = 5, \qquad f_2 = 3(1) - 2 = 1 \]
\[ x_1 = 1 + 0.1(5) = 1.5, \qquad y_1 = 2 + 0.1(1) = 2.1 \]
\(f_2\) にも、古い \(x = 1\) を使っています。
\(f_1\) と \(f_2\) の列を、同じ行に書いてください。
| \(n\) | \(t_n\) | \(x_n\) | \(y_n\) | \(f_1\) | \(f_2\) |
|---|---|---|---|---|---|
| \(0\) | \(0\) | \(1\) | \(2\) | \(5\) | \(1\) |
| \(1\) | \(0.1\) | \(1.5\) | \(2.1\) | \(5.7\) | \(2.4\) |
| \(2\) | \(0.2\) | \(2.07\) | \(2.34\) |
\(1\) つの行の中は、すべて同じ時刻の値です。 行を作り終えてから、次の行に移ります。
行をまたいで値を持ってこない——これだけ守れば間違えません。
例題 1 Consider the coupled system
\[ \frac{dx}{dt} = x + 2y, \qquad \frac{dy}{dt} = 3x - y \]
with \(x = 1\) and \(y = 2\) when \(t = 0\).
Use Euler’s method with \(h = 0.1\) to find approximations for \(x\) and \(y\) when \(t = 0.2\).
日本語訳
上の連立系を考えます。\(t = 0\) のとき \(x = 1\)、\(y = 2\) です。
coupled system は「連立系」という意味です。
\(h = 0.1\) の Euler 法を使って、\(t = 0.2\) のときの \(x\) と \(y\) の近似値を求めなさい。
\(2\) 歩です。
\(n = 0\): \(t_0 = 0\)、\(x_0 = 1\)、\(y_0 = 2\)
\[ f_1 = 1 + 2(2) = 5, \qquad f_2 = 3(1) - 2 = 1 \]
\(2\) つとも、古い \(x = 1\) と古い \(y = 2\) で計算しました(第3節)。
\[ x_1 = 1 + 0.1(5) = 1.5, \qquad y_1 = 2 + 0.1(1) = 2.1, \qquad t_1 = 0.1 \]
\(n = 1\):
\[ f_1 = 1.5 + 2(2.1) = 5.7, \qquad f_2 = 3(1.5) - 2.1 = 2.4 \]
\[ x_2 = 1.5 + 0.1(5.7) = 2.07, \qquad y_2 = 2.1 + 0.1(2.4) = 2.34, \qquad t_2 = 0.2 \]
\[ x \approx 2.07, \qquad y \approx 2.34 \]
検算。 \(f_1\) も \(f_2\) も正なので、\(x\) と \(y\) のどちらも増えるはずです。\(1 \to 1.5 \to 2.07\)、\(2 \to 2.1 \to 2.34\) ✓
\(2\) 歩目の \(f_2\) は \(3(1.5) - 2.1\) です。ここでの \(1.5\) は、\(1\) 歩目で確定した \(x_1\) なので正しい値です。
間違えるのは \(1\) 歩目のほうです。\(f_2 = 3(1) - 2\) であって、\(3(1.5) - 2\) ではありません(第3節)。
| \(n\) | \(t_n\) | \(x_n\) | \(y_n\) | \(f_1 = x_n + 2y_n\) | \(f_2 = 3x_n - y_n\) |
|---|---|---|---|---|---|
| \(0\) | \(0\) | \(1\) | \(2\) | \(5\) | \(1\) |
| \(1\) | \(0.1\) | \(1.5\) | \(2.1\) | \(5.7\) | \(2.4\) |
| \(2\) | \(0.2\) | \(2.07\) | \(2.34\) |
\[ x \approx 2.07, \qquad y \approx 2.34 \]
例題 2 A student solves the system of 例 1 and writes:
\(f_1 = 1 + 2(2) = 5\), so \(x_1 = 1.5\).
Then \(f_2 = 3(1.5) - 2 = 2.5\), so \(y_1 = 2 + 0.1(2.5) = 2.25\).
(a) Identify the error in the student’s method.
(b) Explain why this method gives the wrong value.
(a)
試験ではこう書く
The student has used the new value \(x_1 = 1.5\) when calculating \(f_2\).
The formula requires \(f_2(x_n,\ y_n,\ t_n)\), that is the OLD value \(x_0 = 1\).
The correct calculation is \(f_2 = 3(1) - 2 = 1\), giving \(y_1 = 2.1\).
(生徒は \(f_2\) を計算するときに新しい値 \(x_1 = 1.5\) を使ってしまっている。公式が要求しているのは \(f_2(x_n,\ y_n,\ t_n)\)、つまり古い値 \(x_0 = 1\) である。正しい計算は \(f_2 = 3(1) - 2 = 1\) で、\(y_1 = 2.1\) となる、という意味です。)
(b)
試験ではこう書く
Both derivatives describe the rates of change at the same instant \(t = 0\).
The value \(x_1 = 1.5\) belongs to the later time \(t = 0.1\), so mixing it into \(f_2\) combines two different moments and the step no longer follows the system.
(どちらの derivative(導関数)も、同じ瞬間 \(t = 0\) における変化率を表している。\(x_1 = 1.5\) は後の時刻 \(t = 0.1\) の値なので、それを \(f_2\) に混ぜると \(2\) つの異なる瞬間を組み合わせることになり、その \(1\) 歩はもう系に従っていない、という意味です。)
検算。 正しい \(y_1\) は \(2.1\)、生徒の \(y_1\) は \(2.25\) です。差は \(0.15\) で、\(1\) 歩目からすでにずれています ✓ このずれは、あとの歩にそのまま持ち越されます。
スプレッドシートで y の列の式に、同じ行の新しい x を参照してしまうと、まったく同じことが起こります。
参照するのは、いつも \(1\) つ上の行です(GDC 第1節)。
(a)
The student used the new value \(x_1 = 1.5\) in \(f_2\).
The formula uses \(f_2(x_n,\ y_n,\ t_n)\), so the old value \(x_0 = 1\) is required: \(f_2 = 3(1) - 2 = 1\) and \(y_1 = 2.1\).
(b)
Both rates of change are evaluated at the same instant \(t = 0\).
Using \(x_1\), which belongs to \(t = 0.1\), mixes two different times.
4. Predator–prey models(捕食者と被食者のモデル)
連立系がよく使われる場面の \(1\) つが、predator–prey model(捕食者・被食者モデル)です。\(x\) を prey(被食者、餌になる動物)、\(y\) を predator(捕食者)とします。
\[ \frac{dx}{dt} = 0.4x - 0.002xy, \qquad \frac{dy}{dt} = -0.3y + 0.001xy \]
それぞれの項に意味があります。
| 項 | 意味 |
|---|---|
| \(+0.4x\) | 捕食者がいなければ、prey は増える |
| \(-0.002xy\) | 出会うと食べられる(\(x\) と \(y\) の積) |
| \(-0.3y\) | 餌がなければ、predator は減る |
| \(+0.001xy\) | 食べたぶん、predator が増える |
なぜ \(x + y\) ではなく \(xy\) なのでしょうか。
出会う回数は、両方の数に比例するからです。ウサギが \(2\) 倍いれば出会いは \(2\) 倍、キツネも \(2\) 倍なら \(4\) 倍です。
\[ (\text{出会う回数}) \propto x \times y \]
片方が \(0\) なら、出会いは \(0\) です。 \(x + y\) ではそうなりません。
\(-0.002xy\) と \(+0.001xy\) です。捕食者にとっては得、被食者にとっては損だからです。
係数も同じとはかぎりません。 ウサギ \(1\) 匹でキツネが \(1\) 匹増えるわけではないので、\(0.002\) と \(0.001\) のように違う数になります。
5. Interpreting the results(結果の読み方)
Euler’s method で計算した \(x\) と \(y\) を、時間 \(t\) に対してグラフにすると、\(2\) つの量の動き方が見えます。
図 1 の (a) は \(h = 1\)、(b) は \(h = 0.005\) です。\(h\) を小さくすると、なめらかな周期的な動きが見えてきます。
図 2 が、この動きの中身です。
\(4\) つの段階がくり返されます。
- prey が増える(捕食者がまだ少ない)
- 餌が多いので、predator が増える
- 捕食者が多いので、prey が減る
- 餌が減って、predator も減る → 1 へ戻る
図 2 の左を見てください。\(x\) のピークが先、\(y\) のピークが後です。
理由は \(1\) つです。捕食者が増えるには、まず餌が増えている必要があるからです。
Describe the relationship between the two populations と問われたら、こう書きます。
試験ではこう書く
Both populations rise and fall in a repeating cycle of the same period.
The prey population reaches its maximum first, and the predator population reaches its maximum a short time later, because the predators can only increase once there is plenty of prey to eat.
(どちらの個体数も同じ周期でくり返し増減する。被食者の個体数が先に最大となり、捕食者の個体数はその少しあとに最大となる。捕食者は、食べる被食者が十分にいてはじめて増えられるからである、という意味です。)
6. Equilibrium points(平衡点)
両方の変化率が同時に \(0\) になる点を、equilibrium point(平衡点)といいます。
平衡点は、AHL 5.17a の phase portrait(相図)のところで、くわしく扱います。
ただし、Euler の表が正しいかを判断するのにとても役に立つので、ここで先に扱います。
\[ \frac{dx}{dt} = 0 \quad \text{かつ} \quad \frac{dy}{dt} = 0 \]
上のモデルなら
\[ 0.4x - 0.002xy = 0 \ \Longrightarrow \ x(0.4 - 0.002y) = 0 \ \Longrightarrow \ y = 200 \]
\[ -0.3y + 0.001xy = 0 \ \Longrightarrow \ y(-0.3 + 0.001x) = 0 \ \Longrightarrow \ x = 300 \]
平衡点は \((300,\ 200)\) です。
\(0.4x - 0.002xy = 0\) の両辺を \(x\) で割りたくなりますが、\(x = 0\) の場合を落とします。
\[ x(0.4 - 0.002y) = 0 \ \Longrightarrow \ x = 0 \ \text{または} \ y = 200 \]
\((0,\ 0)\) も平衡点です。 どちらもいなければ、何も起こりません。
問題が聞いているのはふつうもう \(1\) つのほうですが、\(x = 0\) を書き落とさないでください。
例題 3 In a nature reserve, \(x\) is the number of rabbits and \(y\) is the number of foxes, both after \(t\) years. They are modelled by
\[ \frac{dx}{dt} = 0.4x - 0.002xy, \qquad \frac{dy}{dt} = -0.3y + 0.001xy. \]
Initially there are \(400\) rabbits and \(100\) foxes.
(a) Use Euler’s method with \(h = 1\) to estimate the two populations after \(2\) years.
(b) Find the equilibrium point of the system, other than \((0,\ 0)\).
(c) Interpret the term \(-0.002xy\) in the first equation.
日本語訳
自然保護区で、\(t\) 年後のウサギの数を \(x\)、キツネの数を \(y\) とします。上の式でモデル化されています。
nature reserve は「自然保護区」、rabbits は「ウサギ」、foxes は「キツネ」という意味です。
はじめ、ウサギが \(400\) 匹、キツネが \(100\) 匹います。
(a) \(h = 1\) の Euler 法を使って、\(2\) 年後の \(2\) つの個体数を推定しなさい。
(b) \((0,\ 0)\) 以外の平衡点を求めなさい。
(c) \(1\) 本目の式の \(-0.002xy\) の項を解釈しなさい。
(a) \(n = 0\): \(t_0 = 0\)、\(x_0 = 400\)、\(y_0 = 100\)
\[ f_1 = 0.4(400) - 0.002(400)(100) = 160 - 80 = 80 \]
\[ f_2 = -0.3(100) + 0.001(400)(100) = -30 + 40 = 10 \]
\[ x_1 = 400 + 1(80) = 480, \qquad y_1 = 100 + 1(10) = 110 \]
\(n = 1\):
\[ f_1 = 0.4(480) - 0.002(480)(110) = 192 - 105.6 = 86.4 \]
\[ f_2 = -0.3(110) + 0.001(480)(110) = -33 + 52.8 = 19.8 \]
\[ x_2 = 480 + 86.4 = 566.4, \qquad y_2 = 110 + 19.8 = 129.8 \]
\(2\) 年後、ウサギがおよそ \(566\) 匹、キツネがおよそ \(130\) 匹です。
(b) 第6節のとおりです。
\[ x(0.4 - 0.002y) = 0 \ \Longrightarrow \ y = 200 \quad (x \neq 0) \]
\[ y(-0.3 + 0.001x) = 0 \ \Longrightarrow \ x = 300 \quad (y \neq 0) \]
平衡点は \((300,\ 200)\) です。
(c)
試験ではこう書く
The term \(-0.002xy\) is the rate at which rabbits are lost to foxes.
It is negative because rabbits are removed, and it depends on the product \(xy\) because the number of encounters between rabbits and foxes depends on how many there are of each.
(\(-0.002xy\) の項は、キツネによってウサギが失われる割合である。ウサギが減るので負であり、ウサギとキツネの出会いの回数は両方の数によって決まるので、積 \(xy\) に依存する、という意味です。)
検算。 はじめ \(x = 400 > 300\)、\(y = 100 < 200\) です。平衡点よりウサギが多く、キツネが少ない状態なので、両方増えるはずです ✓ \(400 \to 480 \to 566\)、\(100 \to 110 \to 130\) で、向きが合っています。
図 1 の (a) がその粗さです。\(2\) 歩ぶんなら大きくは外れませんが、\(20\) 年ぶんを \(h = 1\) で計算した値は信用できません。
Comment on the reliability と問われたら、そこを書いてください(Why it works)。
(a)
| \(n\) | \(t_n\) | \(x_n\) | \(y_n\) | \(f_1\) | \(f_2\) |
|---|---|---|---|---|---|
| \(0\) | \(0\) | \(400\) | \(100\) | \(80\) | \(10\) |
| \(1\) | \(1\) | \(480\) | \(110\) | \(86.4\) | \(19.8\) |
| \(2\) | \(2\) | \(566.4\) | \(129.8\) |
About \(566\) rabbits and \(130\) foxes.
(b) \[ x(0.4 - 0.002y) = 0 \ \Rightarrow \ y = 200; \qquad y(-0.3 + 0.001x) = 0 \ \Rightarrow \ x = 300 \] The equilibrium point is \((300,\ 200)\).
(c)
It is the rate at which rabbits are eaten by foxes.
It is negative because rabbits are lost, and it depends on \(xy\) because the number of encounters depends on both populations.
7. Trajectories(\((x,\ y)\) 平面に描く)
時間 \(t\) を使わずに、\(x\) を横軸、\(y\) を縦軸にとって点を並べることもできます。
図 3 は、時間を消して \(x\) と \(y\) だけを描いたものです。この曲線を trajectory(軌道)といいます。
閉じた輪になっています。 同じところをぐるぐる回る——それが「周期的」ということです。
図 2 の右に矢印を入れてあります。反時計回りです。
\(x\) がいちばん大きい点(右端)では、prey が最大です。そこでは predator がまだ増えている最中なので、\(y\) が上がります。
右端で上向きなら、反時計回りです。
\(1\) 点だけ調べれば、向きが決まります。
この \((x,\ y)\) 平面の図を、AHL 5.17a では相図と呼んで、くわしく扱います。
AHL 5.16 では、Euler で出した点を並べて描くところまでです。
例題 4 図 2 shows the two populations of 例 3 over a longer time, computed with a small step length.
(a) Describe the relationship between the two populations.
(b) The right-hand diagram shows the same information plotted as \((x,\ y)\). Explain what it means that this path is a closed loop.
(c) Suggest why the estimate in 例 3, which used \(h = 1\), may not be reliable over \(20\) years.
日本語訳
図 2 は、例 3 の \(2\) つの個体数を、小さい刻み幅で長い時間について計算したものです。
a closed loop は「閉じた輪」という意味です。
(a) \(2\) つの個体数の関係を述べなさい。
(b) 右の図は同じ情報を \((x,\ y)\) として描いたものです。この経路が閉じた輪であることが何を意味するかを説明しなさい。
(c) 例 3 の \(h = 1\) を使った推定が、\(20\) 年にわたっては信用できないかもしれない理由を述べなさい。
(a)
試験ではこう書く
Both populations rise and fall in a repeating cycle with the same period.
The rabbit population reaches its maximum first, and the fox population reaches its maximum a short time afterwards, because the foxes can only increase once there are plenty of rabbits.
(どちらの個体数も同じ周期でくり返し増減する。ウサギの個体数が先に最大となり、キツネの個体数はその少しあとに最大となる。キツネはウサギが十分にいてはじめて増えられるからである、という意味です。)
(b)
試験ではこう書く
A closed loop means the pair \((x,\ y)\) returns to exactly the values it started from, so the whole cycle repeats.
The two populations are periodic and neither dies out nor grows without limit.
(閉じた輪は、組 \((x,\ y)\) が出発したときの値にちょうど戻ることを意味し、したがって周期全体がくり返される。\(2\) つの個体数は周期的で、絶滅もせず、限りなく増えもしない、という意味です。)
(c)
試験ではこう書く
With \(h = 1\) year, twenty steps would be needed and each one follows a straight line while the true solution curves.
The errors build up, and over a full cycle the estimated path drifts away from the true closed loop, so the values after \(20\) years could be well out.
(\(h = 1\) 年では \(20\) 歩が必要で、真の解が曲がるあいだ、それぞれの歩は直線をたどる。誤差が積み重なり、\(1\) 周を通じて推定された経路は真の閉じた輪から離れていくので、\(20\) 年後の値はかなりずれる可能性がある、という意味です。)
検算。 図 4 が、まさにその様子です ✓ \(h = 0.5\) でも外へ広がっているので、\(h = 1\) ならもっと大きくずれます。
(a)
Both populations cycle with the same period.
The rabbits peak first and the foxes peak shortly afterwards, since the foxes can only increase when there are plenty of rabbits.
(b)
The pair \((x,\ y)\) returns to its starting values, so the behaviour repeats.
Both populations are periodic; neither dies out nor grows without limit.
(c)
Twenty steps of straight-line approximation would be needed, and the errors accumulate, so the estimated path drifts away from the true cycle.
8. Using a spreadsheet(スプレッドシートで計算する)
連立系の Euler’s method は、スプレッドシートで計算するのがふつうです。歩数が増えるので、手で解くのは \(2\)〜\(3\) 歩までです。
列は \(3\) つ(\(t\)、\(x\)、\(y\))で足ります。\(f_1\) と \(f_2\) は式の中に入れてしまうので、列にしなくても構いません。やり方は GDC 第1節です。
Why it works
\(1\) 本のときと、まったく同じ理屈です
AHL 5.16a で見たとおり、\(h\) が小さいとき
\[ x(t+h) \approx x(t) + h \times \frac{dx}{dt} \]
が成り立ちます。この式は \(x\) についてのものです。 \(y\) についても、同じことが別に成り立ちます。
\[ y(t+h) \approx y(t) + h \times \frac{dy}{dt} \]
\(2\) 本を並べて、同じ \(h\) で同時に進めるだけです。新しい考え方は要りません。
なぜ「古い値」で計算するのか
上の \(2\) 本の式で、右辺の \(\dfrac{dx}{dt}\) と \(\dfrac{dy}{dt}\) は、どちらも時刻 \(t\) での値です。
時刻 \(t\) での \(\dfrac{dy}{dt}\) を出すには、時刻 \(t\) での \(x\) が要ります。\(t + h\) での \(x\) ではありません。
新しい \(x\) を使ってしまうと、\(2\) 本の式が「同じ瞬間」の話でなくなります。 それが 第3節 の間違いです。
\(h\) が大きいと、輪が閉じません
図 4 を見てください。\(h = 0.5\) の軌道は、外へ外へと広がっています。
本当の解は閉じた輪なのに、Euler の折れ線は毎回輪の外側へはみ出します。tangent(接線)が輪の外を通るからです。
そのずれが \(1\) 周ごとにたまって、渦巻きになります。
このふるまいは AI HL では問われません。 ただし、Comment on the reliability of your answer と聞かれたときに、「\(h\) が大きいと長い時間では信用できない」と書ける材料になります。
この弱点を減らす、もっと精度の高い方法として Runge–Kutta methods(ルンゲ・クッタ法)があります。試験には出ません。
Common errors
AHL 5.16a と同じです。\(x_{n+1} = x_n + h \times f_1\) です。
\(3\) 本目の式 \(t_{n+1} = t_n + h\) も公式のうちです。「何年後か」を答えるのに要ります。
出会いの回数は積に比例します(第4節)。
被食者側は \(-\)、捕食者側は \(+\) です(第4節)。
\(xy\) の項がある predator–prey の形では、\(\dfrac{dx}{dt} = 0\) から出るのが \(y\) の値、\(\dfrac{dy}{dt} = 0\) から出るのが \(x\) の値です(第6節)。ほかの形では、そうなるとはかぎりません。
答えは \((300,\ 200)\) という点です(第6節)。
\(x = 0\) かつ \(y = 0\) も平衡点です(第6節)。
prey が先、predator が後です(第5節)。
連立系では、誤差が \(1\) 周ごとにたまります(Why it works)。
Using your GDC (TI-Nspire CX II)
Lists & Spreadsheet は Press-to-Test で止められていません(AHL 5.16a)。ここで説明する方法は、試験でもそのまま使えます。
Setting up the spreadsheet(スプレッドシートを作る)
ctrl + doc → Add Lists & Spreadsheet
例 3(\(h = 1\))を例にします。
| セル | 入れるもの |
|---|---|
A1 |
0 |
B1 |
400 |
C1 |
100 |
A2 |
=a1+1 |
B2 |
=b1+1*(0.4*b1-0.002*b1*c1) |
C2 |
=c1+1*(-0.3*c1+0.001*b1*c1) |
A2、B2、C2 を選んで、下へコピーします。
menu → Data → Fill
うまく選べないときは、列ごとに \(1\) つずつ Fill してください。結果は同じです。
B2 も C2 も、参照するのは \(1\) 行上だけです
a1、b1、c1 です。a[] は列ぜんぶを指すので、ここでは使えません(AHL 5.16a)。
Plotting the trajectory(\((x,\ y)\) の軌道を描く)
列 B と C ができたら、scatter diagram(散布図)にすれば 図 3 の形が出ます。
ctrl + doc → Add Data & Statistics
\(x\) 軸に列 B、\(y\) 軸に列 C を割りあてます。
列のいちばん上のグレーの行に t、x、y と打っておくと、Data & Statistics で選びやすくなります(SL 4.2)。
Checking your answers(答えの確かめ方)
電卓で作った表は、次の \(3\) つで確かめます。
- 符号が場面に合っているか(増えるはずのものが増えているか)
- 平衡点を計算して、そこを中心に回っているか
- \(h\) を半分にして、答えが大きく変わらないか
例 3 なら \((300,\ 200)\) です。
表の \(x\) が \(300\) より大きく、\(y\) が \(200\) より小さいうちは、両方増えるはずです。表がそうなっていなければ、どこかで間違えています。
Exercises
1 Consider \(\dfrac{dx}{dt} = 2x - y\) and \(\dfrac{dy}{dt} = x + 3y\), with \(x = 1\) and \(y = 0\) when \(t = 0\).
Use Euler’s method with \(h = 0.1\) to find \(x\) and \(y\) after one step.
日本語訳
\(\dfrac{dx}{dt} = 2x - y\)、\(\dfrac{dy}{dt} = x + 3y\)、\(t = 0\) のとき \(x = 1\)、\(y = 0\)、を考えます。
\(h = 0.1\) の Euler 法で、\(1\) 歩後の \(x\) と \(y\) を求めなさい。
\[ f_1 = 2(1) - 0 = 2, \qquad f_2 = 1 + 3(0) = 1 \] \[ x_1 = 1 + 0.1(2) = 1.2, \qquad y_1 = 0 + 0.1(1) = 0.1, \qquad t_1 = 0.1 \]
2 For the same system as question 1, find \(x\) and \(y\) when \(t = 0.2\).
日本語訳
問題1と同じ系について、\(t = 0.2\) のときの \(x\) と \(y\) を求めなさい。
| \(n\) | \(t_n\) | \(x_n\) | \(y_n\) | \(f_1 = 2x_n - y_n\) | \(f_2 = x_n + 3y_n\) |
|---|---|---|---|---|---|
| \(0\) | \(0\) | \(1\) | \(0\) | \(2\) | \(1\) |
| \(1\) | \(0.1\) | \(1.2\) | \(0.1\) | \(2.3\) | \(1.5\) |
| \(2\) | \(0.2\) | \(1.43\) | \(0.25\) |
\[ x \approx 1.43, \qquad y \approx 0.25 \]
\(2\) 歩目の \(f\) は、\(1\) 歩目で確定した \(x_1 = 1.2\)、\(y_1 = 0.1\) で計算します。
\[ f_1 = 2(1.2) - 0.1 = 2.3, \qquad f_2 = 1.2 + 3(0.1) = 1.5 \]
\[ x_2 = 1.2 + 0.23 = 1.43, \qquad y_2 = 0.1 + 0.15 = 0.25 \]
検算。 \(y\) の増え方が速くなっています(\(0.1 \to 0.15\))。\(f_2 = x + 3y\) で、\(x\) も \(y\) も増えているので、向きが合っています ✓
3 A student solving question 1 writes:
\(f_1 = 2 - 0 = 2\), so \(x_1 = 1.2\). Then \(f_2 = 1.2 + 3(0) = 1.2\), so \(y_1 = 0.12\).
Identify the error, and state the correct value of \(y_1\).
日本語訳
問題1を解いているある生徒が、上のように書きました。
誤りを指摘し、\(y_1\) の正しい値を述べなさい。
The student used the new value \(x_1 = 1.2\) when calculating \(f_2\).
Euler’s method requires \(f_2(x_n,\ y_n,\ t_n)\), that is the old value \(x_0 = 1\).
\[ f_2 = 1 + 3(0) = 1, \qquad y_1 = 0 + 0.1(1) = 0.1 \]
4 In a lake, \(x\) is the number of small fish and \(y\) is the number of large fish, both after \(t\) years. They are modelled by
\[ \frac{dx}{dt} = 0.5x - 0.004xy, \qquad \frac{dy}{dt} = -0.2y + 0.002xy. \]
Initially \(x = 200\) and \(y = 50\).
Use Euler’s method with \(h = 1\) to estimate both populations after \(2\) years.
日本語訳
湖で、\(t\) 年後の小さい魚の数を \(x\)、大きい魚の数を \(y\) とします。上の式でモデル化されています。
はじめ \(x = 200\)、\(y = 50\) です。
\(h = 1\) の Euler 法を使って、\(2\) 年後の両方の個体数を推定しなさい。
| \(n\) | \(t_n\) | \(x_n\) | \(y_n\) | \(f_1\) | \(f_2\) |
|---|---|---|---|---|---|
| \(0\) | \(0\) | \(200\) | \(50\) | \(60\) | \(10\) |
| \(1\) | \(1\) | \(260\) | \(60\) | \(67.6\) | \(19.2\) |
| \(2\) | \(2\) | \(327.6\) | \(79.2\) |
About \(328\) small fish and \(79\) large fish.
\[ f_1 = 0.5(200) - 0.004(200)(50) = 100 - 40 = 60 \]
\[ f_2 = -0.2(50) + 0.002(200)(50) = -10 + 20 = 10 \]
\[ x_1 = 260, \qquad y_1 = 60 \]
\[ f_1 = 0.5(260) - 0.004(260)(60) = 130 - 62.4 = 67.6 \]
\[ f_2 = -0.2(60) + 0.002(260)(60) = -12 + 31.2 = 19.2 \]
\[ x_2 = 327.6, \qquad y_2 = 79.2 \]
魚は整数なので、答えは整数で書きます。
検算。 平衡点は問題5で求めますが、\((100,\ 125)\) です。はじめ \(x = 200 > 100\)、\(y = 50 < 125\) なので、両方増えるはずです ✓
5 For the system in question 4, find the equilibrium point at which neither population is zero.
日本語訳
問題4の系について、どちらの個体数も \(0\) でない平衡点を求めなさい。
\[ 0.5x - 0.004xy = 0 \ \Longrightarrow \ x(0.5 - 0.004y) = 0 \ \Longrightarrow \ y = 125 \] \[ -0.2y + 0.002xy = 0 \ \Longrightarrow \ y(-0.2 + 0.002x) = 0 \ \Longrightarrow \ x = 100 \] The equilibrium point is \((100,\ 125)\).
第6節のとおりです。
\(1\) 本目から \(y\)、\(2\) 本目から \(x\) が出ます。入れ替わります。
\[ y = \frac{0.5}{0.004} = 125, \qquad x = \frac{0.2}{0.002} = 100 \]
検算。 \((100,\ 125)\) を両方の式に入れると
\[ 0.5(100) - 0.004(100)(125) = 50 - 50 = 0 \ ✓ \]
\[ -0.2(125) + 0.002(100)(125) = -25 + 25 = 0 \ ✓ \]
両方 \(0\) になりました。 これが平衡点の定義です。
6 図 2 shows a predator–prey model over time.
(a) State which population reaches its maximum first.
(b) Explain why this happens.
(a) The prey population \(x\) reaches its maximum first.
(b)
The predators can only increase while there is plenty of prey to eat.
So the predator numbers keep rising after the prey numbers have started to fall, and the predator maximum comes later.
Once the prey has fallen far enough, the predators begin to decrease as well.
第5節のとおりです。
「捕食者は、餌があってはじめて増える」——この \(1\) 文が理由です。
検算。 図の左で、赤(prey)の点線が青(predator)の点線より左にあります ✓ \(x\) のピークが \(t \approx 22\)、\(y\) のピークが \(t \approx 25.5\) です。
\(2\) つのグラフはずれています。 そのずれこそが、このモデルの中身です。
7 The trajectory of a predator–prey system in the \((x,\ y)\) plane is a closed loop around its equilibrium point.
(a) At the point where \(x\) is largest, state whether \(y\) is increasing or decreasing, giving a reason.
(b) Hence state the direction in which the trajectory is traced.
日本語訳
ある predator–prey 系の \((x,\ y)\) 平面における軌道は、平衡点のまわりの閉じた輪です。
trajectory は「軌道」、traced は「たどられる」という意味です。
(a) \(x\) が最大になる点で、\(y\) が増加しているか減少しているかを、理由を付けて述べなさい。
(b) したがって、軌道がたどられる向きを述べなさい。
(a)
At that point the prey population is at its largest, so there is plenty of food and the predators are still increasing.
Therefore \(y\) is increasing.
(b) The trajectory is traced anticlockwise.
8 Two tanks are connected. The volume of liquid in tank A is \(a\) litres and in tank B is \(b\) litres, after \(t\) minutes. They satisfy
\[ \frac{da}{dt} = -0.2a + 0.1b, \qquad \frac{db}{dt} = 0.2a - 0.3b. \]
Initially \(a = 100\) and \(b = 0\).
(a) Use Euler’s method with \(h = 1\) to estimate \(a\) and \(b\) after \(2\) minutes.
(b) Explain what the term \(0.2a\) represents in each equation.
日本語訳
\(2\) つのタンクがつながっています。\(t\) 分後のタンク A の液量を \(a\) リットル、タンク B を \(b\) リットルとします。上の式を満たします。
connected は「つながっている」、tank は「タンク」という意味です。
はじめ \(a = 100\)、\(b = 0\) です。
(a) \(h = 1\) の Euler 法で、\(2\) 分後の \(a\) と \(b\) を推定しなさい。
(b) それぞれの式で \(0.2a\) の項が何を表すかを説明しなさい。
(a)
| \(n\) | \(t_n\) | \(a_n\) | \(b_n\) | \(f_1\) | \(f_2\) |
|---|---|---|---|---|---|
| \(0\) | \(0\) | \(100\) | \(0\) | \(-20\) | \(20\) |
| \(1\) | \(1\) | \(80\) | \(20\) | \(-14\) | \(10\) |
| \(2\) | \(2\) | \(66\) | \(30\) |
\[ a \approx 66 \ \text{litres}, \qquad b \approx 30 \ \text{litres} \]
(b)
The term \(0.2a\) is the rate at which liquid flows out of tank A and into tank B.
It is negative in the first equation because that liquid leaves A, and positive in the second because the same liquid arrives in B.
\[ f_1 = -0.2(100) + 0.1(0) = -20, \qquad f_2 = 0.2(100) - 0.3(0) = 20 \]
\[ a_1 = 80, \qquad b_1 = 20 \]
\[ f_1 = -0.2(80) + 0.1(20) = -16 + 2 = -14 \]
\[ f_2 = 0.2(80) - 0.3(20) = 16 - 6 = 10 \]
\[ a_2 = 66, \qquad b_2 = 30 \]
(b) 同じ項が、片方では \(-\)、もう片方では \(+\) で出てきます。移動する液体だからです。
検算。 はじめ合計は \(100\) です。\(1\) 分後は \(80 + 20 = 100\) ✓ しかし \(2\) 分後は \(66 + 30 = 96\) で、減っています。
これは間違いではありません。\(2\) 本の式を足すと
\[ \frac{d}{dt}(a + b) = (-0.2a + 0.1b) + (0.2a - 0.3b) = -0.2b \]
となります。\(B\) から出ていく \(0.3b\) のうち、\(0.1b\) は A に戻り、残りの \(0.2b\) が系の外へ出ていきます。
\(1\) 分後に \(b = 20\) なので、次の \(1\) 分で減るのは \(0.2 \times 20 = 4\) です。\(100 - 4 = 96\) ✓ 合っています。
係数が対称でないときは、中身が外へ出ていくモデルです。式をよく見てください。
9 For a predator–prey system, Euler’s method with \(h = 2\) produces a trajectory that spirals outwards, while \(h = 0.1\) produces a closed loop.
(a) Explain why the two results differ.
(b) State which result is more likely to be correct, giving a reason.
日本語訳
ある predator–prey 系について、\(h = 2\) の Euler 法では外へ渦を巻く軌道が出て、\(h = 0.1\) では閉じた輪が出ました。
spirals outwards は「外へ渦を巻く」という意味です。
(a) \(2\) つの結果が異なる理由を説明しなさい。
(b) どちらの結果がより正しそうかを、理由を付けて述べなさい。
(a)
Euler’s method follows a straight line for each step, while the true trajectory curves.
With \(h = 2\) each straight piece is long, so it leaves the true loop by a large amount, and these errors build up around the loop into a spiral.
With \(h = 0.1\) each piece is short and stays close to the true path.
(b)
The result with \(h = 0.1\) is more likely to be correct, because a smaller step length gives a smaller error at every step.
Why it works の内容です。
図 4 が、まさにこの絵です。
(b) giving a reason なので、「\(h\) が小さいほうが誤差が小さい」まで書きます。
検算。 AHL 5.16a で見たとおり、誤差は \(h\) にほぼ比例します。\(h = 2\) と \(h = 0.1\) では \(20\) 倍の違いです ✓
10 A disease spreads in a school. The number of infected students is \(x\) and the number of recovered students is \(y\), both after \(t\) days. They are modelled by
\[ \frac{dx}{dt} = 0.3x - 0.1x, \qquad \frac{dy}{dt} = 0.1x. \]
(a) Use Euler’s method with \(h = 1\) and \(x = 20\), \(y = 0\) at \(t = 0\) to estimate \(x\) and \(y\) after \(3\) days.
(b) Explain why the term \(0.1x\) appears in both equations, with opposite signs in effect.
(c) Comment on whether this model is realistic for a school of \(500\) students over a long period.
日本語訳
学校で病気が広がっています。\(t\) 日後の感染している生徒の数を \(x\)、回復した生徒の数を \(y\) とします。上の式でモデル化されています。
disease は「病気」、infected は「感染した」、recovered は「回復した」という意味です。
(a) \(h = 1\)、\(t = 0\) のとき \(x = 20\)、\(y = 0\) として、Euler 法で \(3\) 日後の \(x\) と \(y\) を推定しなさい。
(b) \(0.1x\) の項が両方の式に、実質的に逆の符号で現れる理由を説明しなさい。
(c) \(500\) 人の学校について、長期間にわたってこのモデルが現実的かどうかコメントしなさい。
(a) Here \(f_1 = 0.3x - 0.1x = 0.2x\) and \(f_2 = 0.1x\).
| \(n\) | \(t_n\) | \(x_n\) | \(y_n\) | \(f_1 = 0.2x_n\) | \(f_2 = 0.1x_n\) |
|---|---|---|---|---|---|
| \(0\) | \(0\) | \(20\) | \(0\) | \(4\) | \(2\) |
| \(1\) | \(1\) | \(24\) | \(2\) | \(4.8\) | \(2.4\) |
| \(2\) | \(2\) | \(28.8\) | \(4.4\) | \(5.76\) | \(2.88\) |
| \(3\) | \(3\) | \(34.56\) | \(7.28\) |
About \(35\) infected and \(7\) recovered.
(b)
The term \(0.1x\) is the rate at which infected students recover.
They leave the infected group, which is why it is subtracted in the first equation, and they join the recovered group, which is why it is added in the second.
(c)
The model is not realistic over a long period.
Since \(\dfrac{dx}{dt} = 0.2x\), the number of infected students grows exponentially without limit, so it would eventually exceed \(500\), which is impossible.
A realistic model would slow the spread as the number of students still available to infect runs out.
(a) \(f_1\) をまとめてから使ってください。 \(0.3x - 0.1x = 0.2x\) です。
\[ x_1 = 20 + 1(4) = 24, \qquad y_1 = 0 + 1(2) = 2 \]
\[ x_2 = 24 + 4.8 = 28.8, \qquad y_2 = 2 + 2.4 = 4.4 \]
\[ x_3 = 28.8 + 5.76 = 34.56, \qquad y_3 = 4.4 + 2.88 = 7.28 \]
人数なので、答えは整数にします。
(b) 移る人は、消えるのではなく、移動します。 問題8のタンクと同じ考え方です。
(c) Comment on whether ... realistic なので、弱点を具体的に書きます。
この式は \(\dfrac{dx}{dt} = 0.2x\) なので、AHL 5.14 の指数増加そのものです。上限がありません。
検算。 \(x\) が毎回 \(1.2\) 倍になっています。\(20 \to 24 \to 28.8 \to 34.56\) ✓ \(20 \times 1.2^3 = 34.56\) で一致します。
この調子だと、Euler の表の値が \(500\) を超えるのは \(20 \times 1.2^n > 500\)、つまり \(n \geq 18\) のときです。\(18\) 日目に学校の全員を超えてしまいます。
(式そのもの \(x = 20e^{0.2t}\) で計算すると \(t = 16.1\) 日です。Euler の値のほうが小さめなので、こちらのほうが遅く見えています。)
\(1\) 本目の右辺に \(y\) が入っていないので、\(x\) だけで完結しています。\(y\) は \(x\) から決まるだけです。
例 3 のように互いに影響しあうのが、連立系の本来の姿です。式をよく見て、どちらの型かを見分けてください。