NSolveODE コマンド

NSolveODE( <導関数のリスト>, <x座標の初期値>, <y座標の初期値のリスト>, <x座標の終端値> )

連立微分方程式を(数値的に)解く.

f'(t, f, g, h) = g

g'(t, f, g, h) = h

h'(t, f, g, h) = -t h + 3t g + 2f + t

NSolveODE({f', g', h'}, 0, {1,2,-2}, 10)

NSolveODE({f', g', h'}, 0, {1,2,-2}, -5) (システムを時間の逆方向に解く).

x1'(t, x1, x2, x3, x4) = x2

x2'(t, x1, x2, x3, x4) = x3

x3'(t, x1, x2, x3, x4) = x4

x4'(t, x1, x2, x3, x4) = -8x1 + sin(t) x2 - 3x3 + t^2

x10 = -0.4

x20 = -0.3

x30 = 1.8

x40 = -1.5

NSolveODE({x1', x2', x3', x4'}, 0, {x10, x20, x30, x40}, 20)

振り子:

g = 9.8

l = 2

a = 5 (初期位置)

b = 3 (最初に加える力)

y1'(t, y1, y2) = y2

y2'(t, y1, y2) = (-g) / l sin(y1)

NSolveODE({y1', y2'}, 0, {a, b}, 20)

len = Length(numericalIntegral1)

c = Slider(0, 1, 1 / len, 1, 100, false, true, true, false)

x1 = l sin(y(Point(numericalIntegral1, c)))

y1 = -l cos(y(Point(numericalIntegral1, c)))

A = (x1, y1)

Segment((0, 0), A)

StartAnimation()