I am trying to build an IS/LM model with sliders for a few things including the slope of the IS curve. I am stuck getting the equilibrium ticks and dashed lines to properly follow the intersection of the two lines when the slope is changed. I have tried incorporating my variable i
in as many ways as I can think of into the ticks and dashed lines, but continually come up short. I am a newbie at Mathematica and the code is confusing the hell out of me and making the basic math more confusing for me. Help!
Manipulate[
Show[
Plot[Tooltip[s + .8 *q, "LM"], {q, 0, 150},
AxesOrigin -> {0, 0}, PlotStyle -> {Thick, Blue},
AxesLabel -> {"GDP", "Interest Rate"},
PlotRange -> {{0, 100}, {0, 100}}, PlotLabel -> IS LM,
Ticks -> {{{0.77*d - (0.77*s), "GDP"}}, {{d - i*(0.77*d - (0.77*s)), "r"}}},
BaseStyle -> {FontWeight -> "Bold", FontSize -> 12}],
Plot[Tooltip[d - i*q, "IS"], {q, 0, 200},
AxesOrigin -> {0, 0}, PlotStyle -> {Thick, Green}],
Graphics[{Dashed,
Line[{{0.77*d - (0.77*s), 0},
{0.77*d - (0.77*s), d - i (0.77*d - 0.5 (0.77*s))}}]}],
Graphics[{Dashed,
Line[{{0, d - i (0.77*d - (0.77*s))},
{0.77*d - (0.77*s), d - i (0.77*d - (0.77*s))}}]}]],
{{d, 75, "Fiscal Policy"}, 50, 100, 2},
{{s, 0, "Monetary Policy"}, 0, 100, 2},
{{i, .5, "Interest Sensitivity"}, 0, 5, .1}]
Plot
), the ubiquitous 0.77, and the 0.5 should be i (in firstDashed
Line
. If you fix those instances with the appropriate formulas, my guess is that most of your worries will be fixed. $\endgroup$Dashed Line
should be{0.77*d - (0.77*s), d - i (0.77*d - (0.77*s))}
$\endgroup$