How to fix Gekko’s `@error: Solution not found`

I want to perform parameter inference for an ODE model (m.options.IMODE = 5). I have 2 models in Gekko. First, I generate model data from each model, and perform parameter inference directly on the corresponding model data. That works no problem for each model. Then, I attempt to perform parameter inference on real data, that has roughly the same number of datapoints as the model data. The first model finds a reasonable fit, the second one crashes with @error: Solution not found. I would like to learn the procedure of debugging problems like this.

Firstly, the last few lines of the Gekko error report for m.solve(disp=True) is

 Iter    Objective  Convergence
  250  8.46435E+03  2.23511E-01
 Maximum iterations
 
 ---------------------------------------------------
 Solver         :  APOPT (v1.0)
 Solution time  :    101.300599999988      sec
 Objective      :    8182.67185576400     
 Unsuccessful with error code            0
 ---------------------------------------------------
 
 Creating file: infeasibilities.txt
 Use command apm_get(server,app,'infeasibilities.txt') to retrieve file
 @error: Solution Not Found

Question 1: Is it correct to assume that the solver terminated because it reached the maximum number of iterations, and not because if infeasibilities?

I have tried all of the suggestions from this answer regarding reaching maximum iteration number, but to no avail.

  1. I have tried random and fixed (somewhat reasonable) initialization for unknown parameters. In all cases, the objective function seems stuck at the exact same value on every iteration. I presume that increasing the number of iterations would not fix this problem.
  2. I have tried APOPT, BPOPT and IPOPT. For APOPT and IPOPT, the solver behaves the same, crashing with Solution Not Found having made no progress on the objective function. With BPOPT, it crashes with WARNING MESSAGE FROM SUBROUTINE MA27BD *** INFO(1) = 3 MATRIX IS SINGULAR.
  3. I have tried using cold start as described in the mentioned answer. For all solvers, I get Successful Pre-solve Solution for the cold start, and still the Solution Not Found for the second part.

Question 2: How do I proceed to interpret what is going wrong and fix this problem?

I’m not allowed to share the original data, but I can share the ODE. For the first model (which fits fine):

m.Equation(A * x.dt() == K * B * y * (x1 - x) + C * (x2 - x))

z_est = x + (x1 - x) * (1 - B)
objective = m.Intermediate((z - z_est)**2)
m.Minimize(objective)

Here A, B, C are the unknown parameters we seek to infer, K is a known constant, and y, x1, x2, z are known time-dependent continuous variables, which are measured for every timestep. The only difference to the second model (that does not fit is)

B = m.Intermediate(m.exp(-y0 / y))

Now, the unknown parameters are A, y0, C. There are no additional inequality constraints. The only constraints are specifying very broad upper and lower bounds on the unknown parameters, such as

bounds = dict(A = [0.0001, 10000000], C = [0.0001, 100000], y0 = [0.001, 1000])

Question 3: Is there any use in looking at the infeasibilities file? I have looked at it briefly for APOPT, and I have found that POSSIBLE INFEASBILE EQUATIONS section is empty, but there are a lot of complicated lines in the ACTIVE OBJECTIVE EQUATIONS, ACTIVE EQUATIONS and INACTIVE EQUATIONS. Some of the lines in ACTIVE EQUATIONS say not available at the end.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật