Error occurred when calling NLP solver "fmincon".

6 ビュー (過去 30 日間)
Subhasritam Behera
Subhasritam Behera 2022 年 2 月 27 日
回答済み: R 2024 年 1 月 23 日
Unexpected Standard exception from MEX file.
What() is:bad allocation
..
Error in sqpInterface
Error in fmincon (line 870)
[X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] = sqpInterface(funfcn,X,full(A),full(B),full(Aeq),full(Beq), ...
Error in nlmpc/nlmpcmove (line 157)
[z, cost, ExitFlag, Out] = fmincon(CostFcn, z0, A, B, [], [], zLB, zUB, ConFcn, fminconOpt);
Error in nmpcblock_interface (line 159)
[mv, ~, Info] = nlmpcmove(nlobj, x, lastmv, ref, md, Options);
  3 件のコメント
Subhasritam Behera
Subhasritam Behera 2022 年 3 月 5 日
No its not about running out of RAM, as in task manager i am able to see 71% of memory is consumed while running this program.
Walter Roberson
Walter Roberson 2022 年 3 月 5 日
I recommend that you contact Mathworks Support.

サインインしてコメントする。

回答 (1 件)

R
R 2024 年 1 月 23 日
Hello Subhasritam,
Usually, the first part of the error i.e.:
Unexpected Standard exception from MEX file.
What() is:bad allocation
This error occurs when MATLAB is running out of system memory while doing the computations for 'fmincon' using dense matrices. This typically occurs if you have many constraints. In general, the more constraints that are added, the more work an algorithm like 'fmincon' has to do to solve the problem. The best way to solve this is to try to reduce the number of constraints.
If the issue still perists, verify that both the minimum and maximum output value constraints are specified. If your upper bound is infinity, try specifying a constraint which is a large finite value (e.g. 1e30), rather than leaving it unspecified or set to "inf", as this could be causing the error you are encountering.
Hope this solves the error!

カテゴリ

Help Center および File ExchangeNonlinear Optimization についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by