---
aspectRatio: 2.3
params:
- name: p1
value: 1
min: 1
max: 3
round: 0.01
- name: a
value: 0.5
min: 0.01
max: 1
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:
Dm2: ((1-params.a)*((params.m)/(params.p2)))
Dm1: ((params.a)*((params.m)/(params.p1)))
U1: (((calcs.Dm1)^(params.a))*((calcs.Dm2)^(1-params.a)))
RO: (params.m)/(params.p1)
RO2: (params.m)/(params.p2)
pr: (params.p2/params.p1)
layout:
MathboxPlusGraphPlusSidebar:
graph:
xAxis:
max: 15
ticks: 3
yAxis:
max: 15
ticks: 3
objects:
#Curva de Indiferença
- Curve:
fn: "(((calcs.U1)/(x^(1-params.a)))^(1/params.a))"
ind: x
color: red
min: 0
max: 300
lineStyle: solid
strokeWidth: 4
samplePoints: 300
- Curve:
fn: "(((calcs.U1)/((y)^(params.a)))^(1/(1-params.a)))"
ind: y
color: red
min: 0
max: 20
lineStyle: solid
strokeWidth: 4
samplePoints: 3000
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.Dm2, calcs.Dm1]
color: green
r: 6
- Segment:
a: [calcs.Dm2, calcs.Dm1+1.5]
b: [calcs.Dm2, calcs.Dm1+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.Dm2, 0]
b: [calcs.Dm2, calcs.Dm1]
color: green
lineStyle: dashed
- Segment:
a: [calcs.Dm2, calcs.Dm1]
b: [0, calcs.Dm1]
color: green
lineStyle: dashed
- Segment:
a: [0, calcs.Dm1]
b: [0, calcs.Dm1]
color: black
bgcolor: "'#36a854'"
label:
text: calcs.Dm1.toFixed(0)
position: r
fontSize: 15
- Segment:
a: [calcs.Dm2, 0]
b: [calcs.Dm2, 0]
color: black
bgcolor: "'#36a854'"
label:
text: calcs.Dm2.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
mathbox:
xAxis:
min: 0
max: 15
step: 2
yAxis:
min: 0
max: 15
step: 2
zAxis:
min: 0
max: 10
step: 2
objects:
- MathboxFunctionSurface:
fn:
fn: ((x)^(1-params.a))*((y)^(params.a))
samplePoints: 20
shaded: false
fill: red
opacity: 0.1
- MathboxCurve:
fn:
fn: (calcs.RO - calcs.pr*(x))
fnZ: calcs.U1
fnX: 5
samplePoints: 500
strokeWidth: 10
stroke: blue
- MathboxCurve:
fn:
fn: (((calcs.U1)/((x)^(1-params.a)))^(1/params.a))
fnZ: calcs.U1
samplePoints: 500
strokeWidth: 10
stroke: colors.red
# Optimal Point
- MathboxPoint:
x: calcs.Dm2
y: calcs.Dm1
z: calcs.U1
stroke: "'#36a854'"
- MathboxLabel:
x: 0
y: 16
z: 1
stroke: black
text: "x1"
- MathboxLabel:
x: 0
y: calcs.Dm1
z: 0
stroke: black
text: calcs.Dm1.toFixed(2)
- MathboxLabel:
x: calcs.Dm2
y: 0
z: 0
stroke: black
text: calcs.Dm2.toFixed(2)
- MathboxLabel:
x: -1
y: -1
z: calcs.U1+0.5
stroke: black
text: calcs.U1.toFixed(2)
- MathboxLabel:
x: 16
y: 0
z: 1
stroke: black
text: "x2"
- MathboxLabel:
x: 0
y: 0
z: 11
stroke: black
text: "Utilidade"
# Vertical dropline
- MathboxLine:
x1: calcs.Dm2
y1: calcs.Dm1
x2: calcs.Dm2
y2: calcs.Dm1
z2: calcs.U1
stroke: "'#36a854'"
strokeWidth: 10
lineStyle: dashed
# Vertical dropline
- MathboxLine:
z1: calcs.U1
x1: calcs.Dm2
y1: calcs.Dm1
z2: calcs.U1
stroke: "'#36a854'"
strokeWidth: 10
lineStyle: dashed
# Dropline to x axis
- MathboxLine:
x1: calcs.Dm2
y1: calcs.Dm1
x2: calcs.Dm2
stroke: "'#36a854'"
strokeWidth: 10
lineStyle: dashed
# Dropline to y axis
- MathboxLine:
x1: calcs.Dm2
y1: calcs.Dm1
y2: calcs.Dm1
stroke: "'#36a854'"
strokeWidth: 10
lineStyle: dashed
sidebar:
controls:
- title: Decisão Ótima de Consumo
sliders:
- param: a
label: \alpha
digits: 4
- param: p1
label: p_1
digits: 4
- param: p2
label: p_2
digits: 4
- param: m
label: m
digits: 4