2017-06-03から1日間の記事一覧
function fehlberg(funcs, t0, inits, h, tol) local unpack = unpack or table.unpack local Ln = math.log local Floor = math.floor local Abs = math.abs local Max = math.max local dim = #funcs local t0 = t0 local inits = inits local function fl…
参考: パソコンで見る天体の動き, pp.103-109 function hNew(h, err, tol) if err > tol then return 0.9 * h * (tol * h/(h * err))^(1/4) else return h end end -- 確かめる print(hNew(1, 0.0017737, 0.0001))
参考: パソコンで見る天体の動き, p.103-109 function floorB(num) if (num > 0) and (num < 1) then return 2^math.floor(math.log(num)/math.log(2)) else return math.floor(num) end end -- 確かめる print(floorB(0.1), floorB(0.2), floorB(0.8), floo…
参考: パソコンで見る天体の動き, p.103-109 local unpack = unpack or table.unpack function maxOfErr(listA, listB) local sute = {} for i = 1, #listA do sute[i] = math.abs(listA[i] - listB[i]) end return math.max(unpack(sute)) end -- 確かめる…