Want Less "Noisy" Solution from fmincon
Show older comments
Been trying to use fmincon to optimize the mass of a column given a target load.
The results I am getting from fmincon are quite noisy, and I'm wondering if there are ways to decrease the noisy-ness of the solution.
The solution I have right now looks something like this (y-axis is mass, x-axis is load) -- see attached image.

Maybe I am not tweaking the options to fmincon correctly? I tried using more "randomized" x0 values but this seemed to make the issue worse.
Any help would be appreciated :)
6 Comments
Walter Roberson
on 20 Apr 2018
What are the equations being optimized ?
bsquared
on 20 Apr 2018
Walter Roberson
on 20 Apr 2018
Could you show your set-up through calls to fmincon ?
bsquared
on 20 Apr 2018
Walter Roberson
on 20 Apr 2018
Which is the input that represents load?
I initialized with
rho = rand; Fval = rand; p_hollowCore = rand(1,21); Kbar_fullAdh = rand; Ebar = rand; v = rand;
is that acceptable, or should some of the variable be a different size or a different range?
bsquared
on 20 Apr 2018
Accepted Answer
More Answers (1)
Walter Roberson
on 20 Apr 2018
load('pVals.mat');
rho = 0.11;
Kbar_fullAdh = 0.03;
Ebar = 0.01;
v = 0.3;
M = @(x) pi*((2*x(1)) + ((1-(x(2)^2))*rho));
lb = [0.00005, 0, 5]; ub = [0.3, 1, 25];
options = optimset('Display', 'off', 'Algorithm', 'active-set', ...
'MaxIter', 1e3, 'MaxFunEvals', 5e3, 'TolX', 1e-5);
Fval_lb = 1e-4; Fval_ub = 0.015; Fval_vals = linspace(Fval_lb, Fval_ub); n_Fval = length(Fval_vals);
blue_x = zeros(n_Fval, 3); black_x = zeros(n_Fval, 3);
cla;
hb3 = animatedline('Color', 'b', 'DisplayName', 'blueLine(3)');
hk3 = animatedline('Color', 'k', 'DisplayName', 'blackLine(3)');
legend('show')
blueInit = lb + rand(size(lb)).*(ub - lb); blackInit = blueInit;
for J = 1 : n_Fval
Fval = Fval_vals(J);
nonlcon_blue = @(x)fn_blueLine(x, Fval, ...
p_hollowCore, Kbar_fullAdh, Ebar, v);
nonlcon_black = @(x)fn_blackLine(x, Ebar, v, Fval);
[this_blue_x, ~, ~, ~, ~] = fmincon(M, blueInit, [], [], [], ...
[], lb, ub, nonlcon_blue, options); blue_x(J,:) = this_blue_x;
addpoints(hb3, Fval, this_blue_x(3)); [this_black_x, ~, ~, ~, ~] = fmincon(M, blackInit, [], [], [], ...
[], lb, ub, nonlcon_black, options); black_x(J,:) = this_black_x;
addpoints(hk3, Fval, this_black_x(3)); blueInit = this_blue_x;
blackInit = this_black_x;
endCategories
Find more on Solver Outputs and Iterative Display in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
