Is there an Optimization tool like intlinprog that includes nonlinear constraints?
1 次查看(过去 30 天)
显示 更早的评论
I have a program that uses the genetic algorithm in matlab to optimize the solution. Historically, I have used intlinprog before running the ga() to make sure a feasible solution exists (the solution is constrained to be binary and has linear constraints. So I would make a call like this:
solvable = intlinprog(ones(1, nVars),1:nVars,A,b,[],[],zeros(1, nVars),ones(1, nVars));
However, now I need to include nonlinear constraints. Is there a similar solver to intlinprog or a way to include nonlinear constraints to check for a feasible solution?
(To be clear - I am not asking whether or not I can include nonlinear constraints in the genetic algorithm; I am aware that I can.)
0 个评论
回答(1 个)
Matt J
2018-10-4
编辑:Matt J
2018-10-4
You could do a preliminary run of ga() with a constant, artificial fitness function like f(x)=0. That would be a way of scouting for a feasible solution without incurring the computational costs of your actual fitness function.
7 个评论
Matt J
2018-10-5
编辑:Matt J
2018-10-5
Unfortunately, I cannot risk the check failing if a feasible solution does in fact exist.
Well, unfortunately, I don't think you'll be able to avoid that risk. There is no general and guaranteed way of finding a point that satisfies an arbitrary set of nonlinear (in)equalities or verifying if one exists. If there were, nonlinear equation solvers like fsolve wouldn't need an initial guess as input and would never be in danger of getting stuck in local minima.
If you describe the particulars of your nonlinear constraints, maybe the forum could suggest custom solutions for that particular family.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!