Tuning parameters in simulink

1.5k views Asked by At

I got a simulink model consisting 4 inputs, 6 outputs and 16 parameters with 4 different self-written controllers. I need to tune the parameters to find their optimized values. I tried to use parameter estimation and response optimization tools and the other options in the analysis menu but I couldnt reach my goal. tools starts to estimate but parameter's values remain same nothing changes. I thought it is because that tools usefull for single input and single output models. Anybody help?

1

There are 1 answers

3
am304 On BEST ANSWER

From the discussion in the comments, it sounds as if you are defining your parameter values in the InitFcn model callback. That's fine when doing a normal simulation, but the problem is this callback gets executed during each model update and simulation. This means that when using something like Simulink Design Optimization, which iterates the model over and over again while trying to vary the parameter values, the values defined in the InitFcn callback overwrite for each iteration the values (for the same parameter(s)) that the optimisation is trying to set. This results in the parameter(s) never changing value during the optimisation and remaining constant, with the value defined in the model callback.

The correct way to approach this is to define the model parameters in the PreLoadFcn model callback instead:

PreLoadFcn

  • Before the model is loaded.
  • Defining a callback code for this parameter is useful for loading variables that the model uses.

[...]

For more details, see Model Callbacks in the documentation.

If it's something else that's causing the parameter estimation/optimisation to fail, you will need to share your model and associated files with us.

As a rule, to maximise the chances of the optimisation succeeding, you want to minimise the number of parameters to estimate simultaneously (doing a multi-stage estimation with a smaller number of parameters at each step can sometimes be a good compromise).