- Financial Bond Graphs
- Conceptual structures
- Pragmatic ontologies are log-splitters
- Self-assembly means symmetry
- Mental gymnastics
- Magical doodles
- !!Con
- Trailing zeroes of falling factorials
- Game Mechanics from Shadowrift
- my new filing technique is unstoppable
- Establishing a market for ideas
- Production rules for search (and lex ordering)
- Analogy problems
- Estimating debugging
- Paper and pencil collaborators
- Trying to work
- Linkdump
- Empowerment
- Understanding Ceu using Shenzhen I/O
- Pólya urn
- Little interpreters
- No Man's Sky
- The Secretary Problem
- Newsvendor problem
- Survival games
- Ego lens
- Elm Architecture in C++
- Mission and Space
- A little story engine
- Yet another coupon collector's problem blog post
- Reification
- Spreadsheets
- Underdrawing
- Linkdump
- Race games
- Links that I thought were interesting
- Links that I thought were interesting
- Modeling Shmups in Machinations and Ceu
- Modeling Pipe Dream in Machinations and Ceu
- Context Free Grammars for Learning
- SPSC.py howto
- Viva Pajaro and Wardley Mapping
- Where do objects come from? III
- Where do objects come from? II
- Stardew Valley and figure ground reversal
- Meta II by Val Schorre
- Citations, Elisions, and Arguments
- Where do objects come from?
- Protocol Buffers
- Dataflow Bench in Java
- Abstract nonsense continued
- Abstract nonsense
- A Douche-Free bio
- Wiring Idiom in C++
- Dataflow Bench in C
- Visitor Pattern Generator in C++
- First Post
- Elm Architecture in C++

I am interested in transferring an idea (bond graphs) from one domain (electromechanical engineering) to another domain (managerial accounting). So first I have to motivate and explain bond graphs, and then we’ll get to the good stuff.

Ordinary differential equations are one of the most broadly applicable techniques that engineers use. They are used in “lumped” dynamical models of devices. Why are they so powerful? Two reasons: First, time is a promiscuous concept, connecting together lots and lots of phenomena, and we care about the behavior of almost everything we create. So the math of ordinary differential equations, which are about time and continuous change to the extent that they are about anything instead of merely being Platonic ideals, are incredibly widely applicable. Secondly, the freedom to choose what gets lumped together and what gets distinguished apart makes the technique very flexible.

Ordinary differential equations have a standard mathematical notation, but they also have a standard graphical notation: block diagrams.

- The signal, represented as a line with an arrow
- The fanout, represented as a dot or filled circle joining lines
- The summing point, represented as a open circle joining lines
- The integrator, represented as a box with an integral sign on it
- The function, represented as box with a formula on it

I’m talking about these these kinds of things:

There are a rich network of analogies among electrical and mechanical systems. For example pair of wires can communicate power from one component to another, or a rotating shaft can communicate power from one component to another. Current and voltage multiply to form power, while torque and angular velocity multiply to form power. Electrical resistance is like mechanical friction.

When you redraw block diagrams of circuits (or electromechanical systems) so that current (flow) signal lines are adjacent to analogous voltage (effort) signal lines, you find specific pairs of fanouts and summing points naturally draw together. Block-diagrams of series-parallel circuits, when they are redrawn like this, are shaped like graph-theoretic trees, and everything starts to look like molecules.

These are “bond graphs”, and a pair of analogous flow/effort signals is called a bond. You can read more about them here: https://en.wikipedia.org/wiki/Bond_graph (Enthusiasts, including myself, can go on at great length.)

The strength of the bond graph notation comes from the fact that energy is locally conserved (it is also globally conserved, but that is not actually relevant here). Because energy is locally conserved, when two components of a whole that are almost entirely decoupled, they frequently interact in specific stylized ways. One such stylized interaction is a single bond. A single bond is when one component has partial control of the rate of energy transferred (e.g. a flow variable) and the other component also has partial control of the rate of energy transferred (e.g. an effort variable). Even when there are two components of a whole, that are almost entirely decoupled, but interact in a different way, the interaction often corresponds mathematically to a small bond-graph.

