This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rkShanks8(funcs, t0, inits, h, numOfDiv) | |
local unpack = unpack or table.unpack | |
local step = h | |
local t0 = t0 | |
local inits = inits | |
local dim = #funcs | |
local numOfDiv = numOfDiv or 1 | |
local h = h / numOfDiv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Lua で常微分方程式を解く / 古典的ルンゲクッタ法 | |
-- http://ti-nspire.hatenablog.com/entry/2017/07/19/143509 | |
function rkClassic(funcs, t0, inits, h, numOfDiv) | |
local unpack = unpack or table.unpack | |
local step = h | |
local t0 = t0 | |
local inits = inits | |
local dim = #funcs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Lua で常微分方程式を解く / フェールベルク法 | |
Fehlberg = class() | |
function Fehlberg:init(funcs, t0, inits, h, tol) | |
self.funcs = funcs | |
self.t0 = t0 | |
self.inits = inits | |
self.h = h | |
self.numOfDiv = false | |
self.dim = #funcs | |
self.tol = tol or 0.001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Lua で常微分方程式を解く / Gragg 法 | |
function gragg(funcs, t0, inits, initsDot, h, numOfDiv) | |
local unpack = unpack or table.unpack | |
local numOfDiv = numOfDiv or 1 | |
local step = h | |
local h = h / numOfDiv | |
local t0 = t0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Lua で常微分方程式を解く / 特殊な方程式に対するナイストレム法 | |
function nystroem(funcs, t0, inits, initsDot, h, numOfDiv) | |
local unpack = unpack or table.unpack | |
local t0 = t0 | |
local inits = inits | |
local initsDot = initsDot | |
local dim = #funcs | |
local numOfDiv = numOfDiv or 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Lua で常微分方程式を解く / フェールベルク法 | |
function fehlberg(funcs, t0, inits, h, tol) | |
local unpack = unpack or table.unpack | |
local t0 = t0 | |
local inits = inits | |
local dim = #funcs | |
local tol = tol or 0.001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Lua で常微分方程式を解く / 7 段のカウェル法 | |
function cowell7(funcs, t0, inits, h) | |
local unpack = unpack or table.unpack | |
local t0 = t0 | |
local inits = inits | |
function staticVals(funcs, inits, h) | |
local dim = #funcs | |
local w = {} | |
local f = {{},{},{},{},{},{},{}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Lua による常微分方程式の数値解法 / 補外法 | |
function extrapolation(funcs, t0, inits, h, numOfDiv) | |
local unpack = unpack or table.unpack | |
local numOfDiv = numOfDiv or 1 | |
local step = h | |
local h = h / numOfDiv | |
local t0 = t0 | |
local inits = inits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Lua による微分方程式の数値解法 / グラッグ法 | |
Gragg = class() | |
function Gragg:init(funcs, t0, inits, initsDot, h, numOfDiv) | |
local unpack = unpack or table.unpack | |
self.numOfDiv = numOfDiv or 1 | |
self.step = h | |
self.funcs = funcs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Lua & TI-Nspire による常微分方程式の数値解法 / 古典的ルンゲクッタ法 | |
rkClassic = class() | |
function rkClassic:init(funcs, t0, inits, h, numOfDiv) | |
self.Unpack = unpack or table.unpack | |
self.funcs = funcs | |
self.t0 = t0 | |
self.inits = inits | |
self.dim = #funcs |
OlderNewer