I'd like to numerically solve a sequential Cournot competition in which supplier 1 moves before supplier 2, then the manufacturer sources from them, and finally sells the item at market clearing price. I know how to solve it analytically, but I would like to learn how I can use Mathematica for such problems. (So please assume that the last step of the backward induction cannot be solved analytically, that is, the optimal quantities.)

Technically, I want to solve:

Given production costs $c_1=1$, $c_2=2$ and market size $A=10$, while wholesale price $w_1$ and $w_2$ are set by suppliers and quantities $q_1$ and $q_2$ are set by the manufacturer.

$\underset{w_1 \geq 0}{\max} q_1 (w_1-c_1)$.


$\underset{w_2 \geq 0}{\max} q_2 (w_2-c_2)$


$\underset{q_1\geq 0 , q_2 \geq 0}{\max} (A - q_1 - q_2) (q_1+q_2) - q_1 w_1 -q_2 w_2$

It would be great, if you could show me how this one works, because then I can hopefully transfer it to more complex problems.

PS: I am aware of the functions Maximize, Findmaxvalue. My problem is nesting these things and most likely defining on variable as the input of another function.

Profit functions to start working with

(*Quantity *)
p[A_, q1_, q2_] := A - q1 - q2
Mprofit[A_, q1_, q2_, w1_, w2_] := 
 p[A, q1, q2] (q1 + q2) - w1 q1 - w2 q2
Sprofit[q_, w_, c_] := q (w - c)
  • $\begingroup$ seems like it could be molded into a LinearProgramming problem, maybe? $\endgroup$
    – thorimur
    May 3, 2021 at 19:10
  • $\begingroup$ though, also check out NMaximize $\endgroup$
    – thorimur
    May 3, 2021 at 19:10
  • $\begingroup$ @mikado, I clarified the variables. Would be great, if you could give it a look $\endgroup$
    – user34047
    May 4, 2021 at 8:03
  • 2
    $\begingroup$ There's a pedagogical article on this topic (building Cournot models in Mathematica) economicsnetwork.ac.uk/cheer/ch19/kochanski.pdf $\endgroup$ May 5, 2021 at 19:12
  • 1
    $\begingroup$ I'm not that kind of dismal scientist. $\endgroup$ May 7, 2021 at 12:48


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.