(By “managerial accounting” I simply mean accounting for the business’s own purposes - not for the sake of investors, nor for the sake of tax law.)

The analogous law, in finance, to local conservation of energy, is the conservation of book value. If an organization purchases something X for $1000, and then uses that thing up in an activity that results in another thing Y, then that $1000 cost would definitely go somewhere, probably to an account associated with Y, but it should never get lost. Tracing where the organization spent its money is perhaps the most important function of accounting.

The analogs of effort and flow would be two variables that together determine flow of money (or book value). Normally, at the boundary between organizations, one organization sets a price, and the counterparty determines the frequency, (or volume) of transactions per unit time. These two variables multiply to form the rate of money being transferred from one organization to the other. So let’s assume that the analog of flow is transactions per unit time, and the analog of effort is price per transaction.

Once we know what the analogs of effort and flow are, we can use them to find other analogs.

An ideal transformer is a two-port element, which accumulates no energy, where the flow on the one port is proportional to the flow on the other port, and similarly the effort on the one port is proportional to the effort on the other port. In the financial domain, if you buy 12 eggs for 10 dollars 4 times each month, then you buy 1 egg for 0.83 dollars 48 times each month. The modulus (12) relates the price of the dozen (10 dollars) to the price of the unit, and also relates the frequency of the purchase (4 times per month) of the dozen to the frequency of the purchase of the unit (48 times per month).

A capacitor is a one-port element, which accumulates energy, where the integral of the (net) flow (current in the electrical domain) determines the effort (voltage in the electrical domain). Imagine a shopkeeper that accepts transactions, either purchases or sales, and publishes a price according to a rule - when little is available in stock, then the price is high, but when stock is high, then price is low. The stockpile and pricing rule, taken together, is the financial analog to a capacitor. A subtlety is that normally someone who behaves like this (a market-maker) normally publishes two prices, separated by a small gap, so that if one customer buys from the market maker and then another customer sells to the market maker, the market maker harvests some profit, equal to the so-called “bid ask spread”. I believe this corresponds to a non-ideal capacitor, which are actually quite common in the electrical and mechanical domains, but the specifics of how it works is probably unusual.

An ideal effort source (voltage source in the electrical domain) publishes an effort to the rest of the system, and the system can determine how much flow occurs at that effort. This is analogous to a very large market which provides some commodity to the organization. Because the market is very large, no matter what the volume of transactions originating in this organization is, the price doesn’t change due to the organization’s purchases (though it might change endogenously).

A resistor is a one-port, stateless element, where the effort and flow are related via some invertible function. This corresponds to a small external market, where the organization’s purchases strongly influence the price, or perhaps a long-term, trusted supplier. If you are purchasing milk, you might be able to choose daily, weekly, or monthly frequency of deliveries, but for each frequency, there is a different price. Conversely, you could choose how much you want to spend per unit time, but that will determine a frequency or volume of goods or services delivered.

Connecting several components in series means that their flows are equal, but their efforts may differ. If the business is selling simple bundles of A, B, and C, then the book value of the bundle should probably equal the sum of the book values of each of the component, but the frequency of purchases of A, B, C, and the bundle as a whole are all equal.

Connecting several components in parallel means that their efforts are equal, and their flows add. This corresponds to an internal market, or several methods of accomplishing the same thing. For example, if finished goods are sometimes drawn from a stockpile of finished goods and delivered to the customer, and sometimes delivered directly to the customer from the manufacturing line, then there is a symmetry between those alternatives, which forces an equality between one internal price and another. The flows add: the total number of transactions (goods delivered to the customer) equals the number of goods delivered from the stockpile, plus the number of goods delivered directly from the manufacturing line.

