运行 一个 ODE 问题,直到给出信号

Running an ODEProblem until given a signal

ODEProblem 的时间跨度是否有可能是开放式的,即问题 运行 直到给出外部信号(可能通过具有适当条件的离散回调) ?直觉上,这意味着提供类似 tspan = (0.0, Inf) 的内容,尽管我不确定这是否被允许并且似乎无法在 documentation 中找到任何内容。 TIA.

是的,您可以使用 tspan = (0.0, Inf)。当然,如果您这样做,您需要确保设置 a terminating event like in this example so that it doesn't run forever, or you can use the integrator interface 来控制步骤并随时停止。