Main Content


Class: sdo.ParameterSpace
Package: sdo

Add parameter to sdo.ParameterSpace object


ps = addParameter(ps0,p)
ps = addParameter(ps0,p,pdist)


ps = addParameter(ps0,p) adds a model parameter, p, to an sdo.ParameterSpace object, ps0, and returns the updated object, ps. The software updates the ParameterNames property to include the parameter name.

The software also updates the ParameterDistributions property to specify the uniform distribution for the parameter. The software sets the values of the two parameters of the uniform distribution:

  • Lower — Set to p.Minimum. If p.Minimum is equal to -Inf, then the software sets Lower to 0.9*p.Value. Unless p.Value is equal to 0, in which case the software sets Lower to -1.

  • Upper — Set to p.Maximum. If p.Maximum is equal to Inf, then the software sets Upper to 1.1*p.Value. Unless p.Value is equal to 0, in which case the software sets Upper to 1.

ps = addParameter(ps0,p,pdist) specifies the probability distribution of p.

Input Arguments


Parameter space, specified as an sdo.ParameterSpace object.


Model parameters and states, specified as a vector of param.Continuous objects.

For example, sdo.getParameterFromModel('sdoHydraulicCylinder',{'Ac','K'}).


Probability distribution of model parameters, specified as a vector of univariate probability distribution objects.

  • If pdist is the same size as p, the software specifies each entry of pdist as the probability distribution of the corresponding parameter in p.

  • If pdist contains only one distribution, the software specifies this object as the probability distribution for all the parameters in p.

Use the makedist command to create a univariate probability distribution object. For example, makedist('Normal','mu',10,'sigma',3).

To check if pdist is a univariate distribution object, run isa('pdist,'prob.UnivariateDistribution').

Output Arguments


Updated parameter space, returned as an sdo.ParameterSpace object.


expand all

Create an sdo.ParameterSpace object, ps, for the Ac parameter of sdoHydraulicCylinder model.

pAc = sdo.getParameterFromModel('sdoHydraulicCylinder','Ac');
ps = sdo.ParameterSpace(pAc);

Add the K parameter to ps.

pK = sdo.getParameterFromModel('sdoHydraulicCylinder','K');
ps = addParameter(ps,pK);

Create an sdo.ParameterSpace object for the Ac and C1 parameters of the sdoHydraulicCylinder model.

p = sdo.getParameterFromModel('sdoHydraulicCylinder',{'Ac','C1'});
ps = sdo.ParameterSpace(p);

Add the K parameter to ps. Specify a normal distribution for K.

pK = sdo.getParameterFromModel('sdoHydraulicCylinder','K');
pKdist = makedist('Normal','mu',pK.Value,'sigma',2);
ps = addParameter(ps,pK,pKdist);