解决报错 The linesearch algorithm failed with too small a step.mxstep steps taken before reaching tout

用casadi求解模型的时候遇到报错:

The linesearch algorithm failed with too small a step。

At t = 0.698766, ,mxstep steps taken before reaching tout.

正在查阅资料,还没有解决,以此记录。

笔者是利用pyomo做优化,约束是一组ODE方程,需要利用到pyomo中的simulator模块,该模块可以调用求解器scipy和casadi,但不能对求解器做更多设置,并且在模型计算中利用到该模块的vary_input功能,每个时刻输入新的参数。

分析应该是求解器出错。查阅资料有几种方法,

1. 设置casadi求解器,默认的mode是fast,可以修改为fast with events

来源:Line search failed error - #2 by roualdes - Algorithms - The Stan Forums

2. 修改求解器的迭代补充或者误差

来源:mxstep steps taken before reaching tout · Issue #1065 · pybamm-team/PyBaMM · GitHub

pyomo本身是可以调用求解器求解的,但受限于vary_input功能,必须使用到simulator模块,正在想解决办法。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值