Skip to the Main Content

Note:These pages make extensive use of the latest XHTML and CSS Standards. They ought to look great in any standards-compliant modern browser. Unfortunately, they will probably look horrible in older browsers, like Netscape 4.x and IE 4.x. Moreover, many posts use MathML, which is, currently only supported in Mozilla. My best suggestion (and you will thank me when surfing an ever-increasing number of sites on the web which have been crafted to use the new standards) is to upgrade to the latest version of your browser. If that's not possible, consider moving to the Standards-compliant and open-source Mozilla browser.

April 2, 2018

Dynamical Systems and Their Steady States

Posted by John Baez

guest post by Maru Sarazola

Now that we know how to use decorated cospans to represent open networks, the Applied Category Theory Seminar has turned its attention to open reaction networks (aka Petri nets) and the dynamical systems associated to them.

In A Compositional Framework for Reaction Networks (summarized in this very blog by John Baez not too long ago), authors John Baez and Blake Pollard put Fong’s results to good use and define cospan categories RxNet\mathbf{RxNet} and Dynam\mathbf{Dynam} of (open) reaction networks and (open) dynamical systems. Once this is done, the main goal of the paper is to show that the mapping that associates to an open reaction network its corresponding dynamical system is compositional, as is the mapping that takes an open dynamical system to the relation that holds between its constituents in steady state. In other words, they show that the study of the whole can be done through the study of the parts.

I would like to place the focus on dynamical systems and the study of their steady states, taking a closer look at this correspondence called “black-boxing”, and comparing it to previous related work done by David Spivak.

Baez–Pollard’s approach

The category Dynam\mathbf{Dynam} of open dynamical systems

Let’s start by introducing the main players. A dynamical system is usually defined as a manifold MM whose points are “states”, together with a smooth vector field on MM saying how these states evolve in time. Since the motivation in this paper comes from chemistry, our manifolds will be euclidean spaces S\mathbb{R}^S, where SS should be thought of as the finite set of species involved, and a vector c Sc\in\mathbb{R}^S gives the concentration of each species. Then, the dynamical system is a differential equation

dc(t)dt=v(c(t))\frac{d c(t)}{d t}=v(c(t))

where c: Sc:\mathbb{R}\to\mathbb{R}^S gives the concentrations as a function of time, and vv is a vector field on S\mathbb{R}^S.

Now imagine our motivating chemical system is open; that is, we are allowed to inject molecules of some chosen species, and remove some others. An open dynamical system is a cospan of finite sets

together with a vector field vv on S\mathbb{R}^S. Here the legs of the cospan mark the species that we’re allowed to inject and remove, labeled ii (oo) for input (output).

So, how can we build a category from this? Loosely citing a result of Fong, if the decorations of the cospan (in this case, the vector fields) can be given through a functor F:(FinSet,+)(Set,×)F:(\mathbf{FinSet},+)\to(\mathbf{Set},\times ) that is lax monoidal, then we can form a category whose objects are finite sets, and whose morphisms are (iso classes of) decorated cospans.

Indeed, this can be done in a very natural way, and therefore gives rise to the category Dynam\mathbf{Dynam}, whose morphisms are open dynamical systems.

The black-boxing functor :DynamRel\blacksquare :\mathbf{Dynam}\to\mathbf{Rel}

Given a dynamical system, one of the first things we might like to do is to study its fixed points; in our case, study the concentration vectors that remain constant in time. When working with an open dynamical system, it’s clear that the amounts that we choose to inject and remove will alter the change in concentration of our species, and hence it makes sense to consider the following.

For an open dynamical system (XiSoY,v)(X\xrightarrow{i} S \xleftarrow{o} Y, v), together with a constant inflow I XI\in\mathbb{R}^X and constant outflow O YO\in\mathbb{R}^Y, a steady state (with inflows II and outflows OO) is a constant vector of concentrations c Sc\in\mathbb{R}^S such that

v(c)+i *(I)o *(O)=0v(c)+i_{\ast} (I)-o_{\ast} (O)=0

Here i *(I)i_{\ast} (I) is the vector in S\mathbb{R}^S given by i *(I)(s)= xX:i(x)=sI(x)i_{\ast} (I)(s)=\sum_{x\in X: i(x)=s} I(x); that is, the inflow concentration of all species as marked by the input leg of the cospan. As the authors concisely put it, “in a steady state, the inflows and outflows conspire to exactly compensate for the reaction velocities”.

