Skip to content

Commit

Permalink
unl +test ks graph
Browse files Browse the repository at this point in the history
  • Loading branch information
RMWinslow committed Feb 4, 2024
1 parent e043abd commit 662c335
Show file tree
Hide file tree
Showing 2 changed files with 166 additions and 0 deletions.
152 changes: 152 additions & 0 deletions unl/ks_twoPeriodEquilibrium.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
schema: EconSchema
params:
- {name: demandShift, value: 0, min: -5, max: 5, round: 0.1}
- {name: demandShiftY, value: 0, min: -5, max: 5, round: 0.1}
- {name: demandShiftN, value: 0, min: -5, max: 5, round: 0.1}
- {name: supplyShift, value: 0, min: -5, max: 5, round: 0.1}
- {name: supplyShiftY, value: 0, min: -5, max: 5, round: 0.1}
- {name: supplyShiftN, value: 0, min: -5, max: 5, round: 0.1}
calcs:
demandChanged: ((params.demandShift-0)^2 > 0.04)
supplyChanged: ((params.supplyShift-0)^2 > 0.04)
demandChangedY: ((params.demandShiftY-0)^2 > 0.04)
supplyChangedY: ((params.supplyShiftY-0)^2 > 0.04)
demandChangedN: ((params.demandShiftN-0)^2 > 0.04)
supplyChangedN: ((params.supplyShiftN-0)^2 > 0.04)
layout:
TwoHorizontalGraphs:
leftGraph:
xAxis: {title: Labor}
yAxis: {title: Real Wage}
objects:
- EconLinearEquilibrium:
demand:
name: oldDemandN
xIntercept: 10
invSlope: -1
lineStyle: dotted
pts:
- name: a
y: 4
supply:
name: oldSupplyN
yIntercept: 2
slope: 1
lineStyle: dotted
pts:
- name: a
y: 8
equilibrium:
droplines:
vertical: N_0
horizontal: w_0
- EconLinearEquilibrium:
name: newEquilibriumN
demand:
name: newDemandN
xIntercept: 10 + params.demandShiftN
invSlope: -1
pts:
- name: a
y: 4
drag:
- horizontal: demandShiftN
supply:
name: newSupplyN
yIntercept: 2 - params.supplyShiftN
slope: 1
pts:
- name: a
y: 8
drag:
- horizontal: supplyShiftN
equilibrium:
show: (calcs.demandChangedN || calcs.supplyChangedN)
droplines:
vertical: N_1
horizontal: w_1

- Arrow:
begin: [calcs.oldDemandN.a.x,4]
end: [calcs.newDemandN.a.x,4]
show: calcs.demandChangedN
color: demand
trim: 0.1

- Arrow:
begin: [calcs.oldSupplyN.a.x,8]
end: [calcs.newSupplyN.a.x,8]
show: calcs.supplyChangedN
color: supply
trim: 0.1







rightGraph:
xAxis: {title: Output}
yAxis: {title: Real Interest Rate}
objects:
- EconLinearEquilibrium:
demand:
name: oldDemandY
xIntercept: 10
invSlope: -1
lineStyle: dotted
pts:
- name: a
y: 4
supply:
name: oldSupplyY
yIntercept: 2
slope: 1
lineStyle: dotted
pts:
- name: a
y: 8
equilibrium:
droplines:
vertical: Y_0
horizontal: r_0
- EconLinearEquilibrium:
name: newEquilibriumY
demand:
name: newDemandY
xIntercept: 10 + params.demandShiftY
invSlope: -1
pts:
- name: a
y: 4
drag:
- horizontal: demandShiftY
supply:
name: newSupplyY
yIntercept: 2 - params.supplyShiftY
slope: 1
pts:
- name: a
y: 8
drag:
- horizontal: supplyShiftY
equilibrium:
show: (calcs.demandChangedY || calcs.supplyChangedY)
droplines:
vertical: Y_1
horizontal: r_1

- Arrow:
begin: [calcs.oldDemandY.a.x,4]
end: [calcs.newDemandY.a.x,4]
show: calcs.demandChangedY
color: demand
trim: 0.1

- Arrow:
begin: [calcs.oldSupplyY.a.x,8]
end: [calcs.newSupplyY.a.x,8]
show: calcs.supplyChangedY
color: supply
trim: 0.1
14 changes: 14 additions & 0 deletions unl/supplyanddemand.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,17 @@ oranges

---





<link href="https://kineticgraphs.org/css/kg.0.2.6.css" rel="stylesheet" type="text/css">
<script src="https://kineticgraphs.org/js/kg3d.0.2.6.js"></script>



<div class="kg-container" src="ks_twoPeriodEquilibrium.yml" clearColor='#fff0'></div>



---

0 comments on commit 662c335

Please sign in to comment.