0

I need to minimize a nonlinear function subject to constraints, where everything is a parameter - no numbers.

Does anyone know if this is possible in MATLAB?

Here are the details:

Find the minimum of (2A-MB)G(F+H+J+K+L)+A(B+C+D)(E+F)-(MC-A)^2 with 
A,B,C,D,E,F,G,H,J,K,L > 0.

Thanks for any help.

2
  • Which ones are the variables? and which ones are constants? You are talking about symbolic function optimization, that just may work when a closed form solution exists. Commented Jul 2, 2014 at 18:09
  • Hi, All of the letters A,B,C,D,E,F,G,H,J,K,L are independent variables - I do not have any coefficients or numeric values. I just have the constraint as mentioned. Commented Jul 2, 2014 at 18:17

1 Answer 1

2

You can use fmincon.

Here is the documentation for the function: http://www.mathworks.in/help/optim/ug/fmincon.html

The objective function would have to be written in a separate m-file which takes a vector x as it's input and returns a scalar output. Multiple variables are passed as x[1], x[2], x[3] etc.

x0 is a vector of initial guesses for the variables. Here they are all initialized to 1. It's of length 12 here as there seem to be 12 variables (including 'M').

x0 = ones(12,1)
[x,fval] = fmincon(@fun,x0,[],[],[],[],zeros(12,1),[])

This link will help you understand how to write the objective functions for multiple variables:

http://www.mathworks.in/help/optim/ug/writing-objective-functions.html#brhkghv-4

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.