Simscape and Sensitivity Analysis/Model Calibration

Droncan Aers on 29 Jan 2020
Latest activity Reply by Alec Stothert on 18 Feb 2020

Good morning everyone,

I recently approached Simscape environment to similute (simple) electrical circuits based on resistors (R), capacitances (C) and direct current generators (I). The experience has been quite satisfactory.

Now I have to couple the Simscape models to novel modifications of sampling-based sensitivity analysis techniques and/or non gradient-based optimization methods (genetic algorithms, particle swarm, particle filters, etc) for model calibration. In this regard, I am not keen on potentilities offered by other toolboxes implemented in Simulink environment, rather than I would like to: i) to update the values of resistors, capacitances and current generators from script ii) to run the simulation from script iii) to collect the output in matlab workspace.

I looked for a while in possible solutions but I understood that it is not an easy task, and that the most common approach is to open the resume mask and manually update the parameters.

I wonder if there is any approach to do what I previously described. I know that it is possible with Simulink model, but have no idea if I can do the same with Simscape model.

The attached image is an example of Simscape model that I want to embed in a sensitivity analysis/optimization loop.

Thank you in advance for your kind advices

Alec Stothert
Alec Stothert on 10 Feb 2020

Simulink Design Optimization (https://www.mathworks.com/help/sldo/index.html) can be used to tune Simulink model parameters and/or perform sensitivity analysis. Is this what you are looking for?

Droncan Aers
Droncan Aers on 17 Feb 2020

Thank you for your answer. However, it does not address my issue.

I would like to tune the parameters from script and running optimization with my own ialgorithms rather than resorting to toolboxes provided by Matlab including Simulink Design optimization toolbox.

In addition to that, it looks like that Simulink Design Optimization is not compatible with Simscape models

Alec Stothert
Alec Stothert on 18 Feb 2020

Ah ok. Yes if you want to use your own optimization algorithms then Simulink Design Optimization is not the best choice. As long as the blocks in your Simscape model use variables in their dialog masks, Simulink Design Optimization can tune those variables see for example https://www.mathworks.com/help/sldo/examples/dc-servo-motor-parameter-estimation.html.