メインコンテンツ

CreateConstraint

Create design constraint

Description

DoeObjMod = CreateConstraint(DoeObj) creates a default constraint for the design.

Designs have a constraints property that is initially empty.

constraints = design.Constraints

constraints = 
0x0 array of mbcdoe.designconstraint

DoeObjMod = CreateConstraint(DoeObj,'Name1','Value1',…) creates a constraint with properties specified by the name-value pairs.

By default, CreateConstraint creates a 1D table constraint for designs with two or more inputs. For a design with one input, CreateConstraint creates a linear constraint by default. You can specify the constraint type using the Type property.

CreateConstraint does not add the constraint to the design. To add a constraint to the design, use AddConstraint.

example

Examples

collapse all

cLinear = CreateConstraint(design,'Type','Linear');
cLinear.A = [-2.5e-4, 1];
cLinear.b = 0.25;
cLinear
design.Constraints = cLinear;
design = Generate(design);

Create and apply a 1D table constraint.

cTable1d = CreateConstraint(design,'Type','1D Table');
cTable1d.Table = [0.9 0.5];
cTable1d.Breakpoints = [500 6000];
cTable1d
design.Constraints = cTable1d;
design = Generate(design);
design.Constraints = [cLinear, cTable1d];
constraints = design.Constraints
design = Generate(design);

constraints = 
1x2 array of mbcdoe.designconstraint
Linear design constraint: -0.00025*N + 1*L <= 0.25
1D Table design constraint: L(N) <= Lmax

Load boundary constraints from another project file and add to them to the design.

otherProject = mbcmodel.LoadProject( [matlabroot,'\toolbox\',...
'mbc\mbctraining\Gasoline_project.mat']);
mytestplan = otherProject.Testplans(1);
boundaryConstraints = BoundaryModel(mytestplan,'global');
Design.Constraints = boundaryConstraints;

Input Arguments

collapse all

Instance of mbcdoe.design class, specified as a mbcdoe.design doe design object.

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'Type','Linear'

The design generator properties determines the applicable name-value pairs. This table provides a complete list of the properties.

Constraint Properties

Constraint TypePropertyDescription
Linear design constraint:
1*Input1 + 1* Input2 + 1* Input3 <= 0
A Matrix for linear constraint (matrix: [1,NumInputs])
b Bound for linear constraint (double)
Ellipsoid design constraint:
Ellipsoid at (Input1=0, Input2=0, Input3=0)
CenterPoint Center of ellipse (vector: NumInputs)
MatrixEllipsoid form matrix (positive semi-definite) (matrix: [NumInputs, NumInputs])
1D Table design constraint:
InputY(InputX) <= InputY max
Table Table constraint (vector)
Breakpoints Breakpoints for rows (vector)
InequalityRelational Operator (enum: {'<=','>='})
InputFactorColumn input symbol (enum: { 'InputX','InputY'})
TableFactorTable input symbol (enum: {'InputX','InputY '})
2D Table design constraint:
InputZ(InputX,InputY) <=InputZmax
Table: Table constraint (matrix) )
RowBreakpointsBreakpoints for rows (vector)
ColumnBreakpointsBreakpoints for columns (vector)
InequalityRelational operator (enum: {'<=','>='})
RowFactorRow input symbol (enum: {'InputX','InputY, 'InputZ'})
ColumnFactorColumn input symbol (enum: {'InputX','InputY, 'InputZ'})
TableFactorTable input symbol (enum: {'InputX','InputY',
'InputZ'
}

Constraint type, specified as the comma-separated pair consisting of 'Type' and a character vector.

Example: 'Type','V-optimal'

Output Arguments

collapse all

Modified instance of mbcdoe.design class, returned as a mbcdoe.design object.

Version History

Introduced in R2008a