I am using the Yalmip to optimize a polynomial according to existed data points.
When the equation is to minimize sum((y-yi)), I can get the results.
However, when the equation is to minimize sum(abs(y-yi)). I could not get the correct results.
yalmiptime: NaN
solvertime: NaN
info: 'Unknown problem in solver (Turn on 'debug' in sdpsettings) (Error using ldl
Out of memory....'
problem: 9
Do you know the reason? How could I modify the current code? Thanks.
The relevant code is folowing:
%Both CurveFit.High_postive_power and CurveFit.High_FC are (20000*1) vector.
a = sdpvar(1);
b = sdpvar(1);
c = sdpvar(1);
d = sdpvar(1);
% High power area fc=e*x^2+f*x+h
e = sdpvar(1);
f = sdpvar(1);
h = sdpvar(1);
constr_Low=[1e-7<a<5e-7,-9e-7<b<1.5e-5, 8e-5<c<3e-4,-2.3e-4<d<2.3e-4];
constr_High=[5e-7<e<2e-6,8e-6<f<3e-5,2.5e-5<h<1e-3];
residual_High=abs(e*CurveFit.High_postive_power.*CurveFit.High_postive_power+f*CurveFit.High_postive_power+h-CurveFit.High_FC);
optimize(constr_High,sum(residual_High))