This notebook series is designed to introduce selected dynamic economic models to both advanced undergraduate and graduate students. Economists have relied on a series of economic models to better understand the otherwise highly complex causal relationship among many economic variables. Dynamic economic models set up by systems of either difference or differential equations are particularly useful in tracing the change in the quantity of unknown economic variables (e.g., the capital stock, demand for labor, aggregate output, etc.) and their interactions over time.
This notebook series aims to help students better understand the depth, usefulness, and limitations of major existing micro and macroeconomic models by demonstrating how we can use Wolfram Mathematica to replicate and reconstruct the core ideas and find dynamic solution of the model.
The model introduced in this notebook series include, among others, (1) the cobweb model of the quantity and price adjustment, (2) Keynes’s aggregate demand model, (3) Hicks’s ISLM model, (4) Samuelson’s investment accelerator model, (5) Kalecki’s investment delay model, (6) the predator-prey interaction model, (7) the epidemic model, (8) Ricardo’s three dimensional business cycle model, (9) Marx-Goodwin business cycle and growth model, (10) Smith’s and Ricardo’s growth model, (11) the Harrod-Domar growth model, (12) the Solow growth model, (13) the RBC model, (14) Romer’s new growth model, and (15) the circuit of capital model.

The ISLM Model

Introduction

John Hicks’s ISLM model is an important (and yet controversial) extension of Keynes’s AD model. Hicks introduces a simple money market model (consisting of both money demand and money supply equations) following the core assumption of the classical loanable funds model and then combines it with Keynes’s AD equations. The classical loanable funds model is a simple application of supply and demand analysis to the quantity of savings supplied and demanded whose interaction spelling out unique equilibrium interest rates and the quantity of savings. The ‘IS’ (Investment-Savings) in the ISLM model represents the product market equilibrium, whereas ‘LM’(Liquidity-Money) is the equilibrium condition in the market for money, both of which are a function of aggregate output-income and the rate of interest.
The key variable that connects the IS and LM is the effect of the change in the rate of interest on both private business investment spending and the demand for money. Private business investment is no longer a fixed quantity as treated in AD models. Instead, it is a negative function of the rising interest rate. The higher the rate of interest, the lower the volume of private business investment spending at a given point in time. The same is true for the quantity of money demanded. The higher interest rate induces economic agents to hold the less amount of money compared to other interest-bearing financial assets. This interest rate sensitivity of private business investment and money demand gives rise to an interesting system of two linear equations that allow us to determine both equilibrium output-income and equilibrium interest rate.
In this note, we present the ISLM model using both simple linear algebra and difference/differential equation tools, in order.

Linear Models

The baseline ISLM

Let Y denote aggregate output-income, HHC household consumption spending, PBI private business investment spending, and R the rate of interest. In this model, we assume that PBI is positively affected by the increasing aggregate output-income and negatively by the rising interest rate. The higher interest rate decreases private business investment spending. Conversely, the lower interest rate stimulates private business investment spending assuming that all other factors and variables remain the same as before. In this formulation, therefore, economic agents’ various motives for holding liquidity, entrepreneurs’ subjective estimates of the future profitability (called marginal efficiency of capital in Keynes), and other institutional complexities that affect the business investment spending decisions are ignored.
If we define HHC = a + bY (where a is the autonomous consumption and b is the marginal propensity to consume), and PBI = PBI0 + cY- dR, then aggregate demand becomes AD = HHC + PBI = a + b Y + PBI0 + cY - dR.
AD=HHC+PBI=a+bY+PBI0+cY-dR
(
1
)
Here,
PBI0
is a certain fixed investment spending that is not affected by the change in the rate of interest, whereas dR (c>0) is changing investment spending that is negatively affected by the rate of interest. The parameter d captures the interest rate sensitivity of investment spending that shows how strongly the change in the rate of interest affects the investment spending decision.
The equilibrium condition states AD = Y, which implies:
Y=a+bY+PBI0+cY-dR.
(
2
)
Now let us introduce a simplified financial market in which the change in the rate of interest is explained. Let MD denote the quantity of money (i.e., savings) demanded with MD = kY - hR (k, h > 0) and MS the quantity of money supplied, MS = M whose quantity is fixed and it is assumed to be determined by the economy’s monetary authority (i.e., central bank). Money demand is a positive function of aggregate output-income, but it is assumed to fall as the rate of interest increases. It is presumed that economic agents tend to hold less amount of money if the rate of interest rate goes up. Money supply is an exogenous variable, which is fixed by the monetary authority.
The equilibrium condition in this money market implies that MS = MD, which is:
kY-hR=M
(
3
)
After combining these two equations, (2) and (3) together, we can find the equilibrium value of aggregate output-income ( Y*) and the rate of interest (R*) that solve the system of two linear equations.
In[]:=
Clear[Y,HHC,PBI,a,b,c,d,R,h,k,M];​​Solve[{Y==a+bY+PBI0+cY-dR,kY-hR==M},{Y,R}]
Out[]=
Y-
ah+dM+hPBI0
-h+bh+ch-dk
,R-
ak-M+bM+cM+kPBI0
-h+bh+ch-dk

