Ga does not find the optimal value
Show older comments
Hi Matlab comunity after I tried fmincon:
I now tried ga to solve my problem with integers
x=ga(@(x)fAraucoMarkt(x,AraucoEnergy),4,[],[],[],[],LB,RB,@(x)bedMarkt(x,AraucoEnergy),[2:4]);
I guess it works but I do not get the optimal solution:
x=ga(@(x)fAraucoMarkt(x,AraucoEnergy),4,[],[],[],[],LB,RB,@(x)bedMarkt(x,AraucoEnergy),[2:4]);
Optimization terminated: average change in the penalty fitness value less than options.FunctionTolerance
but constraints are not satisfied.
Is there anyway to get a better solution (I was thinking of random starting numbers and than a list of all found solutions) but as I can not define start point I do not know how to get this.
And while I am at it I had an nonlinear eauqlity constrain which was like this
ceq(1)=Restschuld-0;
I was thinking in changing it to a inequality constrain Restschuld is smaller than 1 and bigger than -1
but I dont know how to do this any idea?
Anyone an Idea
Greetings
Erik
2 Comments
Walter Roberson
on 4 May 2022
Restschuld is smaller than 1 and bigger than -1
Those would be bounds constraints, which you would store in LB and RB
Erik Beste
on 4 May 2022
Accepted Answer
More Answers (1)
I was thinking in changing it to a inequality constrain Restschuld is smaller than 1 and bigger than -1
"When intcon is nonempty, nonlcon must return empty for ceq. For more information on integer programming, see Mixed Integer ga Optimization."
1 Comment
Erik Beste
on 4 May 2022
Categories
Find more on Solver Outputs and Iterative Display in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!