Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Help with optimizing a function.

1 visualización (últimos 30 días)
Marianne
Marianne el 8 de Nov. de 2013
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I want to maximize the following function;
function y=wage3(x0,x1,x2) y(x) = -(x0*@logx0-x0)/3+(x1*@logx1-x1)/3-(x1*@logx1-x1)/6+(x2*@logx2-x2)/6+3*@logx0-(x1*@logx0)/3+(3*x0*@logx0)/6-(x2*@logx0)/6
This is a function that I want to optimize given the following constraint;
x0(1+h10+h20)+h11+h22*c2 =3*h11+6*h22
where h11=(c1-c0)/3 h10=1-(c1-c0)/3 h22=(c2-c0)/6 h20=1-(c2-c0)/6
x0,x1,x2 can only take on discrete values [1,2,3,4,5,6]. What I want to do is to fix x0 at one value (1,2,...6) and vary x1,x2 to find the combination yielding the highest y.
I have multiple problems;
1. I am told that "Undefined function 'mtimes' for input arguments of type 'function_handle'" when trying to run wage(1,2,2) (just random values). 2. I have no idea how to tell matlab to use the constraint I want. How do I save the constraint, how do I use it?
Very thankful for help!!

Respuestas (2)

Nayan Rawat
Nayan Rawat el 18 de Jun. de 2019
I also need help for a similar problem. por favor.

Nayan Rawat
Nayan Rawat el 18 de Jun. de 2019
see Solving a Mixed Integer Engineering Design Problem Using the Genetic Algorithm in documentation. it might help.

Community Treasure Hunt

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

Start Hunting!

Translated by