---
aspectRatio: 2.3
params:
- name: p1
value: 1
min: 1
max: 3
round: 0.01
- name: a
value: 0.5
min: -1
max: 10
precision: 0.001
round: 0.01
- name: p2
value: 1
min: 1
max: 3
round: 0.01
- name: m
value: 8
min: 1
max: 15
round: 0.1
calcs:
RO: (params.m)/(params.p1)
RO2: (params.m)/(params.p2)
pr: (params.p2/params.p1)
Dm1CES: (((params.m)*(params.p1^(1/(params.a-1)))/(params.p1^(params.a/(params.a-1))+params.p2^(params.a/(params.a-1)))))
Dm2CES: (((params.m)*(params.p2^(1/(params.a-1)))/(params.p1^(params.a/(params.a-1))+params.p2^(params.a/(params.a-1)))))
UCES: (((calcs.Dm1CES^(params.a)+calcs.Dm2CES^(params.a)))^(1/params.a))
s: (1/(1-params.a))
layout:
MathboxPlusGraphPlusSidebar:
graph:
xAxis:
max: 15
ticks: 3
yAxis:
max: 15
ticks: 3
objects:
#Curva de Indiferença
- Curve:
fn: "(((calcs.UCES^params.a)-((x)^params.a))^(1/params.a))"
ind: x
color: red
min: 0
max: 100
lineStyle: solid
strokeWidth: 4
samplePoints: 300
show: (params.a >= 0.1)
- Curve:
fn: "(((calcs.UCES^params.a)-((y)^params.a))^(1/params.a))"
ind: y
color: red
min: 0
max: 100
lineStyle: solid
strokeWidth: 4
samplePoints: 300
show: (params.a < 0.1)
#Restrição Orçamentaria
- Curve:
fn: "(-((x)*(params.p2)/(params.p1))+(params.m)/(params.p1))"
ind: x
color: blue
strokeWidth: 4
#Canva
- Point:
coordinates: [calcs.Dm2CES, calcs.Dm1CES]
color: green
r: 6
- Segment:
a: [calcs.Dm2CES, calcs.Dm1CES+1.5]
b: [calcs.Dm2CES, calcs.Dm1CES+1.5]
color: black
bgcolor: "'#FFCC90'"
label:
text: "`TMS=|-\\\\frac{p_{2}}{p_{1}}| =${calcs.pr.toFixed(2)}`"
position: l
fontSize: 10
- Segment:
a: [0, calcs.RO]
b: [0, calcs.RO]
color: black
bgcolor: "'#FFCC90'"
label:
text: \frac{m}{p_{1}}
position: r
fontSize: 15
- Segment:
a: [calcs.RO2, 0]
b: [calcs.RO2, 0]
color: black
bgcolor: "'#FFCC90'"
label:
text: \frac{m}{p_{2}}
position: t
fontSize: 15
- Segment:
a: [calcs.Dm2CES, 0]
b: [calcs.Dm2CES, calcs.Dm1CES]
color: green
lineStyle: dashed
- Segment:
a: [calcs.Dm2CES, calcs.Dm1CES]
b: [0, calcs.Dm1CES]
color: green
lineStyle: dashed
- Segment:
a: [0, calcs.Dm1CES]
b: [0, calcs.Dm1CES]
color: black
bgcolor: "'#36a854'"
label:
text: calcs.Dm1CES.toFixed(0)
position: r
fontSize: 15
- Segment:
a: [calcs.Dm2CES, 0]
b: [calcs.Dm2CES, 0]
color: black
bgcolor: "'#36a854'"
label:
text: calcs.Dm2CES.toFixed(0)
position: t
fontSize: 15
- Segment:
a: [0, 15]
b: [0, 15]
color: black
bgcolor: white
label:
text: x_{1}
position: r
- Segment:
a: [15, 0]
b: [15, 0]
color: black
bgcolor: white
label:
text: x_{2}
position: t
- Label:
coordinates: [15,13]
text: "`Elasticidade \\\\ Substituição \\\\ (s): \\\\\\\\ s= \\\\frac{1}{1- \\\\rho} =\\\\frac{1}{1- ${params.a.toFixed(1)}} \\\\\\\\ s=${calcs.s.toFixed(2)}`"
bgcolor: "'#1f77b4'"
color: white
fontSize: 8
position: tr
mathbox:
xAxis:
min: 0
max: 15
step: 2
yAxis:
min: 0
max: 15
step: 2
zAxis:
min: 0
max: calcs.UCES+10
ticks: 0
objects:
- MathboxFunctionSurface:
fn:
fn: ((((x)^(params.a)+(y)^(params.a)))^(1/params.a))
samplePoints: 20
shaded: false
fill: red
opacity: 0.1
- MathboxCurve:
fn:
fn: (calcs.RO - calcs.pr*(x))
fnZ: calcs.UCES
fnX: 5
samplePoints: 500
strokeWidth: 10
stroke: blue
- MathboxCurve:
fn:
fn: (((calcs.UCES^params.a)-((x)^params.a))^(1/params.a))
fnZ: calcs.UCES
samplePoints: 500
strokeWidth: 10
stroke: colors.red
# Optimal Point
- MathboxPoint:
x: calcs.Dm2CES
y: calcs.Dm1CES
z: calcs.UCES
stroke: "'#36a854'"
- MathboxLabel:
x: 0
y: 16
z: 1
stroke: black
text: "x1"
- MathboxLabel:
x: 0
y: calcs.Dm1CES
z: 1
stroke: black
text: calcs.Dm1CES.toFixed(2)
- MathboxLabel:
x: calcs.Dm2CES
y: 0
z: 1
stroke: black
text: calcs.Dm2CES.toFixed(2)
- MathboxLabel:
x: -1.5
y: -1.5
z: calcs.UCES+3
stroke: black
text: calcs.UCES.toFixed(2)
- MathboxLabel:
x: 16
y: 0
z: 1
stroke: black
text: "x2"
- MathboxLabel:
x: 0
y: 0
z: calcs.UCES+10
stroke: black
text: "Utilidade"
# Vertical dropline
- MathboxLine:
x1: calcs.Dm2CES
y1: calcs.Dm1CES
x2: calcs.Dm2CES
y2: calcs.Dm1CES
z2: calcs.UCES
stroke: "'#36a854'"
strokeWidth: 10
lineStyle: dashed
# Vertical dropline
- MathboxLine:
z1: calcs.UCES
x1: calcs.Dm2CES
y1: calcs.Dm1CES
z2: calcs.UCES
stroke: "'#36a854'"
strokeWidth: 10
lineStyle: dashed
# Dropline to x axis
- MathboxLine:
x1: calcs.Dm2CES
y1: calcs.Dm1CES
x2: calcs.Dm2CES
stroke: "'#36a854'"
strokeWidth: 10
lineStyle: dashed
# Dropline to y axis
- MathboxLine:
x1: calcs.Dm2CES
y1: calcs.Dm1CES
y2: calcs.Dm1CES
stroke: "'#36a854'"
strokeWidth: 10
lineStyle: dashed
sidebar:
controls:
- title: Decisão Ótima de Consumo Função CES
sliders:
- param: a
label: \rho
digits: 4
- param: p1
label: p_1
digits: 4
- param: p2
label: p_2
digits: 4
- param: m
label: m
digits: 4
divs:
- html: 'A forma funcional da função de Utilidade CES é: $${U(X_{1},X_{2}) = (X_{1}^\rho + X_{2}^\rho)^\frac{1}{\rho}}$$'
- html: 'A função de demanda inversa marshalliana para ${X_{1}}$: $${P(X_{1}) = \frac{X_{1}^{\rho-1}m}{X_{1}^{\rho}+X_{2}^{\rho}}}$$'
- html: 'A função de demanda inversa marshalliana para ${X_{2}}$: $${P(X_{2}) = \frac{X_{2}^{\rho-1}m}{X_{1}^{\rho}+X_{2}^{\rho}}}$$'