Suppose we have some numerical values for each variable and parameter. Let HHC = 50 + 0.8Y, PBI = 20 + 0.1Y - 5R, MD = - R + 0.5Y and MS = M = 100. The equilibrium condition in both IS and LM relation gives us:
AD=Y=HHC+PBI=50+0.8Y+20+0.1Y-5R​​MD=MS=M=-R+0.5Y=100
(
4
)
The solution to this system of two linear equation is:
In[]:=
Solve[{Y==50+0.8Y+20+0.1Y-5R,-R+0.5Y==100},{Y,R}]​​Plot3D[{50+0.8Y+20+0.1Y-5R==Y,-R+0.5Y==100},{Y,100,500},{R,3,8},AxesLabel->{"Y","R"}]
Out[]=
{{Y219.231,R9.61538}}
Out[]=

The ISLM with the government sector (with the marginal tax rate regime)

Let us now introduce the government sector in the IS relation. Let AD = HHC + PBI + G where HHC = 15 + 0.8 (Y - T + TR), T = 0.25Y, TR = 25, PBI = 65 +0.1Y- R, and G = 50; MS = 1500 and MD = 5Y - 50R.
The equilibrium condition for both product and money market is AD = Y and MS = MD, respectively. That is,
In[]:=
Solve[Y==15+0.8(Y-0.25Y+25)+65+0.1Y-R+50,Y]//Simplify​​Solve[1500==5Y-50R,Y]//Simplify
Out[]=
{{Y500.-3.33333R}}
Out[]=
{{Y10(30+R)}}
The solution to this system of two linear equations can be found by:
In[]:=
Solve[{Y==500.0000000000001`-3.333333333333334`R,Y==10(30+R)},{Y,R}]
Out[]=
{{Y450.,R15.}}
Alternatively, we can transform this system into a dot product of a 22 coefficient matrix with a column vector of two unknown variables, Y and R. That is, AX = b where
In[]:=
Clear[A,X,b,Y,R];​​A=
1
3.33333
1
-10
;X=
Y
R
;b=
500
300
;
The equilibrium value of Y and R can be also found by the following three matrix algebra techniques:

(1) Using inverse of A

In[]:=
?Inverse
Out[]=
Symbol
Inverse[m] gives the inverse of a square matrix m.
In[]:=
X==Inverse[A].b
Out[]=
{{Y},{R}}{{450.},{15.}}

(2) Using Cramer’s rule

In[]:=
?Det
Out[]=
Symbol
Det[m] gives the determinant of the square matrix m.
In[]:=
Clear[A1,A2];​​A1=
500
3.33333
300
-10
;A2=
1
500
1
300
;​​X=={{Det[A1]/Det[A]},{Det[A2]/Det[A]}}
Out[]=
{{Y},{R}}{{450.},{15.}}

(3) Using LinearSolve

In[]:=
?LinearSolve
Out[]=
Symbol
LinearSolve[m,b] finds an x that solves the matrix equation m.x==b. ​LinearSolve[m] generates a LinearSolveFunction[…] that can be applied repeatedly to different b. ​LinearSolve[a,b] finds an x that solves the array equation a.x==b.
In[]:=
Clear[Y,R];​​LinearSolve[A,b]
Out[]=
{{450.},{15.}}

The ISLM-BP extension

