RuntimeWarning: in SCS or The lower bound specified is not a number (nan). in MOSEK

38 views
Skip to first unread message

Xu Siyuan

unread,
May 23, 2021, 12:01:30 PM5/23/21
to cvxpy

I am trying to solve a problem that involves absolute value (not sure if that's the reason causing the error),

But if I use SCS, I have this error warning: RuntimeWarning: invalid value encountered in double_scalars using SCS.

However, if I switch to MOSEK, I encounters this error.

raise Error(rescode(res),msg)

Error: The lower bound specified is not a number (nan).

So I am not sure what's the reason behind this issue.

The following is simplified objective and constraints.

obj = cp.Minimize(sum((beta[i]* mu1_vec[i] * \ (abs(1+(agg_battery[3]-battery_ind[i][3])/agg_battery[3]))* \ agg_battery[0]- (1-agg_battery[0])*agg_battery_SOC[time-1] + \ bld_decision[time]) for i in range(num_buildings))) constraints = [] for i in range(num_buildings): constraints += [beta[i] * 16 <= 4] constraints += [beta[i] * 16 <= 4] constraints += [sum(beta[i] for i in range(num_buildings)) <= 1, \ sum(beta[i] for i in range(num_buildings)) >= 1]

Xu Siyuan

unread,
May 23, 2021, 12:03:11 PM5/23/21
to cvxpy
obj = cp.Minimize(sum((beta[i]* mu1_vec[i] *  (abs(1+(agg_battery[3]-battery_ind[i][3])/agg_battery[3]))*  agg_battery[0]- (1-agg_battery[0])*agg_battery_SOC[time-1] +   bld_decision[time]) for i in range(num_buildings)))  

for i in range(num_buildings):
        constraints += [beta[i] * 16 <= 4]
        constraints += [beta[i] * 16 <= 4]
    
    constraints += [sum(beta[i] for i in range(num_buildings)) <= 1, \
                   sum(beta[i] for i in range(num_buildings)) >= 1]

Erling D. Andersen

unread,
May 26, 2021, 1:39:53 AM5/26/21
to cvxpy

The Mosek error means that cvxpy sends invalid numbers into Mosek. 

Maybe there are nans in your data and cvxpy does not check for that.

A nan means not a number. For instance 1/0 is a nan.
Reply all
Reply to author
Forward
0 new messages