matlab - Find the optimum combination -
i trying optimise this: function [ lps, lce ] = runproject( nw, np, nb)
calls other functions have written before. idea find optimum combination of nw
, np
, nb
, keep lps=0
, while lce
minimum. nw
, np
, nb
should positive integers. lce
positive.
function [ lps, lce ] = runproject( nw, np, nb) % % detailed explanation goes here [pg, pw, pp] = pgener(); [pb, lps] = bat( pg ); [lce] = constr(pw, pp, nb) end
however, tried gamultiobj
solver global optimization toolbox of matlab2015 (trial version) different approach pareto front, got error: "optimization running. error running optimization. not enough input arguments."
you should write objective function following example:
function scores = rastriginsfcn(pop) %rastriginsfcn compute "rastrigin" function. % pop = max(-5.12,min(5.12,pop)); scores = 10.0 * size(pop,2) + sum(pop .^2 - 10.0 * cos(2 * pi .* pop),2);
as can see, function accepts inputs single vector pop
.
with such representation can evaluate function follows:
rastriginsfcn([2 3]) >> ans 13
still running optimization toolbox have mention number of variables, instance, in example equal 2:
[x fval exitflag] = ga(@rastriginsfcn, 2)
it same multi-objective optimization. check following image mathworks:
Comments
Post a Comment