how to solve an optimization with a function in objective function

I need to do a non-convex non-linear integer programming optimization. The thing is I have a function in my objective function.
The objective function is as follows:
max where and are my variables for each k, t, and p. Function f is as follows:
function f(F_p,n):
f_1 = F_p;
f_0 = F_p;
for i = 1:n
f_1 = f_1*f_0/(f_1*f_0 + (1-f_1)*(1-f_0));
end
and it returns f_1. There are some constraints about the lower and upper bound and also the relation between the varibales that I have not mentioned here.
My question is can I implement and solve this using matlab Opti solver? And how? :)

Réponses (1)

Matt J
Matt J le 11 Mai 2022
ga and surrogateopt are designed for problems of that form.

8 commentaires

Are you sure ga can solve non-convex optimization? And I checked the documnetation of ga and I am not sure if it is what I need. It maximize a function. But for mine, I have a function in my oobjective function that I can not write the function implementation as an equation.
Matt J
Matt J le 11 Mai 2022
Modifié(e) : Matt J le 11 Mai 2022
Are you sure ga can solve non-convex optimization?
Yes, in fact, it was created to deal with non-convex problems.
But for mine, I have a function in my oobjective function that I can not write the function implementation as an equation.
Doesn't matter. None of the solvers in any of the Matlab toolboxes know or care how many lines of code are used to implement the function.
Thank you Matt J, You made me happy. I have been struggling to solve this optimization problem. I just have started to learn Matlab and that's why I want to be sure that ga is what I need. I hope I have been clear enough in my question.
II have attached my whole formulation and if you can please check the whole constraints and objective function and see if I should start learning ga for that. I really appreciate your time and help. Just want to say the variables are w,n, and s for each t, k, and p. Please let me know if I am not clear enough.
It's quite a complex problem, but I see no immediate reason to think ga() would fail.
Thank you for your reply and your time Matt J. I replaced the complex problem with a simple formualtion. Hope this is more clear.
So, you are sure that it is possible to solve a non-convex non-linear integer programming obtimization with ga when we have an abjective that calls a function with a parameter that the parameter is a decision variable right?
It's possible. There are never any guarantees in non-convex minimization and ga() is a stochastic algorithm.
that's ok. Atleast we can solve it even though it may not return the optimal solution. And ga() by default tries to minimize, but I want to maximize my objective function. I guess that is not a problem. I just need to use a negative sign before my objective function. Is that correct? And any constraint for constraints? Is it ok to have non-convex and non-linear constraints in ga? Sorry if my questions are too basic.
And maybe as the last question and request, would you please point me to a few examples that have similar problem formulations and have used ga()? I will check the examples in ga documentation, but my problem has multiple sets and the objective function is over three sets and pretty complicated. Samewise for constraints. The given examples on the documentation usually are very simple and I don't know how to go from there to my problem. I apologize again for asking many questions.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by