Problems with GA function (global optimization toolbox)
Mostra commenti meno recenti
I am trying to execute the global optimization toolbox function ga, but my FITNESSFUNCTION has another non-parameterized values. Specifically I want to call another function with multiple parameters inside the calling of ga function :
FITNESSFUNCTION = @(x1,x2,x3) mod_sol(x1, x2, x3, DSSCircuit, DSSText, canb(1), cand(1), i, s1);
[x_sol, f_sol] = ga(FITNESSFUNCTION,3, [], [], [], [],lb, ub, [], [], opts);
the parameters to be optmized are x1, x2 and x3, but I need doing some other calculus with the variables DSSCircuit, DSSText, canb(1), cand(1), i et s1 in order to evaluate the fitness function
6 Commenti
Walter Roberson
il 27 Gen 2016
What difficulty are you encountering? That syntax looks appropriate.
Jose Vivas
il 27 Gen 2016
Modificato: Walter Roberson
il 27 Gen 2016
jgg
il 27 Gen 2016
It looks like there's a problem in your mod_sol function, specifically with balvolag_v1 which you haven't included.
Walter Roberson
il 27 Gen 2016
Not quite, balvolag_v1 appears to be the name of the file that contains the calls the user shows.
The problem is something to do with mod_sol, such as if mod_sol cannot be found, or one of the named variables does not exist at the time the anonymous function is created.
Jose Vivas
il 28 Gen 2016
Modificato: Jose Vivas
il 28 Gen 2016
Walter Roberson
il 28 Gen 2016
More likely you would need
FITNESSFUNCTION = @(x) mod_sol(x(1), x(2), x(3), DSSCircuit, DSSText, canb(1), cand(1), i, s1);
Risposte (0)
Categorie
Scopri di più su Problem-Based Optimization Setup in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!