MATLAB Answers

Failure in initial user-supplied nonlinear constraint function evaluation

조회 수: 10(최근 30일)
ugur simsek
ugur simsek 2021년 7월 23일
편집: Matt J 2021년 7월 23일
Hi,
Basically, objective value is determined by Ansys analyses and the constraint function is dependent to a special sum
of x values. But, the initial value of constraint function can not be calculated. Can anyone point me about the problem? I attached the matlab file
and error message below.
Thank you
Error using ga (line 393)
Not enough input arguments.
Error in run_script (line 27)
[x,fval,output,population,exitflag] = ga(ObjectiveFunction,nvars,...
Caused by:
Failure in initial user-supplied nonlinear constraint function evaluation.

채택된 답변

Matt J
Matt J 2021년 7월 23일
편집: Matt J 2021년 7월 23일
One problem:
nonlcon = @simple_constraint;
There is no function called 'simple_constraint' in your attached script. There is a function called 'simple_const' which is never used.
  댓글 수: 4
Matt J
Matt J 2021년 7월 23일
ga() will try to pass a single vector argument to your constraint function (and nothing else). Your constraint function needs to be prepared for that

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

추가 답변(0개)

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by