Documentation

idParametric/setpar

Set attributes such as values and bounds of linear model parameters

Syntax

  • sys1 = setpar(sys,'value',value)
    example
  • sys1 = setpar(sys,'free',free)
    example
  • sys1 = setpar(sys,'bounds',bounds)
    example
  • sys1 = setpar(sys,'label',label)
    example

Description

example

sys1 = setpar(sys,'value',value) sets the parameter values of the model sys. For model arrays, use setpar separately on each model in the array.

example

sys1 = setpar(sys,'free',free) sets the free or fixed status of the parameters.

example

sys1 = setpar(sys,'bounds',bounds) sets the minimum and maximum bounds on the parameters.

example

sys1 = setpar(sys,'label',label) sets the labels for the parameters.

Examples

collapse all

Assign Model Parameter Values

Estimate an ARMAX model.

load iddata8;
init_data = z8(1:100);
na = 1;
nb = [1 1 1];
nc = 1;
nk = [0 0 0];
sys = armax(init_data,[na nb nc nk]);

Set the parameter values.

sys = setpar(sys,'value',[0.5 0.1 0.3 0.02 0.5]');

To view the values, type val = getpar(sys,'value').

Fix or Free Model Parameters

Construct a process model.

m = idproc('P2DUZI');
m.Kp = 1;
m.Tw = 100;
m.Zeta = .3;
m.Tz = 10;
m.Td = 0.4;

Set the free status of the parameters.

m = setpar(m,'free',[1 1 1 1 0]);

Here, you set Tz to be a fixed parameter.

To check the free status of Tz, type m.Structure.Tz.

Set Minimum and Maximum Bounds on Parameters

Estimate an ARMAX model.

load iddata8;
init_data = z8(1:100);
na = 1;
nb = [1 1 1];
nc = 1;
nk = [0 0 0];
sys = armax(init_data,[na nb nc nk]);

Set the minimum and maximum bounds for the parameters. Each row represents the bounds for a single parameter. The first value in each row specifies the minimum bound and the second value specifies the maximum bound.

sys = setpar(sys,'bounds',[0 1; 1 1.5; 0 2; 0.5 1; 0 1]);

Assign Default Labels to Parameters

Estimate an ARMAX model.

load iddata8;
init_data = z8(1:100);
na = 1;
nb = [1 1 1];
nc = 1;
nk = [0 0 0];
sys = armax(init_data,[na nb nc nk]);

Assign default labels to model parameters.

sys = setpar(sys,'label','default');

View the default labels.

getpar(sys,'label')
ans = 

    'A1(1)'
    'B0(1)'
    'B0(2)'
    'B0(3)'
    'C1'

Input Arguments

collapse all

sys — Identified linear modelidss | idproc | idgrey | idtf | idpoly

Identified linear model, specified as an idss, idproc, idgrey, idtf, or idpoly model object.

value — Parameter valuesvector of doubles

Parameter values, specified as a double vector of length nparams(sys).

free — Free or fixed status of parametersvector of logical values

Free or fixed status of parameters, specified as a logical vector of length nparams(sys).

bounds — Minimum and maximum bounds on parametersmatrix of doubles

Minimum and maximum bounds on parameters, specified as a double matrix of size nparams(sys)-by-2. The first column specifies the minimum bound and the second column the maximum bound.

label — Parameter labelscell array of strings | 'default'

Parameter labels, specified as a cell array of strings. The cell array is of length nparams(sys).

Use 'default' to assign default labels, a1, a2..., b1,b2,..., to the parameters.

Output Arguments

collapse all

sys1 — Model with specified values of parameter attributesidss | idproc | idgrey | idtf | idpoly

Model with specified values of parameter attributes. The model sys you specify as the input to setpar gets updated with the specified parameter attribute values.

See Also

| |

Introduced in R2013b

Was this topic helpful?