schema: EconSchema
aspectRatio: 1.4
params:
- name: n
value: 1
min: 1
max: 100
round: 1
- name: c
value: 5
min: 1
max: 10
round: 1
- name: e
value: 0
min: -5
max: 5
round: 1
calcs:
s: (1/params.n)
Qn: (((params.n)*(20+(params.e)-(params.c)))/(1+(params.n)))
Qm: (((1)*(20+(params.e)-(params.c)))/(1+(1)))
Pn: (20+(params.e)-(calcs.Qn))
Di: ((20+params.e)-(params.c))
Di2: ((20+params.e)-(0))
DWL: ((calcs.Pn-params.c)*(calcs.Di-calcs.Qn)/2)
RMgm: (20+params.e-2*(calcs.Qm))
layout:
TwoVerticalGraphsPlusSidebar:
topGraph:
xAxis:
min: 0
max: 25
ticks: 4
yAxis:
min: 0
max: 25
ticks: 4
objects:
#Função de Demanda
- Curve:
fn: "(20+params.e)-x"
ind: x
min: 0
max: 100
color: blue
strokeWidth: 3.5
samplePoints: 300
#Função de Receita Marginal "n" Firmas
- Curve:
fn: "(20+params.e-x)*(1-(calcs.s*(x)/(20+params.e-x)))"
ind: x
min: 0
max: 100
color: green
strokeWidth: 2
samplePoints: 300
#Função de Receita Marginal Monopolio
- Curve:
fn: "(20+params.e-2x)"
ind: x
min: 0
max: 100
color: blue
strokeWidth: 2.5
samplePoints: 300
#Função de Custo Marginal
- Curve:
fn: "params.c"
ind: x
min: 0
max: 100
color: red
strokeWidth: 3.5
samplePoints: 300
- Area:
fn1: "((20+params.e)-x)"
fn2: "(20+params.e-2x)"
fill: "'#66ff00'"
opacity: 0.4
- Area:
fn1: "((20+params.e)-x)"
fn2: "params.c"
fill: grey
min: calcs.Qn
max: calcs.Di
opacity: 0.8
- Label:
coordinates: [((calcs.Di+calcs.Qn+0.7)/2),((calcs.Pn+params.c-4)/2)]
text: DWL
bgcolor: grey
color: white
fontSize: 8
show: (params.n == 1)
position: br
- Label:
coordinates: [((calcs.Di+calcs.Qn)/2),((calcs.Pn+params.c)/2)]
text: calcs.DWL.toFixed(2)
bgcolor: grey
color: white
fontSize: 10
show: (params.n >1)
position: bl
- Segment:
a: [0,calcs.Pn]
b: [calcs.Qn,calcs.Pn]
color: orange
strokeWidth: 3.5
- Segment:
a: [0,calcs.Pn]
b: [0,calcs.Pn]
color: black
bgcolor: "'#FFCC90'"
label:
text: calcs.Pn.toFixed(1)
position: r
fontSize: 10
- Segment:
a: [0.4,params.c]
b: [0.4,calcs.Pn]
color: blue
bgcolor: none
endArrow: true
label:
text: MarkUp
position: r
fontSize: 10
- Segment:
a: [calcs.Qn, calcs.Pn]
b: [calcs.Qn,0]
color: green
lineStyle: dashed
- Segment:
a: [calcs.Di, params.c]
b: [calcs.Di, 0]
color: green
lineStyle: dashed
- Segment:
a: [calcs.Di, 0]
b: [calcs.Di, 0]
color: black
bgcolor: "'#FFCC90'"
label:
text: calcs.Di.toFixed(0)
position: t
- Segment:
a: [calcs.Qn, 0]
b: [calcs.Qn, 0]
color: black
bgcolor: green
show: (params.n >1)
label:
text: calcs.Qn.toFixed(1)
position: t
- Segment:
a: [calcs.Qm, params.c]
b: [calcs.Qm, 0]
color: green
lineStyle: dashed
- Segment:
a: [calcs.Qm, 0]
b: [calcs.Qm, 0]
color: black
bgcolor: "'#FFCC90'"
label:
text: calcs.Qm.toFixed(1)
position: t
- Segment:
a: [25, 0]
b: [25, 0]
color: black
bgcolor: white
label:
text: Q_{n}
position: t
fontSize: 10
- Segment:
a: [0, 25]
b: [0, 25]
color: black
bgcolor: white
label:
text: P
position: r
fontSize: 10
- Segment:
a: [25, params.c]
b: [25, params.c]
color: white
bgcolor: "'#d62728'"
label:
text: CMg
position: l
fontSize: 10
- Segment:
a: [calcs.Di2-15, 15]
b: [calcs.Di2-15, 15]
bgcolor: "'#1f77b4'"
label:
text: P(Q)
color: white
position: bl
fontSize: 10
- Segment:
a: [calcs.Qm-5, 15]
b: [calcs.Qm-5, 15]
bgcolor: "'#1f77b4'"
label:
text: RMg_{m}
color: white
position: br
fontSize: 10
- Segment:
a: [calcs.Qn, 0]
b: [calcs.Qn, 0]
bgcolor: green
show: (params.n>1)
label:
text: RMg_{n}
color: white
position: bl
fontSize: 8
- Point:
coordinates: [calcs.Qn, calcs.Pn ]
color:
- Point:
coordinates: [calcs.Qn, params.c ]
color:
- Point:
coordinates: [calcs.Qm, params.c ]
color:
- Point:
coordinates: [calcs.Di, params.c ]
color:
bottomGraph:
xAxis:
min: 0
max: 120
ticks: 4
yAxis:
min: 0
max: 20
ticks: 4
objects:
#Produção por firma para o equilíbrio de cournot
- Curve:
fn: "(((x)*(20+params.e-params.c))/(1+(x)))"
ind: x
min: 0
max: 100
color: blue
strokeWidth: 3.5
samplePoints: 300
- Segment:
a: [0, calcs.Qn]
b: [params.n, calcs.Qn]
color: green
lineStyle: dashed
- Segment:
a: [params.n, 0]
b: [params.n, calcs.Qn]
color: green
lineStyle: dashed
- Segment:
a: [params.n, 0]
b: [params.n, 0]
color: black
bgcolor: green
label:
text: params.n
position: t
- Segment:
a: [0, calcs.Qn]
b: [0, calcs.Qn]
color: black
bgcolor: green
label:
text: calcs.Qn.toFixed(2)
position: r
- Segment:
a: [110, 0]
b: [110, 0]
color: black
bgcolor: white
label:
text: Firmas\ (n)
position: tl
fontSize: 9
- Segment:
a: [0, 20]
b: [0, 20]
color: black
bgcolor: white
label:
text: Q_{n}
position: r
fontSize: 10
- Point:
coordinates: [params.n, calcs.Qn]
color:
sidebar:
controls:
- title: Modelo de Cournot com "n" firmas — Parceria com Eduardo Fabres (UFRGS)
sliders:
- param: n
label: firmas
digits: 2
- param: c
label: CMg
digits: 2
- param: e
label: \\e
digits: 2