# How can I minimize absolue value in a power optimprob?

3 views (last 30 days)
Danny on 21 Oct 2021
Commented: Matt J on 21 Oct 2021
Hi everybody,
I'm studying a power optimprob which involves a microgrid composed by a PV system, an energy storage, loads and an EV. It is summed up as a big node in which I assume absorbed power is negative (i.e. loads) and generated power is positive (i.e PV), so that I have power balance as:
where Pg is the power flow delivered from (or to) the main grid. The objective is to minimize the integral of Pgrid abs value, so that the power exchanges beetween the main grid and the power grid are minimized, while the control variables are Pbatt and Pev; Ppv and Pload are fixed.
After the setting of constraints , how can I formulate this problem? How can I define my objective function? Have I to set Pgrid too as an optimvar? And how should I treat abs value?
##### 2 CommentsShowHide 1 older comment
Danny on 21 Oct 2021
Edited: Danny on 21 Oct 2021
Hi @Rik,
thanks for your suggestions. My problem sounds like a variant of this Matlab example: https://it.mathworks.com/matlabcentral/fileexchange/73139-microgrid-energy-management-system-ems-using-optimization?s_tid=srchtitle&#examples_tab. In my specific case, I would like to find Pbatt and Pev profiles (subject to power and energy constraints) in order to minimize abs value of Pgrid.

Matt J on 21 Oct 2021
Edited: Matt J on 21 Oct 2021
The objective is to minimize the integral of Pgrid abs value... while the control variables are Pbatt and Pev; Ppv and Pload
where C is just C=[1;1;1;1] and C*x=Pgrid.
If I've interpreted correctly, then minL1lin is applicable
##### 2 CommentsShowHide 1 older comment
Matt J on 21 Oct 2021
Yes, that sounds right.