Note that the inflow and outflow functions II and OO won’t affect any species not marked by the legs of the cospan, and so any steady state cc must be such that v(c)=0v(c)=0 when restricted to these inner species that we can’t reach.

What we want to do next is build a functor that, given an open dynamical system, records all possible combinations of input concentrations, output concentrations, inflows and outflows that hold in steady state. This process will be called black-boxing, since it discards information that can’t be seen at the inputs and outputs.

The black-boxing functor :DynamRel\blacksquare:\mathbf{Dynam}\to \mathbf{Rel} takes a finite set XX to the vector space X X\mathbb{R}^X\oplus\mathbb{R}^X, and a morphism, that is, an open dynamical system f=(XiSoY,v)f=(X\xrightarrow{i} S \xleftarrow{o} Y, v), to the subset

(f) X X Y Y\blacksquare(f)\subseteq\mathbb{R}^X\oplus\mathbb{R}^X\oplus\mathbb{R}^Y\oplus\mathbb{R}^Y

(f)={(i *(c),I,o *(c),O):c  is a steady state with inflows  I  and outflows  O}\blacksquare(f)=\{(i^{\ast} (c),I,o^{\ast} (c),O): c   \text{ is a steady state with inflows }   I   \text{ and outflows }   O\}

where i *(c)i^{\ast} (c) is the vector in X\mathbb{R}^X defined by i *(c)(x)=c(i(x))i^{\ast} (c) (x)=c(i(x)); that is, the concentration of the input species.

The authors prove that black-boxing is indeed a functor, which implies that if we want to study the steady states of a complex open dynamical system, we can break it up into smaller, simpler pieces and study their steady states. In other words, studying the steady states of a big system, which is given by the composition of smaller systems (as morphisms in the category Dynam\mathbf{Dynam}) amounts to studying the steady states of each of the smaller systems, and composing them (as morphisms in Rel\mathbf{Rel}).

Spivak’s approach

The category 𝒲\mathcal{W} of wiring diagrams

Instead of dealing with dynamical systems from the start, Spivak takes a step back and develops a syntax for boxes, which are things that admit inputs and outputs.

Let’s define the category 𝒲 𝒞\mathcal{W}_\mathcal{C} of 𝒞\mathcal{C}-boxes and wiring diagrams, for a category 𝒞\mathcal{C} with finite products. Its objects are pairs

X=(X in,X out)X=(X^\text{in},X^\text{out})

where each of these coordinates is a finite product of objects of 𝒞\mathcal{C}. For example, we interpret the pair (A 1×A 2,B 1×B 2×B 3)(A_1\times A_2, B_1\times B_2\times B_3) as a box with input ports (a 1,a 2)A 1×A 2(a_1 ,a_2)\in A_1\times A_2 and output ports (b 1,b 2,b 3)B 1×B 2×B 3(b_1 ,b_2 ,b_3 )\in B_1\times B_2\times B_3.

Its morphisms are wiring diagrams φ:XY\varphi:X\to Y, that is, pairs of maps (φ in,φ out)(\varphi^\text{in},\varphi^\text{out}) which we interpret as a rewiring of the box XX inside of the box YY. The function φ in\varphi^\text{in} indicates whether an input port of XX should be attached to an input of YY or to an output of XX itself; the function φ out\varphi^\text{out} indicates how the outputs of XX feed the outputs of YY. Examples of wirings are

Composition is given by a nesting of wirings.

Given boxes XX and YY, we define their parallel composition by

XY=(X in×Y in,X out×Y out)X\boxtimes Y=(X^\text{in}\times Y^\text{in},X^\text{out}\times Y^\text{out})

This gives a monoidal structure to the category 𝒲 𝒞\mathcal{W}_\mathcal{C}. Parallel composition is true to its name, as illustrated by

The huge advantage of this approach is that one can now fill the boxes with suitable “inhabitants”, and model many different situations that look like wirings at their core. These inhabitants will be given through functors 𝒲 𝒞Set\mathcal{W}_\mathcal{C}\to\mathbf{Set}, taking a box to the set of its desired interpretations, and giving a meaning to the wiring of boxes.

The functor ODS:𝒲 EucSetODS:\mathcal{W}_{\mathbf{Euc}}\to\mathbf{Set} of open dynamical systems

