network optimization when constraint calls a function

조회 수: 6 (최근 30일)
sina
sina 2017년 5월 27일
댓글: Walter Roberson 2017년 5월 29일
I am trying to optimize a network using GA. The objective function is to minimize x(3). The formulation is as follows:
x(0) is known.
Constraint file:
% equality
c_eq(1) = x(0) + x(4) - x(1);
res_fun = f(x(1));
c_eq(2) = x(2) - res_fun;
c_eq(3) = x(2) - x(4) - x(3);
% inequality
c(1) = x(0) - x(3);
[x,fval] = ga(ObjectiveFunction,nvars,[],[],[],[],LB,UB, ConstraintFunction);
And my question is that the formulation is correct?
Thank you.
  댓글 수: 10
sina
sina 2017년 5월 28일
I followed exactly what you mentioned but I don't know why no generation loaded
It's a function calculate something, I think it's not a problem as I run this function many times without any problem.
Walter Roberson
Walter Roberson 2017년 5월 29일
You need to post all of your code.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by