关于fmincon在凸优化问题中初始点影响收敛结果的疑问
Great question—this is a common point of confusion when working with convex optimization in practice, especially when tools like fmincon don’t behave exactly as you’d expect from theory. Let’s break this down step by step:
First, the core rule: For strictly convex optimization problems, any reliable convex optimization algorithm (including the interior-point method used by default in fmincon) should converge to the unique global minimum, regardless of the initial point. For convex (but not strictly convex) problems, there may be multiple optimal points, but the objective function value at all these points will be identical.
So if you’re seeing different objective values (fval) from different initial points, one of three things is happening:
- Your problem isn’t actually convex (you might have made a mistake in the convexity analysis)
- Numerical precision issues are causing
fminconto stop at slightly different suboptimal points - Non-smooth elements in your problem are throwing off the algorithm
fmincon Runs Are Giving Different Results Let’s look at your specific problem to diagnose:
a. Check Convexity of Your Objective & Constraints
You stated your problem is convex, but let’s verify key parts:
- The transmission rate
r_k = x_k * log2(1 + g_k*p_k/x_k)is a concave function ofx_k(you can confirm this by computing the second derivative, which will be negative forx_k > 0). - Your objective is
sum( p_k*b_k / r_k )—sincer_kis concave and positive,1/r_kis a convex function (for positive concave functions that are increasing, their reciprocals are convex). So the objective should indeed be convex. - Your nonlinear constraint has a
max(in_s./r_ul)term. While the maximum of convex functions is convex, this introduces a non-smooth point (the gradient of the max function is discontinuous when two elements ofin_s./r_ulare equal).fmincon’s interior-point method is designed for smooth convex problems; non-smoothness can cause the algorithm to converge to different points depending on the initial guess.
b. Numerical Precision Settings
By default, fmincon uses relatively loose tolerance thresholds. If your optimal region is flat (or nearly flat), the algorithm might stop early at slightly different points that meet the default tolerance criteria but aren’t truly the global minimum.
Here are actionable steps to resolve your issue:
- Replace the non-smooth max constraint: Your current constraint
max(in_s./r_ul) + in_e./r_ul - T1 ≤ 0can be rewritten as a set of smooth constraints. Themaxterm means the largest value ofin_s./r_ulplus eachin_e./r_ulmust be ≤ T1. This is equivalent to for every user k,in_s./r_k + in_e./r_k ≤ T1(since if the largestin_s./r_ksatisfies this, all smaller ones will too). Removing themaxeliminates non-smoothness, making the problem fully smooth and convex. - Tighten
fmincon’s numerical tolerances: Adjust the options to force the algorithm to converge more precisely:options = optimoptions('fmincon', ... 'OptimalityTolerance', 1e-10, ... 'ConstraintTolerance', 1e-10, ... 'StepTolerance', 1e-10, ... 'MaxFunctionEvaluations', 1e5, ... 'MaxIterations', 1e4); problem.options = options; - Use a dedicated convex optimization tool: If
fminconstill gives inconsistent results, switch to a tool like CVX (a Matlab-based convex optimization modeling framework). CVX automatically verifies convexity, selects appropriate algorithms, and guarantees convergence to the global minimum for valid convex problems.
Here’s how to model your energy minimization problem in CVX:
user_num = size(p_ul, 1); CVX_begin variable x(user_num) > 0 % Ensure x_k is positive to avoid division by zero minimize( sum( (in_s + in_e).*p_ul ./ (x .* log2(1 + a.*p_ul./x)) ) + sum(C1) ) subject to sum(x) <= BW2; % Total bandwidth constraint % Replace max constraint with per-user smooth constraints for k = 1:user_num (in_s + in_e(k)) ./ (x(k) * log2(1 + a(k)*p_ul(k)/x(k))) <= T1; end CVX_end % Access results: b_ul = x; fval = CVX_optval;
After making these changes, you should see consistent global optimal results regardless of the initial point. The key issue here was likely the non-smooth max constraint, which fmincon’s interior-point method struggles with. Switching to smooth constraints or using CVX will eliminate this problem.
内容的提问来源于stack exchange,提问作者user3919259

