- If using the standard cost function and the propertynlmpc.Optimization.ReplaceStandardCostis set tofalse, increasing thenlmpc.Weights.ECRvalue raises the weight on the slack variables. More details are available here:
- When specifying a custom cost function for a nonlinear MPC controller, it's possible to replace or augment the standard quadratic MPC cost function. By default, anlmpccontroller replaces the standard cost function with the custom one, treating all constraints as hard constraints.
- To combine standard and custom costs, setnlmpc.Optimization.ReplaceStandardCostto false, similar to the first scenario, allowing adjustments to thenlmpc.Weights.ECR property.
- Specify Constraints for Nonlinear MPC:https://www.mathworks.com/help/releases/R2024b/mpc/ug/specify-constraints-for-nonlinear-mpc.html
- Specify Cost Function for Nonlinear MPC:https://www.mathworks.com/help/releases/R2024b/mpc/ug/specify-cost-function-for-nonlinear-mpc.html