The first of our inhabitants will be, as you probably guessed by now, open dynamical systems. Here 𝒞=Euc\mathcal{C}=\mathbf{Euc} is the category of Euclidean spaces n\mathbb{R}^n and smooth maps.

From the perspective of Spivak’s paper, an ( X, Y)(\mathbb{R}^X,\mathbb{R}^Y)-open dynamical system is a 3-tuple ( S,f dyn,f rdt)(\mathbb{R}^S,f^\text{dyn},f^\text{rdt}) where

  • S\mathbb{R}^S is the state space

  • f dyn: X× S Sf^\text{dyn}:\mathbb{R}^X\times\mathbb{R}^S\to\mathbb{R}^S is a vector field parametrized by the inputs X\mathbb{R}^X, giving the differential equation of the system

  • f rdt: S Yf^\text{rdt}:\mathbb{R}^S\to\mathbb{R}^Y is the readout function at the outputs Y\mathbb{R}^Y.

One should notice the similarity with our previously defined dynamical systems, although it’s clear that the two definitions are not equivalent.

The functor ODS:𝒲 EucSetODS:\mathcal{W}_{\mathbf{Euc}}\to\mathbf{Set} exhibiting dynamical systems as inhabitants of input-output boxes, takes a box X=(X in,X out)X=(X^\text{in},X^\text{out}) to the set of all ( X in, X out)(\mathbb{R}^{X^\text{in}},\mathbb{R}^{X^\text{out}})-dynamical systems

ODS(X)={( S,f dyn: X in× S S,f rdt: S X out)}ODS(X)=\{(\mathbb{R}^S,f^\text{dyn}:\mathbb{R}^{X^\text{in}}\times\mathbb{R}^S\to\mathbb{R}^S,f^\text{rdt}:\mathbb{R}^S\to\mathbb{R}^{X^\text{out}})\}

You can surely figure out how ODSODS acts on wirings by drawing a picture and doing a bit of careful bookkeeping.

Note that there’s a natural notion of parallel composition of two dynamical systems, which amounts to carrying out the processes indicated by the two dynamical systems in parallel. Spivak shows that ODSODS is a functor, and, furthermore, that

ODS(XY)ODS(X)ODS(Y)ODS(X\boxtimes Y)\simeq ODS(X)\boxtimes ODS(Y)

The functor Mat:𝒲 𝒞SetMat:\mathcal{W}_{\mathcal{C}}\to\mathbf{Set} of Set\mathbf{Set}-matrices

Our second inhabitants will be given by matrices of sets. For objects X,YX,Y, an (X,Y)(X,Y)-matrix of sets is a function MM that assigns to each pair (x,y)(x,y) a set M x,yM_{x,y}. In other words, it is a matrix indexed by X×YX\times Y that, instead of coefficients, has sets in each position.

The functor Mat:𝒲 𝒞SetMat:\mathcal{W}_{\mathcal{C}}\to\mathbf{Set} exhibiting Set\mathbf{Set}-matrices as inhabitants of input-output boxes, takes a box X=(X in,X out)X=(X^\text{in},X^\text{out}) to the set of all (X in,X out)(X^\text{in},X^\text{out})-matrices of sets

Mat(X)={{M i,j} X in×X out:M i,j  is a set}Mat(X)=\{\{M_{i,j}\}_{X^\text{in}\times X^\text{out}} : M_{i,j}   \text{ is a set}\}

Once again, it’s not too hard to figure out how MatMat should act on wirings.

Like before, there’s a notion of parallel composition of two matrices of sets, and the author shows that MatMat is a functor such that

Mat(XY)Mat(X)Mat(Y)Mat(X\boxtimes Y)\simeq Mat(X)\boxtimes Mat(Y)

The steady-state natural transformation Stst:ODSMatStst:ODS\to Mat

Finally, we explain how to use all this to study steady states of dynamical systems.

Given an ( X, Y)(\mathbb{R}^X,\mathbb{R}^Y)-dynamical system f=( S,f dyn,f rdt)f=(\mathbb{R}^S,f^\text{dyn},f^\text{rdt}) and an element (I,O) X× Y(I,O)\in\mathbb{R}^X\times\mathbb{R}^Y, an (I,O)(I,O)-steady state is a state c Sc\in\mathbb{R}^S such that

f dyn(I,c)=0   and   f rdt(c)=Of^\text{dyn}(I,c)=0     \text{ and }     f^\text{rdt}(c)=O