Two great American economists Robert Mundell and Marcus Fleming extended the original ISLM model in the early 1960s to account for the effect of the change exchange rate on domestic aggregate output-income and domestic interest rate. Their model is known as the ISLM-BP model.
Ignoring the detailed aspect of the model derivation, suppose that an open economy consists of the following three linear equations where Y is aggregate output-income, R rate of interest, and E exchange rate:
R=240-4Y+E
R=-50+Y
R=105+0.5Y-2E
This system of three linear equations can be represented by the following dot product of coefficient matrix and the unknown column vector:
Clear[A,X,E,b];​​A=
4
1
-1
-1
1
0
-0.5
1
2
;X=
Y
R
E
;b=
240
-50
105
;
The solution to this matrix system can be found by the following inverse matrix method:
In[]:=
Inverse[A].b
Out[]=
{{70.},{20.},{60.}}
In[]:=
LinearSolve[A,b]
Out[]=
{{70.},{20.},{60.}}
We can rewrite these three equations into a matrix array form and find the solution by using the RowReduce function, a built-in function that conducts a successive row elimination method:
In[]:=
?RowReduce
Out[]=
Symbol
RowReduce[m] gives the row-reduced form of the matrix m.
In[]:=
Clear[A];​​A=
4
1
-1
240
-1
1
0
-50
-0.5
1
2
105
;​​RowReduce[A]//MatrixForm
Out[]//MatrixForm=
1
0.
0.
70.
0
1
0.
20.
0
0
1
60.

A Difference Equation Model

The general formulation

Let us go back to the previous baseline model where there is no government sector. We can represent the ISLM model using the following system of difference equations:
The analytical solution is:

A numerical example

Suppose now that we have a series of numerical values to parameters and initial values. The numerical solution will be:

A Differential Equation Model

The general formulation

The same model can be formulated by a continuous model as follows:
This is a system of two linear first-order homogenous differential equations, whose symbolic solutions can be found by:

A numerical example

If we assign some arbitrary numerical values to parameters and initial values, then the solution curve will be:

Conclusion

The ISLM model was an immediate extension of the AD model that combines a simple money supply and money demand equation with the product market equilibrium. Given money supply, both money demand and private business investment spending are treated as a function of both aggregate output-income and the rate of interest. Therefore, we can easily determine equilibrium value of aggregate output-income and the rate of interest that solves the system.
In this formulation, however, Hicks assumes a very high interest rate sensitivity of private investment spending and money demand, both of which are not empirically valid. The ISLM model also ignores various financial market variables that are crucial to understanding of how owners of business enterprises make their current investment decisions.
Keynes emphasized the significance of highly subjective and volatile prospective yields from investment spending formed by entrepreneurs. Depending on their expectation about the future profitability associated with their current investment spending, the actual volume of private business investment spending can drastically change. The existing method of mobilizing financial capital stocks for financing corporate investment is also subject to the vagary of financial market activity and speculations in the stock market and banking system, which negatively affect the otherwise stable private business investment spending. And precisely because of this overreacting private business investment spending, Keynes designed his AD models and argued for the government sector’s counter-cyclical expansionary fiscal and monetary policies. For this reason, whether Hick’s suggested ISLM interpretation of Keynes’s AD model is a legitimate representation of Keynes’s more complex and institutionalist approach to the private business investment remain a contested issue.
In this note, we presented the core aspect of the ISLM model and extended it into both difference and differential equation model setting. For the purpose of developing this dynamic model further, we can also introduce additional variables that capture the accumulation of both the capital stock and the government debt.

Reference

◼
  • John Hicks, “Mr. Keynes and the “Classics” - A Suggested Interpretation,” Econometrica, Vol. 5, No. 2 (April 1937), pp.147-159.
  • ◼
  • “IS-LM: An Explanation,” Journal of Post Keynesian Economics, Vol. 3, No. 2 (1980-1981), pp.139-154.
  • ◼
  • John M. Keynes, The General Theory of Employment, Money and Interest. New York: Prometheus Books, 1997 [1936].
  • ◼
  • Ronald Shone, An Introduction to Economic Dynamics, Cambridge University Press: 2001, pp.91-109.
  • ◼
  • Ronald Shone, Economic Dynamics, Cambridge University Press: 1997, pp.265-308.
  • ◼
  • Srinivas Raghavendra and Petri T. Piiroinen, An Introduction to Economic Dynamics - Modelling, Analysis and Simulation, Routledge: 2023, pp.61-78.
  • CITE THIS NOTEBOOK

    Introduction to dynamic economic models: The ISLM model​
    by Hee-Young Shin​
    Wolfram Community, STAFF PICKS, December 11, 2025
    ​https://community.wolfram.com/groups/-/m/t/3588994