I have a convex problem (Power shaving) as follows:

A) Version 1:

gird=Load+cb*x

cb is battery capacity which is constant

Load is given and constant

x is the vector of charging and discharging which is the convex variables.

the constraints are:

x>=-1

x<=0.4

Es>=0

Es<=full capacity

where Es= cb*integral (x)

The objective is to optimize the bill amount

the bill amount = sum(grid)*rate+max(grid)*100

let say the rate is 10.

The problem is solved using cvx

B) version 2

Let’s make the problem more complex by assuming that:

rate =10 if x>=0

rate=1 if x<=0 ; % they pay me small money back if provide them with some power;

I can use the big M value and linearization to solve the issues however when dealing with data of year using the binary variable make solving the problem difficult

C) Version 3

I try here to **remove the binary variable with a continuous variable** using **Sigmond function**

I am planning to use the sigmond function to represent the rate such that

rate = 1 + 9 * (1/(1+exp(-x)))

the new objcive will be:

the bill amount = sum(grid)* (1 + 9 * (1/(1+exp(-x))) )+max(grid)*100

for reminder the grid=Load+cb*x; %(Load and cb are constants and x is cvx variable).

we can not multiply variables in cvx optimization, but I have seen that exp still can be used with cvx. is my problem version 3 doable in cvx optimization? and If so would you please help me to represent it in cvx?

I saw a similar issue in the following forum but I could not understand it:

How to express “x*(2^(1/x)-1)” in CVX