FMINCON optimizer not plotting
Mostrar comentarios más antiguos
I'm working on optimizing mesh parameters in a CFD software with fmincon. I have an objective function that imports the parameter values by reading a csv file, replaces them in the cfd software, and runs the simulation. I am trying to get fmincon to optimize those values for me by comparing the simulation results to wind tunnel results. The function generates an error value between the simulated and wind tunnel data. When I run the optimizer it opens the objective function and runs the simulation but does not generate a plot with the fval and iteration it just starts another simulation once the first has completed without optimizing any of the parameters. Here's the code I am currently using.
options = optimoptions('fmincon','Display','iter','PlotFcns',@optimplotfval); parameters = [25,10,50,50,1.5,360,0]; fun = @Run_Java; A=[]; b=[]; Aeq=[]; beq=[]; lb=[]; ub=[]; nonlcon=@paramcon; [x,fval,exitflag,output]=fmincon(fun,parameters,A,b,Aeq,beq,lb,ub,nonlcon,options);
Respuestas (1)
Alan Weiss
el 14 de En. de 2018
0 votos
Most likely what you are seeing is that fmincon is taking finite difference steps to estimate a gradient in order to calculate the next evaluation point. That is why, in general, the number of Feval (function evaluation points) is larger than the number of iterations.
By the way, for a simulation you might need to take larger-than-default finite differences. See Optimizing a Simulation or ODE.
Alan Weiss
MATLAB mathematical toolbox documentation
Categorías
Más información sobre Nonlinear Optimization en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!