微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

具有离散强制函数的非齐次 ODE 使用 Julia 中的 DifferentialEquations 包

如何解决具有离散强制函数的非齐次 ODE 使用 Julia 中的 DifferentialEquations 包

在Julia中,我想使用DifferentialEquations.jl包来解决

\ddot{u} + f(u,\dot{u},p) = g(t)

其中 g(t) 作为在时间 t 的等距时刻的值向量给出。

这种情况与以往不同 https://diffeq.sciml.ai/stable/tutorials/ode_example/ 其中强制函数 M(t) 是连续的。

这种情况的解决方案是按照

中的建议对 g(t) 进行插值

solve system of ODEs with read in external forcing

然而,我不想插入强制函数 g(t) 而是想尝试回调命令。

对于受地面运动影响的二阶线性单自由度系统,我已经尝试过

@ApiResponses(value = {
            @ApiResponse(code = 200,message = "OK"),@ApiResponse(code = 400,message = "Bad Request",response = ResourceErrorModel.class),@ApiResponse(code = 401,message = "Unauthorized",@ApiResponse(code = 403,message = "Forbidden",@ApiResponse(code = 404,message = "Not Found",@ApiResponse(code = 409,message = "Conflict",@ApiResponse(code = 422,message = "Unprocessable Entity",@ApiResponse(code = 424,message = "Failed Dependency",response = ResourceErrorModel.class)})
public @interface DefaultAPIResponse{}

但是得到的结果并不令人满意。

是否有其他方法,不是插入 g(t),而是使用回调,即 PeriodicCallback、discreteCallback?

解决方法

这个问题似乎只是在评论中解决了用户错误。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。