nlmpc, Error using sqpInterface Nonlinear constraint function is undefined at initial point. Fmincon cannot continue. How to fix it? Help me, please, I can give you all that you want (Script,State function and so on)
Show older comments
The error that appear, after first launch is:
Start of Error Report ------------------------------------------------------ Error using sqpInterface Nonlinear constraint function is undefined at initial point. Fmincon cannot continue. Error in fmincon (line 843) [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); ------------------------------------------------------ End of Error Report ------------------------------------------------------
Error occurred when calling NLP solver "fmincon". See the error report displayed above. Error in nmpcblock_interface.m (line 161) throw(ME) Error in 'HEAVYTRUCK_linearMPC/Nonlinear_MPC_Controller/MPC/NLMPC' (line 24)
Component:Simulink | Category:Model error
An error occurred while running the simulation and the simulation was terminated
Caused by:
- Simulation stopped because of a runtime error.
I don't know how fix it, I traied more things for to fix its, but... no results!
7 Comments
Cesar García Echeverry
on 15 Jul 2022
did you resolve it?
世忠
on 28 Mar 2023
I also met this problem. Did you solve it?
Eri Gualter dos Santos
on 30 Apr 2023
世忠 Can you provide more details about the issue you are facing? Please share a reproduction example if you are able too.
曜星
on 8 Oct 2023
i wonder how to solve the problem
Ibrahim
on 12 Mar 2024
i wonder how to solve the problem
ahmed sayed
on 31 Jul 2024
add initial condition block with dimensions equal to that of your manipulated variable vector
Answers (1)
George
on 1 Nov 2023
0 votes
Hi all,
I had the same error arrise when I was attempting to create a NMPC for a hypersonic longitudinal model. To fix the issue I had found a bug in the aerodynamic data where a value was off by a factor of 10 (one decimal place to the right). Upon fixing this, the model worked correctly.
I'm not sure why exactly this would throw this error, but this could be the root cause, an error in the dynamics of the system.
Categories
Find more on Controller Creation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!