I am trying to maximize expected revenue over a horizon.

Consider the following function:

\begin{align} sales(budget_1, budget_2) = \sum_te^{C_1t} * budget_1t^{saturation_1t} + e^{C_2t} * budget_2t^{saturation_2t} \\ \end{align}

where $t$ denotes the timestep and $0 \le (saturation_1t, saturation_2t) \le 1$ thus exhibiting diminishing marginal returns and $C_1t, C_2t$ acts as our exponents for the coefficients.

Now consider a budget ceiling of $B$.

My aim is to reach a target ROI (return on investment) while maximizing the budget, thus giving a target $T$:

\begin{align} \max_{budget_1, budget_2} \sum_tbudget_1t + budget_2t \end{align}

subject to the constraints:
\begin{align} \frac{\sum_te^{C_1} * budget_1^{saturation_1} + e^{C_2} * budget_2^{saturation_2}}{\sum_tbudget_1t + budget_2t} & \ge T \\\\ \sum_tbudget_1t + budget_2t & \le B \end{align} Is this a bad way of formulating it and if so/not so what would be an appropriate solver for such a problem?

I assume that the constraint may introduce some concavity.

  • $\begingroup$ Is t a subscript i.e should budget_1t be budget_{1,t}? Have you forgotten budget_{1,t}>=0? What is variables and what is constants? Is it supposed to be a convex problem? $\endgroup$ Jan 11 at 18:49
  • $\begingroup$ If the problem is convex you can formulate it as a conic optimization problem see docs.mosek.com/modeling-cookbook/index.html. These problems can be solved with mosek.com. You can also use cvxpy.org. $\endgroup$ Jan 11 at 18:52

1 Answer 1


Assuming C1,C2 are constants, just rearrange your first constraint as

$\sum_t(e^{C_1} * budget_1^{saturation_1} + e^{C_2} * budget_2^{saturation_2}) \ge T\sum_t t(budget_1 + budget_2)$\

Appropriate solver will be Gurobi, CPLEX to name a few. You can import them on Google Colab or use NEOS


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.