フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Help with optimizing a function.

1 回表示 (過去 30 日間)
Marianne
Marianne 2013 年 11 月 8 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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!!

回答 (2 件)

Nayan Rawat
Nayan Rawat 2019 年 6 月 18 日
I also need help for a similar problem. por favor.

Nayan Rawat
Nayan Rawat 2019 年 6 月 18 日
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