I have previously used the parameter estimation for a Simulink model for multiple runs with “Parameter Estimation” app without any external MATLAB Script. I have followed the below flow:
For explaining let’s take a simple model for which parameters must be estimated:
Here let’s assume 2 runs must be made for estimation of parameters:
Input and Output Data for Experiment 1:
t (Time)= [1 2 3 4 5 6 7 8 9 … 100]
inp (Input port data)= [1 2 3 4 5 6 7 8 9 … 100]
out1 (Output for experiment 1) = inp.*4;
Input and Output Data for Experiment 2:
t (Time)= [1 2 3 4 5 6 7 8 9 … 100]
inp (Input port data)= [1 2 3 4 5 6 7 8 9 … 100]
out1 (Output for experiment 1) = inp.*8;
Now based on the two runs, the parameters "T" & "K" have to be estimated.
Steps to perform parameter estimation:
- Open “Parameter Estimator” App
- Click on “Add Experiment” two times to add two experiments named “Exp” and “Exp_1”
- Now in MATLAB command prompt initialize the variables “T” & “K” with “Simulink.Parameter” object and set the initial value to ‘1’
- Now double click on “Exp” and select appropriate signal values from variables in workspace for the first run as shown below and also add ‘T’ as a parameter for this experiment and provide the set of values for ‘T’
- Similarly repeat the previous step for “Exp_1”
- Now go to the “PARAMETER ESTIMATION” tab in “Parameter Estimator” App and click on “Select Parameters” option and in the opened window add ‘K’ as a parameter under “Parameters Tuned for All Experiments” as shown below:
- Now go to the “PARAMETER ESTIMATION” tab and then click on Estimation to perform the required parameter estimation and this converges to a solution as follows:
Here we have set ‘K’ as a single estimation variable across all runs and ‘T’ as individual estimation for Each Run, so we have 3 different variables in the plot which are:
- K
- T (for Exp)
- T (for Exp_1)
For more information on parameter estimation of multiple runs you can refer to the following documentation links:
- https://www.mathworks.com/help/releases/R2024b/sldo/ug/estimate-model-parameters-per-experiment-gui.html
- https://www.mathworks.com/help/releases/R2024b/sldo/gs/estimate-parameters-from-measured-data-using-the-gui.html
I hope it helps!