2026a
# check_error
检查积分器的状态并返回返回代码之一
函数库: TyMath
# 语法
check_error(integrator)
# 说明
check_error(integrator)应返回init或步进后所得到的参数。示例
# 示例
检查初始化和步进后结果
创建常量常微分方程问题
using DifferentialEquations
f(u,p,t)=1.01*u
u0=0.5
tspan=(0.0,1.0)
prob = ODEProblem(f,u0,tspan)
prob = ODEProblem with uType Float64 and tType Float64. In-place: false
timespan: (0.0, 1.0)
u0: 0.5
初始化问题
integrator=init(prob,Tsit5())
integrator =
t: 0.0
u: 0.5
检查初始化
check_error(integrator)
ReturnCode.Success = 1
步进一步
step!(integrator)
integrator
integrator =
t: 0.09964258706516003
u: 0.552938681151017
检查积分器状态
check_error(integrator)
ReturnCode.Success = 1
# 输入参数
Integrator - 初始化或步进结果
返回积分器状态