Sensitivity analysis in simulink
1 view (last 30 days)
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.