Asked by Shahab
on 21 Aug 2012

I have a big Simulink model. I want to find the input to the system (which is a time series) that will maximize the output (which is another time series, like any other Simulink model).

Which command or toolbox should I use and how? Optimization toolbox, Neural networks, Fuzzy, Genetic algorithm?

Answer by Davide Ferraro
on 30 Aug 2012

Accepted Answer

Hi,

as Mariano was suggesting you may consider using an optimization algorithm and run the Simulink model in your objective function. You can use the SIM command to run the simulation from the code with your different input vector. To understand what's the appropriate optimization function you need to consider which type of problem you are solving (as previously suggested FMINCON and FMINUNC are good starting points).

You may also consider using Simulink Parameter Estimation (offered in Simulink Design Optimization) to setup the optimization process directly in Simulink (although if you're extensively working with timeseries you may find it quicker to write all the code in MATLAB for your optimization routine).

Shahab
on 30 Aug 2012

Thank you, your answer was really useful, it should work. Now, I have another problem, this time in using 'fmincon'. This is my question:

Would you please help me on this one too? tnx

And, I have a third question:

How can I pass an input to my Simulink model when using 'sim' command? Currently, I'm declaring a global variable to pass the input through a Workspace variable.

K E
on 4 Sep 2012

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 6 Comments

## Azzi Abdelmalek (view profile)

Direct link to this comment:https://it.mathworks.com/matlabcentral/answers/46404-how-can-i-find-the-optimum-input-to-a-simulink-model#comment_95438

## Greg Heath (view profile)

Direct link to this comment:https://it.mathworks.com/matlabcentral/answers/46404-how-can-i-find-the-optimum-input-to-a-simulink-model#comment_95799

## Shahab (view profile)

Direct link to this comment:https://it.mathworks.com/matlabcentral/answers/46404-how-can-i-find-the-optimum-input-to-a-simulink-model#comment_96168

## Mariano Lizarraga (view profile)

Direct link to this comment:https://it.mathworks.com/matlabcentral/answers/46404-how-can-i-find-the-optimum-input-to-a-simulink-model#comment_96176

## Ryan G (view profile)

Direct link to this comment:https://it.mathworks.com/matlabcentral/answers/46404-how-can-i-find-the-optimum-input-to-a-simulink-model#comment_96296

## Shahab (view profile)

Direct link to this comment:https://it.mathworks.com/matlabcentral/answers/46404-how-can-i-find-the-optimum-input-to-a-simulink-model#comment_96726

Sign in to comment.