ODE15s vectorization in GA Optimization
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi there,
I'm trying to optimize a certain system. I'm using ga. There I've selected the 'UseVectorized' option.
options=optimoptions('ga','UseVectorized',true,'PopulationSize',popsize,'InitialPopulationMatrix',population);
I also provide a small initial population (17) for sake of initial tests. The problem has 16 variables.
[x,fval]=ga(@optimize_exp07_1,16,[],[],[],[],[],[],[],options);
The function @ODEfun is then integrated in regard to its 19 differential equations.
options = odeset('RelTol',1e-9,'Vectorized','on','MaxStep',1e-1);
[t,y]=ode15s(@ODEfun,experiment.timespan_min,y0,options);
Note that I selected 'Vectorized' as 'on' here as well. The @ODEfun, which calculate the derivatives, receives the following initial values y0:
The output (derivatives) is generated as follows:
The problem is, in whatever format I try to return these derivatives, I get error from odeset:
19x17:
Error using odearguments (line 93)
POLYMERIZE/ODEFUN must return a column vector.
Error in ode15s (line 150)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in polymerize (line 54)
[t,y]=ode15s(@ODEfun,experiment.timespan_min,y0,options);
323x1 (column vector):
Index exceeds matrix dimensions.
Error in odenumjac (line 151)
absFdelRm = abs(Fdel((0:ny-1)*nF + Rowmax));
Error in ode15s (line 353)
[dfdy,Joptions.fac,nF] = odenumjac(odeFcn, {t,y,odeArgs{:}}, f0, Joptions);
Error in polymerize (line 54)
[t,y]=ode15s(@ODEfun,experiment.timespan_min,y0,options);
Do you have any suggestion on how to make this vectorization of ODE15s work in this problem?
Thanks in advance!
3 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Genetic Algorithm dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!