An inductor is a one-port element, which accumulates energy, where the integral of the (net) effort determines the flow. Again, I am not certain, but I believe this corresponds to investment. If there is a longstanding difference in prices between X and Y, then it is reasonable to invest money in transforming X into Y, which will tend to reduce the supply of X, and increase the supply of Y, possibly eventually reducing the price difference.

Let’s imagine a simple milk-and-cookies business. The business buys milk in bulk from a very large dairy market. It buys cookies from a very large cookies market. It buys manufacturing and sales labor from a local labor market, which is already full of other forms of seasonal labor. Then it sells bundles consisting of several cookies and some milk to a market which is somewhat price sensitive (since consumers, even if they are somewhat charmed by the idea, can clearly see a substitute - buying cookies and milk individually directly).

The large dairy market is an effort source. The number of units of milk in a bulk purchase of milk is a transformer. The number of units of milk in a milk-and-cookies bundle is another transformer. Similarly cookies are another effort source + transformer + transformer. The seasonal labor market is a resistor. The combination of cookies, milk, and labor is a series connection (the bond graph notation for “series” is “1”). The consumer market is another resistor.

After setting up this (very simple) model, some crucial questions fall out:

- What is the bulk price of milk?
- What size actually is a bulk package of milk?
- What is the bulk price of cookies?
- What size actually is a bulk package of cookies?
- How much milk should be in the bundle?
- How many cookies should be in the bundle?
- What is the price and elasticity of seasonal manufacturing and sales labor?
- What is the price and elasticity of the target market?

The value of the bond graph is in facilitating finding these quantitative questions, out of the qualitative scenario.

Let’s try to do another, similar but more realistic example. What if we buy land, in bulk, and construction, in bulk, and sell finished houses in nice neighborhoods?

We have several stockpiles - of undeveloped land, finished houses, and debt. We have internal prices, which are functions of the current level of those three stockpiles. Debt is funny because it has weird units, but it’s not fundamentally different. The house pricing function takes a number of houses, and returns an internal price, dollars per house. Let’s imagine that debt is purchased in exchange for perpetuities - the right to receive a specific interest payment per month, perpetually. Then the debt pricing function would take a number of dollars in debt and returns an internal price of debt, a number of perpetuities per dollar.

From the perspective of these internal prices, any opportunistic purchases or sales to the external (large) markets each look like sources of flow - determining (net) transactions per unit time.

We have a cost of construction, which probably is a function of the rate of construction. Construction reduces the stockpile of bulk undeveloped land and increases the stockpile of finished houses.

The rate of construction, and the rate of either taking on or paying off debt, might be modeled by a pair of coupled inductors. The sum of three prices - the price of bulk undeveloped land, the price of construction, and the price of finished houses - determines the profit from developing. The intuition here is that a sustained profit potential “should” spin up both the construction rate and the rate of taking on debt. If interest rates fall, then maybe we take on additional debt, and also spin up the construction rate.

The crucial questions that fall out of this (still VERY simple) model are much harder to answer but still relevant:

- What should the pricing function from stock of undeveloped land to internal price of land be?
- What should the pricing function from finished houses owned to internal price of houses be?
- What should the pricing function from stock of debt to interest rate be?
- What is the price (and elasticity) of house construction?
- What should the self-inductance and mutual inductance parameters be to determine rate of change of rate of construction, and rate of change of rate of taking on or paying off debt be?

I don’t know that this is a good model - for example, maybe it’s totally dumb to pay attention to your absolute level of debt rather than some sort of debt-to-asset difference or ratio. However, I think bond graphs are sufficiently flexible that they can probably be made in the shape of whatever the good model is, and they seem to encourage qualities of simplicity, connectedness and computability, in contrast to, say, using ordinary differential equations for business modeling directly or putting arbitrary formulas into spreadsheets.

Opinions expressed are solely my own and do not express the views or opinions of my employer.