function [ x_sol, energy ] = find_min( index, lens_placement, fitness_simplified, MaxFunEvals, MaxIter ) %Minimizes energy for given solution [x_sol, energy] = fminsearch(fitness_simplified, lens_placement(index,:), optimset('TolFun',1e-5,'MaxFunEvals',MaxFunEvals,'MaxIter', MaxIter)); end