Sensitivity analysis in simulink

1 view (last 30 days)
Ilias Bouchkira
Ilias Bouchkira on 24 Jun 2022
Answered: Paul on 30 Jun 2022
Hi everyone,
I have made a block on simulink for my process (see Figure). I wonder if it is possible to carry out a sensitivity analysis to see the effect of the inputs (Highlighted in yellow) on the outputs (red).
Many thanks in advance;

Answers (2)

patrick1704 on 30 Jun 2022
Well, sensitivities are in the end gradients and the easiest way to get them is by means of finite differences. Because your model seems to use hard-coded settings in the blocks, you may need to update it slightly to get sensitivities.
One option is to introduce a top-level input block with the size as the number of the variables you want to pertube and also add an output block with all outputs you want to analyse. Then, you could just programmatically evaluate the model: Execute particular phase of simulation of model - MATLAB model - MathWorks Deutschland or simulate it Simulate a Simulink model - MATLAB sim - MathWorks Deutschland. First, you would have to evaluate the model for the nominal behaviour and afterward, you would have to perturbe all inputs individually to get additional timehistories that you can use to calculate the sensitivities in Matlab.
Another option could be to use linmod: Extract continuous-time linear state-space model around operating point - MATLAB linmod - MathWorks Deutschland, which also gives you the gradients in one time instant.
In the end, the solution mainly depends on if you want sensitivities in one time instant or over the whole simulation horizon.

Paul on 30 Jun 2022
This page might be of interest.


Find more on General Applications in Help Center and File Exchange




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!