How to write non linear constraint function in a genetic algorithm optimization toolbox?

4 ビュー (過去 30 日間)
Raju Das
Raju Das 2016 年 1 月 20 日
コメント済み: Raju Das 2016 年 1 月 22 日
I want to use optimization tool box to solve a problem using GA as a solver. But in the toolbox window i have to insert the constraint function, that i don't know how to write. I am using Matlab 7.8.0.347 (R2009a) version.

回答 (2 件)

Walter Roberson
Walter Roberson 2016 年 1 月 20 日
There is no particular way to write the nonlinear constraint function. It accepts a vector of input values and returns two row vectors of output values (neither of which needs to be the same size as x). In the first output, return one value for each distinct constraint, and the constraints will be considered to be met if all of those values are less than or equal to 0. For the second output, return one value for each distinct constraint, and the constraints will be considered to be met if all of those values are equal to 0.
How you calculate those values is up to you. You can use logical conditions to test ranges. You can use math. You can use image processing tools, whatever you can think of.

Alan Weiss
Alan Weiss 2016 年 1 月 20 日
Alan Weiss
MATLAB mathematical toolbox documentation

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by