Function solveODE #

常微分方程数值积分

提供两种可变步长方法

参数预期如下。

返回值是一个包含 {t, y} 的对象,请注意,尽管 t 表示时间,但它可以代表任何其他独立变量,例如 x

Syntax #

math.solveODE(func, tspan, y0)
math.solveODE(func, tspan, y0, options)

Parameters #

Parameter Type Description
func function 驱动函数 f(t,y)
tspan Array | Matrix 时间跨度
y0 number | BigNumber | Unit | Array | Matrix 初始值
options Object 可选配置选项

Returns #

Type Description
Object 返回一个包含 t 和 y 值的数组的对象

Throws #

Type | Description —- | ———–

Examples #

function func(t, y) {return y}
const tspan = [0, 4]
const y0 = 1
math.solveODE(func, tspan, y0)
math.solveODE(func, tspan, [1, 2])
math.solveODE(func, tspan, y0, { method:"RK23", maxStep:0.1 })

另请参阅 #

derivative, simplifyCore

Fork me on GitHub