How can write code of multi objective functions with using optimproblem format?

How can I define functions of multi objective problem with optimproblem format? My mean is using problem based method not using solver based method. ?
For example I have this optimization model:
That this model has two objectives.
I want to write the code of this model with optomproblem.
So I attach my model as above:
In optimproblem we use a phrase like the following sentense to define objective function:
prob.Objective = x(1) + 2*x(2);
But above formolation is for one objective function not multi objective problems.
But I have two objective function in my model and I don't know how can I coded them with this method ☹

3 件のコメント

Star Strider
Star Strider 2019 年 12 月 1 日
S AsZ
S AsZ 2019 年 12 月 2 日
編集済み: S AsZ 2019 年 12 月 2 日
Ok. Thank you so much. ?
But I don't know which details it need? Do you mean I should put entire my model?
Star Strider
Star Strider 2019 年 12 月 2 日
My pleasure.
That could help, providing your code is well-documented so we can understand what it does.

サインインしてコメントする。

 採用された回答

Walter Roberson
Walter Roberson 2019 年 12 月 3 日

0 投票

You cannot. Examine https://www.mathworks.com/help/optim/ug/problem-based-optimization-algorithms.html and observe that none of the algorithms are multi-objective . Or look at https://www.mathworks.com/help/optim/ug/optimproblem.html#d117e128953 and see that for problem based optimization, the objective must be scalar.

5 件のコメント

S AsZ
S AsZ 2019 年 12 月 3 日
編集済み: S AsZ 2019 年 12 月 3 日
I know that in optimproble, objective function must be scalar and my model is multi objective then it's not could be scalar.
And because my model is multi objective, I must use "gamultiobj" to solve my model. And for this reason I should use "solver based optimization" and I can't use "problem based optimization".
But the examples that explained in gamultiobj are simple examples whereas my model have several summations as can you seen above.
And it is difficult for me to write my model code.
Is there any way that I can convert my model from problem based optimization to solver based optimization?
Or how can I write the above metioned model by using solver based optimization?
Walter Roberson
Walter Roberson 2019 年 12 月 3 日
You can create one optimproblem per objective, using the same variables each time. You can use https://www.mathworks.com/help/optim/ug/optim.problemdef.optimizationproblem.prob2struct.html prob2struct() to convert the problem based system to a solver based approach. However,
  • there is no guarantee that converting two different objectives with the same variables will use the same parameters in the same order
  • you would need to extract the fields from the converted structure to create the multi-objective, and probably check them for consistency with each other
  • it is plausible that not all of the objectives will transform into the same solver
But still, it might possibly help to proceed that way.
S AsZ
S AsZ 2019 年 12 月 3 日
編集済み: S AsZ 2019 年 12 月 3 日
The following sentence is ambiguous for me. Can you give me more information or provide an example for me about this sentence?
"you would need to extract the fields from the converted structure to create the multi-objective, and probably check them for consistency with each other"
Look at the example for problem2struct() .
%bunch of code
steelprob.Constraints.conswt = totalweight == 25;
steelprob.Constraints.conscarb = totalCarbon == 1.25;
steelprob.Constraints.consmolyb = totalMolyb == 1.25;
problem = prob2struct(steelprob);
Now
>> problem
problem =
struct with fields:
intcon: [5 6 7 8]
lb: [8×1 double]
ub: [8×1 double]
x0: []
f0: 0
f: [8×1 double]
solver: 'intlinprog'
Aineq: []
bineq: []
Aeq: [3×8 double]
beq: [3×1 double]
options: []
You would do the same thing for each of the optimproblem that you created. You would need to compare that lb contained the same thing for each, and that ub contained the same thing for each, and likewise Aineq and bineq and Aeq and beq and intcon . Then having verified that those were all the same, you would extract the common ones into variables
joint_A = problem.Aineq;
joint_b = problem.Bineq;
and so on
and you would extract the various f fields describing the objective functions and merge them together into one, that might look something like
joint_obj = @(x) [problem.f(x), problem2.f(x)];
I think you would be ending up with the same nonlcon for all of them rather than having to merge them
and then call
gamultiobj(joint_obj, length(joint_lb), joint_A, joint_b, joint_Aeq, joint_beq, joint_lb, joint_ub, joint_nlcon, joint_options)
S AsZ
S AsZ 2019 年 12 月 3 日
編集済み: S AsZ 2019 年 12 月 3 日
Thank you very very much ??????????

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

質問済み:

2019 年 12 月 1 日

編集済み:

2019 年 12 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by