Main Content


Update experiments with estimated model initial states and parameter values



experiment = setEstimatedValues(experiment0,parameters) updates the experiment with the estimated model initial states and parameter values.

setEstimatedValues is used with the getValuesToEstimate method. You use getValuesToEstimate to obtain the parameters that you want to estimate from an experiment. When you estimate parameters for multiple experiments, getValuesToEstimate tags each parameter to track its corresponding experiment. You use setEstimatedValues to update the experiments with their corresponding estimated parameter values.


collapse all

Specify an experiment.

experiment = sdo.Experiment('sdoRCCircuit');

Typically, you also specify measured input/output data for the experiment.

Specify a model parameter for estimation.

C1_parameter = sdo.getParameterFromModel('sdoRCCircuit','C1');
C1_parameter.Value = 460e-6;
experiment.Parameters = C1_parameter;

C1_parameter is the capacitance parameter of the C1 block. The initial guess for its value is 460 μ F.

Estimate the parameter value.

Typically, you use sdo.optimize to get the estimated parameter values for an experiment. For this example, directly change the value of the capacitance parameter.

C1_parameter.Value = 1e-6;

Update the experiment with the estimated parameter.

experiment = setEstimatedValues(experiment,C1_parameter);

Use experiment.Parameters.Value to verify that the capacitance parameter's value is updated.

Input Arguments

collapse all

Experiment, specified as an sdo.Experiment object.

To specify multiple experiments, use a vector of sdo.Experiment objects.

Estimated model initial states and parameters for experiments, specified as a vector of param.Continuous objects.

You obtain estimated parameters using sdo.optimize.

Output Arguments

collapse all

Updated experiment, returned as an sdo.Experiment object.

If experiment0 is a vector of experiments, then experiment is a corresponding vector of updated sdo.Experiment objects.

setEstimatedValues updates the values of the parameters and initial states specified in each of the experiments in experiment0 using the corresponding entry in parameters.

Version History

Introduced in R2012b