Since dynamical systems are encoded by the functor ODSODS, it makes sense to study steady states through a natural transformation out of ODSODS. We define Stst:ODSMatStst:ODS\to Mat as the transformation that assigns to each box XX, the function

Stst X:ODS(X)Mat(X)Stst_X:ODS(X)\longrightarrow Mat(X)

taking a dynamical system ( S,f dyn,f rdt)(\mathbb{R}^S,f^\text{dyn},f^\text{rdt}) to its matrix of steady states

M I,O={c S:f dyn(I,c)=0, f rdt(c)=O}M_{I,O}=\{c\in\mathbb{R}^S : f^\text{dyn}(I,c)=0,   f^\text{rdt}(c)=O\}

where (I,O) X in× X out(I,O)\in \mathbb{R}^{X^\text{in}}\times \mathbb{R}^{X^\text{out}}. The author proceeds to show that StstStst is a monoidal natural transformation.

Is it possible to use this machinery to draw the same conclusion as before, that is, that the steady states of a composition of systems comes from the composition of the steady states of the parts?

Indeed, it is! Given two boxes X 1X_1 and X 2X_2, we recover the usual notion of (serial) composition by first setting them in parallel X 1X 2X_1 \boxtimes X_2,

and wiring this by φ:X 1X 2Y\varphi:X_1 \boxtimes X_2\to Y as follows:

The fact that StstStst is a monoidal natural transformation, combined with the facts that the functors ODSODS and MatMat respect parallel composition, allows us to write the following diagram, where both squares are commutative

Then, chasing the diagram along the top and left sides gives the steady states of the serial composition of the dynamical systems X 1X_1 and X 2X_2, while chasing it along the right and bottom sides gives the composition of the steady states of X 1X_1 and of X 2X_2, and the two must agree.

The two approaches, side by side

So how are these two perspectives related? Looking at the definitions we can immediately see that Spivak’s approach has a broader scope than Baez and Pollard’s, so it’s apparent that his results won’t be implied by theirs.

For the converse direction, recall that in the first paper, a dynamical system is given by a decorated cospan f=(XiSoY,v)f=(X\xrightarrow{i} S \xleftarrow{o} Y, v), and a steady state with inflows II and outflows OO is a constant vector of concentrations c Sc\in\mathbb{R}^S such that

v(c)+i *(I)o *(O)=0v(c)+i_{\ast} (I)-o_{\ast} (O)=0

Thus, studying the steady states for this cospan system corresponds to studying the box system

f=( S,f dyn: X× S S,f rdt: S Y)f=(\mathbb{R}^S, f^\text{dyn}:\mathbb{R}^X\times\mathbb{R}^S\to\mathbb{R}^S, f^\text{rdt}:\mathbb{R}^S\to\mathbb{R}^Y)

with dynamics given by f dyn(I,c)=v(c)+i *(I)o *(f rdt(c))f^\text{dyn}(I,c)=v(c)+i_{\ast} (I)-o_{\ast} (f^\text{rdt}(c)), since its (I,O)(I,O)-steady states are vectors c Sc\in\mathbb{R}^S such that

f dyn(I,c)=0   and   f rdt(c)=Of^\text{dyn}(I,c)=0     \text{ and }     f^\text{rdt}(c)=O

Thus, the study of the steady states of a given cospan dynamical system can be done just as well by looking at it as a box dynamical system and running it through Spivak’s machinery. However, setting two such box systems in serial composition will not yield the box system representing the composition of the cospan systems as one would (naively?) hope, so it doesn’t seem that Spivak’s compositional results will imply those of Baez and Pollard.

This is a bit disconcerting, but instead of it being discouraging, I believe it should be seen as an invitation to delve into the semantics of open dynamical systems and find the right perspective, which manages to subsume both of the approaches presented here.

Posted at April 2, 2018 8:49 PM UTC

TrackBack URL for this Entry:   https://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/3030

1 Comment & 0 Trackbacks

Re: Dynamical Systems and Their Steady States

Can Spivak’s formalism of open dynamical systems express the same sequential composition of dynamical systems as the Baez-Pollard Dynam?

Also this all smells very double categorical to me. I know Decorated Cospans come with a natural double category structure, maybe Spivak’s functors can be viewed that way too.

Posted by: Max S. New on April 6, 2018 9:47 PM | Permalink | Reply to this

Post a New Comment