Minimize Function with multiple inputs

18 views (last 30 days)
Austin Connell
Austin Connell on 5 Dec 2019
Answered: Walter Roberson on 5 Dec 2019
I am working on a project where I must model part of a jet engine. We have a lot of constants and 4 variables with constraints. There are then about 30 equations or so that connect together, where we look at how properties change going through the engine. We end up with a fuel flow rate, which I need to minimize by variying the 4 variables. How would I optimize this using matlab? Looking at optimization methods, it seems they have single function that variables are plugged into. I can't create a single equation to represent all these relationships.

Answers (1)

Walter Roberson
Walter Roberson on 5 Dec 2019
We end up with a fuel flow rate, which I need to minimize by variying the 4 variables.
You have a single objective. You can use fmincon(), possibly with non-linear constraints.
I can't create a single equation to represent all these relationships.
You do not need to. What you need is a single function that accepts a vector of length 4 and returns a scalar. The function can have any looping and branching structure it needs, and can call any number of other functions. However, the computations need to be continous to the second derivative in order for the gradient and hessian computations to be valid.
You might also be interested in looking at Problem Based Optimization.

Categories

Find more on Get Started with Optimization Toolbox in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!