Monday, March 23, 2015

Supply and demand as entropy

Continuing in a series with the previous posts, here I'd like to show the forces of supply and demand as entropy. At the moment of the shock, we either add or remove points from the supply or demand. This produces shifts in the supply and demand curves (shocks), and the system returns to equilibrium. I used the differential equation:

P = \frac{dD}{dS} = k \; \frac{D}{S}

to determine the price. The model for partial equilibrium (i.e. supply and demand curves) is here for reference. Here are the four cases ... (demand is in blue on the left, supply in red on the right)

Increase in demand, leading to an increase in price:

Increase in supply, leading to a fall in price:

Fall in demand, leading to a fall in price:

Fall in supply, leading to an increase in price:


  1. 1) What do the dots represent?

    2) So the partial equilibrium is the fixed source or demand equation (what's given at that link), not the floating source & demand general equilibrium?

    3) The partial equilibrium solutions at that link show a permanent change in price of the demand curve is shifted or if the supply curve is shifted (for constant k). The price plots above show a temporary change in price. Why the difference?

    4) The vertical black line separating the D side of the rectangle from the S side of the rectangle apparently doesn't restrict the "flow" of the dots, true?

    5) Once a supply or demand shock takes place, then the total number of dots is permanently changed, true?

    6) The price curve in all cases almost appears to be a scaled version of the blue curve minus the red curve. Just an observation! (again, which I don't see evidence of at that partial equilibrium link)

    1. 1) Supply and demand widgets.
      2) A better explanation is that partial equilibrium keeps one of supply or demand roughly constant (adjusting slowly) and changes the other more rapidly.
      3) I turn on and off a shock, so the price returns to equilibrium. If there is suddenly a supply shock of oil, in partial equilibrium the price falls, but in the longer run in general equilibrium production slows and eventually return to the previous price equilibrium (in theory, ceteris paribus).
      4) There is a finite transition probability per unit time from a dot on one side to the other, but in each box, the dots are actually just random.
      5) Yes.
      6) given
      log D ~ k log S
      log P ~ (k - 1) log S

      That's roughly true.

    2. "2) A better explanation is that partial equilibrium keeps one of supply or demand roughly constant (adjusting slowly) and changes the other more rapidly."

      That seems to be a difference with the ideal gas law analogy. Lining up the "partial equilibrium" case with the "fixed source" gas law:

      D is analogous to W
      S is analogous to V
      Price is analogous to Pressure

      Yet the gas law "partial equilibrium" solution describes an isothermal process, and since the number of molecules in the box doesn't change (in F&B's paper), the energy of the gas inside the box is proportional to the constant temperature of the gas inside the box. And this energy/temperature of the gas in the box really is constant, not just slowly varying. All the work done compressing the gas to a higher pressure by shrinking the volume (say by increasing the force applied to a piston wall of the box) is absorbed by the infinite bath external to the box through heat conduction. The pressure remains permanently elevated and the volume permanently reduced as long as the force on that piston wall remains elevated. Likewise, if the force is subsequently reduced to its original level on the piston wall of the box, the volume expands back to its original shape, the pressure reduces to its original level, but the energy of the gas in the box again remains constant the whole time. However, the "partial" (fixed source) equation tell us delta W, which in this case is the work done by the infinite bath (returned to the external mechanism putting force on the piston) in restoring the box's volume and pressure. Delta W describes the energy absorbed by the bath the other way (when the box is compressed).

      There are no dynamics described by this "constant information source" (isothermal) version of the ideal gas law to slowly return the box to its original volume and pressure while the energy of the gas inside the box slowly changes.

      So when I was imagining a "demand bath" associated with the constant demand partial equilibrium before, this is what I imagined.

      Where are the equations describing this slow change of the price back to it's original level?

      "log D ~ k log S
      log P ~ (k - 1) log S"

      Ah, but those are the general equilibrium solutions, not the partial equilibrium solutions.

      OK, I can see that what you're doing here isn't a direct analogy with that "bath" situation. You've folded in a time aspect for one. And in your boxes (not F&B's gas box), the entropy is proportional to the NGDP (I think I saw that in another post). But what about the price? What physical characteristic of those "gas points" in your boxes is analogous to the price?

    3. The above simulations are general equilibrium -- they are simulations that maintain information equilibrium, not solutions to the differential equations under various conditions. It's nice that the differential equations look like they apply ... meaning they are probably right.

      That it looks like partial equilibrium in one segment is a testament to the partial equilibrium approximation working during that segment -- but it's always a general equilibrium solution. Because it's a simulation -- you can't turn on or off different approximations with a simulation except by applying their conditions to simulation. In this case, supply changes faster than the entropic force maintaining equilibrium for a bit (so demand changes slowly).

      It's still the general equilibrium solution; it just looks like the partial equilibrium solution because the partial equilibrium solution is an approximation when certain conditions (that are being met) apply.


Comments are welcome. Please see the Moderation and comment policy.

Also, try to avoid the use of dollar signs as they interfere with my setup of mathjax. I left it set up that way because I think this is funny for an economics blog. You can use € or £ instead.

Note: Only a member of this blog may post a comment.