Let $f(t) \in \mathbb{R}^+$, $g(t) \in \mathbb{R}^+$ be bounded and integrable functions, $A>0$ and $0 < \eta \leq 1$. If $h(t) = A\cdot f(t) - g(t)$, what needs to be the value of $A$ to satisfy
\begin{equation}
\int_0^T \bigl(h^+ - \frac{h^-}{\eta}\bigr) dt =0
\end{equation}
where $h^+$ and $h^-$ are the absolute positive and negative parts of $h(t)$, respectively.
Background: In solar energy storage, the size of both the storage and the solar field are not determined a priori. If $g(t)$ is the demand, $f(t)$ is the solar irradiation, $A$ is the size of the field and $\eta$ is the round-trip efficiency of the storage, an answer to the above question determines the size of the solar field and indirectly the size of the storage for arbitrary demand and supply curves.