Main Content

updateConstraints

Class: mbcrunner

Update optimization constraint bounds in CAGE project

Since R2024b

Description

updateConstraints(obj,optimizationName,constraintName,bound) updates the constraint bounds for the optimization specified by optimizationName within the CAGE project specified by obj. The constraint bounds are defined by pairs of constraint names specified by constraintName and their corresponding bounds specified by bound.

example

Input Arguments

expand all

Handle to the CAGE project, specified as an mbcrunner object.

Optimization name, specified as a string scalar.

Data Types: string

Constraint name, specified as a string scalar.

Data Types: string

Constraint bound, specified as a scalar.

Data Types: double

Examples

expand all

Update the constraint bounds for the TrqModel_Optimization and TPA_Optimization optimizations.

r = mbcrunner(fullfile(matlabroot, 'toolbox', 'mbc', 'mbctraining', 'pmsmSpeedTorque.cag'));
updateConstraints(r, 'Torque_Optimization', 'Is', 615, 'Vs', 222.8);
updateConstraints(r, 'TPA_Optimization', 'Is_TrqGrid', 615, 'Vs_TrqGrid', 222.8);

Version History

Introduced in R2024b