How can we optimize two fucntions in genetic algorithm ?

Suppose that we have two functions F1(X) and F2(X), where X=[x1,x2,x3,...xn]
we want to find the minimum value of F1 such taht F2(X)<= desired value
How can we do that by using genetic algorithm tool box in maltab ?
your help and consideration are much appreciated

Answers (1)

use F2(x)<target as a nonlinear inequality constraint .

11 Comments

please can you explain more ? example
i have this kind of problem
Error in the following problem input(s):
nonlcon: Not enough input arguments.error_1.PNG
this is my constrain function
function [T,ceq]=my_constrain_1(tuk0)
T=SLL_1(tuk0)+20 ;
ceq=[] ;
end
perhaps SLL_1 needs more inputs ?
i dont think so, SLL_1 function it works very well, i have test it already
dbstop if caught error
then execute and see where it stops
please, can you give me an screen shot ?
You asked for a screen shot, so I sent you a screen shot. I change directory to a directory I set aside for working on your question (which is question #431109). I used ls to be sure that the directory was empty in case I was in the wrong directory. Then I give the
dbstop if caught error
command that I told you before, and which appears to be what you were asking to see a screenshot of. (I don't know, perhaps you needed to see that it was being issued at the command line.) After that I start optimtool, the tool you seem to be using. You would then fill in the various fields, choosing the solver, entring the population and so on. Then you would ask to execute.
Eventually the error about insufficient input arguments would show up. At that point you should command
dbstack
to see which line was executing at the time of the problem.
thank you so much, i will try that

This question is closed.

Products

Asked:

on 21 Nov 2018

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!