Optimization running. Error running optimization. Not enough input arguments.

조회 수: 5 (최근 30일)
gefunction [y] = project(a,b,c)
y(1) = 298.83636363636-0.18804545454545*a-1.2545454545454*b+103.18181818182*c-0.00016666666666667*a*b+0.049999999999998*a*c +2.3333333333333*b*c+(5.3409090909091*exp^-05)*a*a+0.011717171717172*b*b-745.45454545455*c*c;
y(2) = 42.35866-0.061045*a+0.130620*b+55.76455*c -0.000055*a*b-0.015875*a*c +0.088333*b*c +0.000024*a*a-0.000818*b*b-95.63636*c*c;
y(3) = -0.009606+0.000015*a-0.000023*b+0.013440*c+(3.16667*exp^-09)*a* b-(1.25000*exp^-06)*a*c+0.000017*b*c-(5.30227*exp^-09)*a*a+(1.52929*exp^-07)*b*b-0.03183*c*c;
end
my bounds are [1200 30 0.15] till [1600 60 0.25]
first time to use genetic algorithm optimization.
i gave the fitness function as @project.
then gave no: of variable as 3
then i gave the bounds
and clicked on start
i got this error as "Optimization running. Error running optimization. Not enough input arguments."
is there any steps i missed or is the equation not suitable for optimization

채택된 답변

Stephen23
Stephen23 2019년 1월 29일
편집: Stephen23 2019년 1월 29일
According to the ga help the function should accept one input argument and return a scalar: "Write the objective function to accept a row vector of length nvars and return a scalar value", so your function would be something like this:
function y = project(x)
a = x(1);
b = x(2);
c = x(3);
y = .... your calculation
end
Note that you will have to change your calculation to return a scalar (it currently returns a vector).
  댓글 수: 1
uma shankar santharaman
uma shankar santharaman 2019년 2월 3일
how to optimize more than three output variables
like y(1), y(2),y(3).
is it possible what"s the code for that?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by