Why does the "fsolve" function in Optimization Toolbox not converge when using a quadratic cost function?

6 visualizaciones (últimos 30 días)
I am using the "fsolve" function to optimize a vector of complex coefficients using a quadratic cost function.
 
I am able to obtain accurate results if I use a linear cost function. However, when I use the quadratic cost function, the solver does not converge. Why does using linear cost converge but using quadratic cost does not converge?

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 18 de Jun. de 2025
Editada: MathWorks Support Team el 18 de Jun. de 2025
The algorithm in "fsolve" already solves for the quadratic form that you want. See the Algorithm notes in the following documentation page:
The following reference page explains more about the algorithm "fsolve" uses:
If you would still like to solve using a quadratic cost function, you could use the "quadprog" function. 
Another reason that problems do not converge could be scaling. If the initial point is very large when squaring the objective function, this value is also squared. Thus, the solver starts from a much "worse" point.
One possible remedy could be to scale the problem so that the objective values are in a more reasonable range. You might find the "center and scale your problem" section in this documentation page helpful:

Más respuestas (1)

Matt J
Matt J el 26 de Sept. de 2023
Very often, quadratic functions have no roots to find, e.g.,
fsolve(@(x) abs(x).^2+1, [1+1i;0+3i])
No solution found. fsolve stopped because the problem appears regular as measured by the gradient, but the vector of function values is not near zero as measured by the value of the function tolerance.
ans =
0.0000 + 1.0000i -0.0000 + 3.0000i

Categorías

Más información sobre Quadratic Programming and Cone Programming en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by