<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[Azimuth]]></provider_name><provider_url><![CDATA[https://johncarlosbaez.wordpress.com]]></provider_url><author_name><![CDATA[John Baez]]></author_name><author_url><![CDATA[https://johncarlosbaez.wordpress.com/author/johncarlosbaez/]]></author_url><title><![CDATA[Network Theory (Part&nbsp;32)]]></title><type><![CDATA[link]]></type><html><![CDATA[<p>Okay, today we will look at the &#8216;black box functor&#8217; for circuits made of resistors.  Very roughly, this takes a circuit made of resistors with some inputs and outputs:</p>
<div align="center"><img src="https://i2.wp.com/math.ucr.edu/home/baez/networks/circuit_made_of_resistors.png" /></div>
<p>and puts a &#8216;black box&#8217; around it:</p>
<div align="center"><img src="https://i0.wp.com/math.ucr.edu/home/baez/networks/circuit_made_of_resistors_black_boxed.png" /></div>
<p>forgetting the internal details of the circuit and remembering only how the it <i>behaves as viewed from outside</i>.  As viewed from outside, all the circuit does is define a relation between the potentials and currents at the inputs and outputs.  We call this relation the circuit&#8217;s <b>behavior</b>.  Lots of different choices of the resistances <img src='https://s0.wp.com/latex.php?latex=R_1%2C+%5Cdots%2C+R_6&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='R_1, &#92;dots, R_6' title='R_1, &#92;dots, R_6' class='latex' /> would give the same behavior.  In fact, we could even replace the whole fancy circuit by a single edge with a single resistor on it, and get a circuit with the same behavior!</p>
<p>The idea is that when we use a circuit to do something, all we care about is its behavior: what it does as viewed from outside, not what it&#8217;s made of.</p>
<p>Furthermore, we&#8217;d like the behavior of a system made of parts to depend in a simple way on the external behaviors of its parts.  We don&#8217;t want to have to &#8216;peek inside&#8217; the parts to figure out what the whole will do!  Of course, in some situations we <i>do</i> need to peek inside the parts to see what the whole will do.  But in this particular case we don&#8217;t&#8212;at least in the idealization we are considering.  And this fact is described mathematically by saying that black boxing is a <a href="http://en.wikipedia.org/wiki/Functor">functor</a>.</p>
<p>So, how do circuits made of resistors behave?  To answer this we first need to remember what they <i>are!</i></p>
<h3> Review </h3>
<p>Remember that for us, a <b>circuit made of resistors</b> is a mathematical structure like this:</p>
<div align="center">
<img width="205" src="https://i2.wp.com/math.ucr.edu/home/baez/networks/cospan.jpg" />
</div>
<p>It&#8217;s a cospan where:</p>
<p>&bull; <img src='https://s0.wp.com/latex.php?latex=%5CGamma&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;Gamma' title='&#92;Gamma' class='latex' /> is a <b>graph labelled by resistances</b>.  So, it consists of a finite set <img src='https://s0.wp.com/latex.php?latex=N&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='N' title='N' class='latex' /> of <b>nodes</b>, a finite set <img src='https://s0.wp.com/latex.php?latex=E&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='E' title='E' class='latex' /> of <b>edges</b>, two functions</p>
<p><img src='https://s0.wp.com/latex.php?latex=s%2C+t+%3A+E+%5Cto+N&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s, t : E &#92;to N' title='s, t : E &#92;to N' class='latex' /></p>
<p>sending each edge to its <b>source</b> and <b>target</b> nodes, and a function</p>
<p><img src='https://s0.wp.com/latex.php?latex=r+%3A+E+%5Cto+%280%2C%5Cinfty%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='r : E &#92;to (0,&#92;infty)' title='r : E &#92;to (0,&#92;infty)' class='latex' /></p>
<p>that labels each edge with its <b>resistance</b>.</p>
<p>&bull; <img src='https://s0.wp.com/latex.php?latex=i%3A+I+%5Cto+%5CGamma&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i: I &#92;to &#92;Gamma' title='i: I &#92;to &#92;Gamma' class='latex' /> is a map of graphs labelled by resistances, where <img src='https://s0.wp.com/latex.php?latex=I&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='I' title='I' class='latex' /> has no edges.  A labelled graph with no edges has nothing but nodes!  So, the map <img src='https://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' /> is just a trick for specifying a finite set of nodes called <b>inputs</b> and mapping them to <img src='https://s0.wp.com/latex.php?latex=N.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='N.' title='N.' class='latex' />  Thus <img src='https://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' /> picks out some nodes of <img src='https://s0.wp.com/latex.php?latex=%5CGamma&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;Gamma' title='&#92;Gamma' class='latex' /> and declares them to be inputs.  (However, <img src='https://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' /> may not be one-to-one!  We&#8217;ll take advantage of that subtlety later.)</p>
<p>&bull; <img src='https://s0.wp.com/latex.php?latex=o%3A+O+%5Cto+%5CGamma&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='o: O &#92;to &#92;Gamma' title='o: O &#92;to &#92;Gamma' class='latex' /> is another map of graphs labelled by resistances, where <img src='https://s0.wp.com/latex.php?latex=O&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='O' title='O' class='latex' /> again has no edges, and we call its nodes <b>outputs</b>.</p>
<h3> The principle of minimum power </h3>
<p>So what does a circuit made of resistors <i>do?</i>  This is described by the principle of minimum power.</p>
<p>Recall from <a href="https://johncarlosbaez.wordpress.com/2013/04/03/network-theory-part-27/">Part 27</a> that when we put it to work, our circuit has a <b>current</b> <img src='https://s0.wp.com/latex.php?latex=I_e&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='I_e' title='I_e' class='latex' /> flowing along each edge <img src='https://s0.wp.com/latex.php?latex=e+%5Cin+E.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='e &#92;in E.' title='e &#92;in E.' class='latex' />  This is described by a function</p>
<p><img src='https://s0.wp.com/latex.php?latex=I%3A+E+%5Cto+%5Cmathbb%7BR%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='I: E &#92;to &#92;mathbb{R} ' title='I: E &#92;to &#92;mathbb{R} ' class='latex' /></p>
<p>It also has a <b>voltage</b> across each edge.  The word &#8216;across&#8217; is standard here, but don&#8217;t worry about it too much; what matters is that we have another function</p>
<p><img src='https://s0.wp.com/latex.php?latex=V%3A+E+%5Cto+%5Cmathbb%7BR%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='V: E &#92;to &#92;mathbb{R} ' title='V: E &#92;to &#92;mathbb{R} ' class='latex' /></p>
<p>describing the voltage <img src='https://s0.wp.com/latex.php?latex=V_e&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='V_e' title='V_e' class='latex' /> across each edge <img src='https://s0.wp.com/latex.php?latex=e.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='e.' title='e.' class='latex' /></p>
<p>Resistors heat up when current flows through them, so they eat up electrical power and turn this power into heat.  How much?  The <b>power</b> is given by</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+P+%3D+%5Csum_%7Be+%5Cin+E%7D+I_e+V_e+%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ P = &#92;sum_{e &#92;in E} I_e V_e }' title='&#92;displaystyle{ P = &#92;sum_{e &#92;in E} I_e V_e }' class='latex' /></p>
<p>So far, so good.  But what does it mean to minimize power?</p>
<p>To understand this, we need to manipulate the formula for power using the laws of electrical circuits described in <a href="https://johncarlosbaez.wordpress.com/2013/04/03/network-theory-part-27/">Part 27</a>.  First, <b>Ohm&#8217;s law</b> says that for linear resistors, the current is proportional to the voltage.  More precisely, for each edge <img src='https://s0.wp.com/latex.php?latex=e+%5Cin+E%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='e &#92;in E,' title='e &#92;in E,' class='latex' /></p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+I_e+%3D+%5Cfrac%7BV_e%7D%7Br_e%7D+%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ I_e = &#92;frac{V_e}{r_e} }' title='&#92;displaystyle{ I_e = &#92;frac{V_e}{r_e} }' class='latex' /></p>
<p>where <img src='https://s0.wp.com/latex.php?latex=r_e&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='r_e' title='r_e' class='latex' /> is the resistance of that edge.  So, the bigger the resistance, the less current flows: that makes sense.  Using Ohm&#8217;s law we get</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+P+%3D+%5Csum_%7Be+%5Cin+E%7D+%5Cfrac%7BV_e%5E2%7D%7Br_e%7D+%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ P = &#92;sum_{e &#92;in E} &#92;frac{V_e^2}{r_e} }' title='&#92;displaystyle{ P = &#92;sum_{e &#92;in E} &#92;frac{V_e^2}{r_e} }' class='latex' /></p>
<p>Now we see that power is always nonnegative!  Now it makes more sense to minimize it.  Of course we could minimize it simply by setting all the voltages equal to zero.  That would work, but that would be boring: it gives a circuit with no current flowing through it.  The fun starts when we minimize power <i>subject to some constraints</i>.</p>
<p>For this we need to remember another law of electrical circuits: a spinoff of <b>Kirchhoff&#8217;s voltage law</b>.  This says that we can find a function called the <b>potential</b></p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cphi%3A+N+%5Cto+%5Cmathbb%7BR%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;phi: N &#92;to &#92;mathbb{R} ' title='&#92;phi: N &#92;to &#92;mathbb{R} ' class='latex' /></p>
<p>such that</p>
<p><img src='https://s0.wp.com/latex.php?latex=V_e+%3D+%5Cphi_%7Bs%28e%29%7D+-+%5Cphi_%7Bt%28e%29%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='V_e = &#92;phi_{s(e)} - &#92;phi_{t(e)}' title='V_e = &#92;phi_{s(e)} - &#92;phi_{t(e)}' class='latex' /></p>
<p>for each <img src='https://s0.wp.com/latex.php?latex=e+%5Cin+E.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='e &#92;in E.' title='e &#92;in E.' class='latex' /> In other words, the voltage across each edge is the difference of potentials at the two ends of this edge.</p>
<p>Using this, we can rewrite the power as</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+P+%3D+%5Csum_%7Be+%5Cin+E%7D+%5Cfrac%7B1%7D%7Br_e%7D+%28%5Cphi_%7Bs%28e%29%7D+-+%5Cphi_%7Bt%28e%29%7D%29%5E2+%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ P = &#92;sum_{e &#92;in E} &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)})^2 }' title='&#92;displaystyle{ P = &#92;sum_{e &#92;in E} &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)})^2 }' class='latex' /></p>
<p>Now we&#8217;re really ready to minimize power!  Our circuit made of resistors has certain nodes called <b>terminals</b>:</p>
<p><img src='https://s0.wp.com/latex.php?latex=T+%5Csubseteq+N&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='T &#92;subseteq N' title='T &#92;subseteq N' class='latex' /></p>
<p>These are the nodes that are either inputs or outputs.  More precisely, they&#8217;re the nodes in the image of</p>
<p><img src='https://s0.wp.com/latex.php?latex=i%3A+I+%5Cto+%5CGamma&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i: I &#92;to &#92;Gamma' title='i: I &#92;to &#92;Gamma' class='latex' /></p>
<p>or</p>
<p><img src='https://s0.wp.com/latex.php?latex=o%3A+O+%5Cto+%5CGamma&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='o: O &#92;to &#92;Gamma' title='o: O &#92;to &#92;Gamma' class='latex' /></p>
<p>The <b>principle of minimum power</b> says that:</p>
<blockquote><p>
If we fix the potential <img src='https://s0.wp.com/latex.php?latex=%5Cphi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;phi' title='&#92;phi' class='latex' /> on all terminals, the potential at other nodes will minimize the power</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+P%28%5Cphi%29+%3D+%5Csum_%7Be+%5Cin+E%7D+%5Cfrac%7B1%7D%7Br_e%7D+%28%5Cphi_%7Bs%28e%29%7D+-+%5Cphi_%7Bt%28e%29%7D%29%5E2+%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ P(&#92;phi) = &#92;sum_{e &#92;in E} &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)})^2 }' title='&#92;displaystyle{ P(&#92;phi) = &#92;sum_{e &#92;in E} &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)})^2 }' class='latex' /></p>
<p>subject to this constraint.
</p></blockquote>
<p>This should remind you of all the other minimum or maximum principles you know, like the principle of least action, or the way a system in thermodynamic equilibrium maximizes its entropy.  All these principles&#8212;or at least, most of them&#8212;are connected.   I could talk about this endlessly.  But not now!</p>
<p>Now let&#8217;s just <i>use</i> the principle of minimum power.  Let&#8217;s see what it tells us about the behavior of an electrical circuit.</p>
<p>Let&#8217;s imagine changing the potential <img src='https://s0.wp.com/latex.php?latex=%5Cphi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;phi' title='&#92;phi' class='latex' /> by adding some multiple of a function</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cpsi%3A+N+%5Cto+%5Cmathbb%7BR%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;psi: N &#92;to &#92;mathbb{R}' title='&#92;psi: N &#92;to &#92;mathbb{R}' class='latex' /></p>
<p>If this other function vanishes at the terminals:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cforall+n+%5Cin+T+%5C%3B+%5C%3B+%5Cpsi%28n%29+%3D+0+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;forall n &#92;in T &#92;; &#92;; &#92;psi(n) = 0 ' title='&#92;forall n &#92;in T &#92;; &#92;; &#92;psi(n) = 0 ' class='latex' /></p>
<p>then <img src='https://s0.wp.com/latex.php?latex=%5Cphi+%2B+x+%5Cpsi+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;phi + x &#92;psi ' title='&#92;phi + x &#92;psi ' class='latex' /> doesn&#8217;t change at the terminals as we change the number <img src='https://s0.wp.com/latex.php?latex=x.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x.' title='x.' class='latex' /></p>
<p>Now suppose <img src='https://s0.wp.com/latex.php?latex=%5Cphi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;phi' title='&#92;phi' class='latex' /> <b>obeys the principle of minimum power</b>.  In other words, supposes it minimizes power subject to the constraint of taking the values it does at the terminals.  Then we must have</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cfrac%7Bd%7D%7Bd+x%7D+P%28%5Cphi+%2B+x+%5Cpsi%29%5CBig%7C_%7Bx+%3D+0%7D+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;frac{d}{d x} P(&#92;phi + x &#92;psi)&#92;Big|_{x = 0} } ' title='&#92;displaystyle{ &#92;frac{d}{d x} P(&#92;phi + x &#92;psi)&#92;Big|_{x = 0} } ' class='latex' /></p>
<p>whenever</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cforall+n+%5Cin+T+%5C%3B+%5C%3B+%5Cpsi%28n%29+%3D+0+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;forall n &#92;in T &#92;; &#92;; &#92;psi(n) = 0 ' title='&#92;forall n &#92;in T &#92;; &#92;; &#92;psi(n) = 0 ' class='latex' /></p>
<p>This is just the first derivative test for a minimum.  But the converse is true, too!  The reason is that our power function is a sum of nonnegative quadratic terms.  Its graph will look like a paraboloid.  So, the power has no points where its derivative vanishes except minima, even when we constrain <img src='https://s0.wp.com/latex.php?latex=%5Cphi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;phi' title='&#92;phi' class='latex' /> by making it lie on a linear subspace.</p>
<p>We can go ahead and start working out the derivative:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cfrac%7Bd%7D%7Bd+x%7D+P%28%5Cphi+%2B+x+%5Cpsi%29%21+%3D+%21+%5Cfrac%7Bd%7D%7Bd+x%7D+%5Csum_%7Be+%5Cin+E%7D+%5Cfrac%7B1%7D%7Br_e%7D+%28%5Cphi_%7Bs%28e%29%7D+-+%5Cphi_%7Bt%28e%29%7D+%2B+x%28%5Cpsi_%7Bs%28e%29%7D+-%5Cpsi_%7Bt%28e%29%7D%29%29%5E2++%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;frac{d}{d x} P(&#92;phi + x &#92;psi)! = ! &#92;frac{d}{d x} &#92;sum_{e &#92;in E} &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)} + x(&#92;psi_{s(e)} -&#92;psi_{t(e)}))^2  }' title='&#92;displaystyle{ &#92;frac{d}{d x} P(&#92;phi + x &#92;psi)! = ! &#92;frac{d}{d x} &#92;sum_{e &#92;in E} &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)} + x(&#92;psi_{s(e)} -&#92;psi_{t(e)}))^2  }' class='latex' /></p>
<p>To work out the derivative of these quadratic terms at <img src='https://s0.wp.com/latex.php?latex=x+%3D+0%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x = 0,' title='x = 0,' class='latex' /> we only need to keep the part that&#8217;s proportional to <img src='https://s0.wp.com/latex.php?latex=x.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x.' title='x.' class='latex' />  The rest gives zero.  So:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Bccl%7D+%5Cdisplaystyle%7B+%5Cfrac%7Bd%7D%7Bd+t%7D+P%28%5Cphi+%2B+x+%5Cpsi%29%5CBig%7C_%7Bx+%3D+0%7D+%7D+%26%3D%26+%5Cdisplaystyle%7B+%5Cfrac%7Bd%7D%7Bd+x%7D+%5Csum_%7Be+%5Cin+E%7D+%5Cfrac%7Bx%7D%7Br_e%7D+%28%5Cphi_%7Bs%28e%29%7D+-+%5Cphi_%7Bt%28e%29%7D%29+%28%5Cpsi_%7Bs%28e%29%7D+-+%5Cpsi_%7Bt%28e%29%7D%29+%5CBig%7C_%7Bx+%3D+0%7D+%7D+%5C%5C+%5C%5C++%26%3D%26+++%5Cdisplaystyle%7B++%5Csum_%7Be+%5Cin+E%7D+%5Cfrac%7B1%7D%7Br_e%7D+%28%5Cphi_%7Bs%28e%29%7D+-+%5Cphi_%7Bt%28e%29%7D%29+%28%5Cpsi_%7Bs%28e%29%7D+-+%5Cpsi_%7Bt%28e%29%7D%29+%7D++%5Cend%7Barray%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;begin{array}{ccl} &#92;displaystyle{ &#92;frac{d}{d t} P(&#92;phi + x &#92;psi)&#92;Big|_{x = 0} } &amp;=&amp; &#92;displaystyle{ &#92;frac{d}{d x} &#92;sum_{e &#92;in E} &#92;frac{x}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) (&#92;psi_{s(e)} - &#92;psi_{t(e)}) &#92;Big|_{x = 0} } &#92;&#92; &#92;&#92;  &amp;=&amp;   &#92;displaystyle{  &#92;sum_{e &#92;in E} &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) (&#92;psi_{s(e)} - &#92;psi_{t(e)}) }  &#92;end{array}' title='&#92;begin{array}{ccl} &#92;displaystyle{ &#92;frac{d}{d t} P(&#92;phi + x &#92;psi)&#92;Big|_{x = 0} } &amp;=&amp; &#92;displaystyle{ &#92;frac{d}{d x} &#92;sum_{e &#92;in E} &#92;frac{x}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) (&#92;psi_{s(e)} - &#92;psi_{t(e)}) &#92;Big|_{x = 0} } &#92;&#92; &#92;&#92;  &amp;=&amp;   &#92;displaystyle{  &#92;sum_{e &#92;in E} &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) (&#92;psi_{s(e)} - &#92;psi_{t(e)}) }  &#92;end{array}' class='latex' /></p>
<p>The principle of minimum power says this is zero whenever <img src='https://s0.wp.com/latex.php?latex=%5Cpsi+%3A+N+%5Cto+%5Cmathbb%7BR%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;psi : N &#92;to &#92;mathbb{R}' title='&#92;psi : N &#92;to &#92;mathbb{R}' class='latex' /> is a function that vanishes at terminals.  By linearity, it&#8217;s enough to consider functions <img src='https://s0.wp.com/latex.php?latex=%5Cpsi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;psi' title='&#92;psi' class='latex' /> that are zero at every node except one node <img src='https://s0.wp.com/latex.php?latex=n&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n' title='n' class='latex' /> that is not a terminal.  By linearity we can also assume <img src='https://s0.wp.com/latex.php?latex=%5Cpsi%28n%29+%3D+1.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;psi(n) = 1.' title='&#92;psi(n) = 1.' class='latex' /></p>
<p>Given this, the only nonzero terms in the sum</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Csum_%7Be+%5Cin+E%7D+%5Cfrac%7B1%7D%7Br_e%7D+%28%5Cphi_%7Bs%28e%29%7D+-+%5Cphi_%7Bt%28e%29%7D%29+%28%5Cpsi_%7Bs%28e%29%7D+-+%5Cpsi_%7Bt%28e%29%7D%29+%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;sum_{e &#92;in E} &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) (&#92;psi_{s(e)} - &#92;psi_{t(e)}) }' title='&#92;displaystyle{ &#92;sum_{e &#92;in E} &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) (&#92;psi_{s(e)} - &#92;psi_{t(e)}) }' class='latex' /></p>
<p>will be those involving edges whose source or target is <img src='https://s0.wp.com/latex.php?latex=n.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n.' title='n.' class='latex' />  We get</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Bccc%7D+%5Cdisplaystyle%7B+%5Cfrac%7Bd%7D%7Bd+x%7D+P%28%5Cphi+%2B+x+%5Cpsi%29%5CBig%7C_%7Bx+%3D+0%7D+%7D+%26%3D%26+%5Cdisplaystyle%7B+%5Csum_%7Be%3A+%5C%3B+s%28e%29+%3D+n%7D++%5Cfrac%7B1%7D%7Br_e%7D+%28%5Cphi_%7Bs%28e%29%7D+-+%5Cphi_%7Bt%28e%29%7D%29%7D++%5C%5C++%5C%5C++++++++%26%26+-%5Cdisplaystyle%7B+%5Csum_%7Be%3A+%5C%3B+t%28e%29+%3D+n%7D++%5Cfrac%7B1%7D%7Br_e%7D+%28%5Cphi_%7Bs%28e%29%7D+-+%5Cphi_%7Bt%28e%29%7D%29+%7D+++%5Cend%7Barray%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;begin{array}{ccc} &#92;displaystyle{ &#92;frac{d}{d x} P(&#92;phi + x &#92;psi)&#92;Big|_{x = 0} } &amp;=&amp; &#92;displaystyle{ &#92;sum_{e: &#92;; s(e) = n}  &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)})}  &#92;&#92;  &#92;&#92;        &amp;&amp; -&#92;displaystyle{ &#92;sum_{e: &#92;; t(e) = n}  &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) }   &#92;end{array} ' title='&#92;begin{array}{ccc} &#92;displaystyle{ &#92;frac{d}{d x} P(&#92;phi + x &#92;psi)&#92;Big|_{x = 0} } &amp;=&amp; &#92;displaystyle{ &#92;sum_{e: &#92;; s(e) = n}  &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)})}  &#92;&#92;  &#92;&#92;        &amp;&amp; -&#92;displaystyle{ &#92;sum_{e: &#92;; t(e) = n}  &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) }   &#92;end{array} ' class='latex' /></p>
<p>So, the principle of minimum power says precisely</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Csum_%7Be%3A+%5C%3B+s%28e%29+%3D+n%7D++%5Cfrac%7B1%7D%7Br_e%7D+%28%5Cphi_%7Bs%28e%29%7D+-+%5Cphi_%7Bt%28e%29%7D%29+%3D+%5Csum_%7Be%3A+%5C%3B+t%28e%29+%3D+n%7D++%5Cfrac%7B1%7D%7Br_e%7D+%28%5Cphi_%7Bs%28e%29%7D+-+%5Cphi_%7Bt%28e%29%7D%29+%7D+++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;sum_{e: &#92;; s(e) = n}  &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) = &#92;sum_{e: &#92;; t(e) = n}  &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) }   ' title='&#92;displaystyle{ &#92;sum_{e: &#92;; s(e) = n}  &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) = &#92;sum_{e: &#92;; t(e) = n}  &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) }   ' class='latex' /></p>
<p>for all nodes <img src='https://s0.wp.com/latex.php?latex=n&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n' title='n' class='latex' /> that aren&#8217;t terminals.</p>
<p>What does this mean?  You could just say it&#8217;s a set of linear equations that must be obeyed by the potential <img src='https://s0.wp.com/latex.php?latex=%5Cphi.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;phi.' title='&#92;phi.' class='latex' />  So, the principle of minimum power says that fixing the potential at terminals, the potential at other nodes must be chosen in a way that obeys a set of linear equations.</p>
<p>But what do these equations <i>mean?</i>  They have a nice meaning.  Remember, Kirchhoff&#8217;s voltage law says</p>
<p><img src='https://s0.wp.com/latex.php?latex=V_e+%3D+%5Cphi_%7Bs%28e%29%7D+-+%5Cphi_%7Bt%28e%29%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='V_e = &#92;phi_{s(e)} - &#92;phi_{t(e)}' title='V_e = &#92;phi_{s(e)} - &#92;phi_{t(e)}' class='latex' /></p>
<p>and Ohm&#8217;s law says</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+I_e+%3D+%5Cfrac%7BV_e%7D%7Br_e%7D+%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ I_e = &#92;frac{V_e}{r_e} }' title='&#92;displaystyle{ I_e = &#92;frac{V_e}{r_e} }' class='latex' /></p>
<p>Putting these together,</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+I_e+%3D+%5Cfrac%7B1%7D%7Br_e%7D+%28%5Cphi_%7Bs%28e%29%7D+-+%5Cphi_%7Bt%28e%29%7D%29+%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ I_e = &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) }' title='&#92;displaystyle{ I_e = &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) }' class='latex' /></p>
<p>so the principle of minimum power merely says that</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Csum_%7Be%3A+%5C%3B+s%28e%29+%3D+n%7D+I_e+%3D+%5Csum_%7Be%3A+%5C%3B+t%28e%29+%3D+n%7D++I_e+%7D+++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;sum_{e: &#92;; s(e) = n} I_e = &#92;sum_{e: &#92;; t(e) = n}  I_e }   ' title='&#92;displaystyle{ &#92;sum_{e: &#92;; s(e) = n} I_e = &#92;sum_{e: &#92;; t(e) = n}  I_e }   ' class='latex' /></p>
<p>for any node <img src='https://s0.wp.com/latex.php?latex=n&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n' title='n' class='latex' /> that is not a terminal.</p>
<p>This is <b>Kirchhoff&#8217;s current law</b>: for any node except a terminal, the total current flowing into that node must equal the total current flowing out!  That makes a lot of sense.  We allow current to flow in or out of our circuit at terminals, but &#8216;inside&#8217; the circuit charge is conserved, so if current flows into some other node, an equal amount has to flow out.</p>
<p>In short: the principle of minimum power implies Kirchoff&#8217;s current law!  Conversely, we can run the whole argument backward and derive the principle of minimum power from Kirchhoff&#8217;s current law.  (In both the forwards and backwards versions of this argument, we use Kirchhoff&#8217;s voltage law and Ohm&#8217;s law.)</p>
<p>When the node <img src='https://s0.wp.com/latex.php?latex=n&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n' title='n' class='latex' /> is a terminal, the quantity</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B++%5Csum_%7Be%3A+%5C%3B+s%28e%29+%3D+n%7D+I_e+%5C%3B+-+%5C%3B+%5Csum_%7Be%3A+%5C%3B+t%28e%29+%3D+n%7D++I_e+%7D+++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{  &#92;sum_{e: &#92;; s(e) = n} I_e &#92;; - &#92;; &#92;sum_{e: &#92;; t(e) = n}  I_e }   ' title='&#92;displaystyle{  &#92;sum_{e: &#92;; s(e) = n} I_e &#92;; - &#92;; &#92;sum_{e: &#92;; t(e) = n}  I_e }   ' class='latex' /></p>
<p>need not be zero.  But it has an important meaning: it&#8217;s the amount of current flowing into that terminal!</p>
<p>We&#8217;ll call this <img src='https://s0.wp.com/latex.php?latex=I_n%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='I_n,' title='I_n,' class='latex' /> the <b>current at the terminal</b> <img src='https://s0.wp.com/latex.php?latex=n+%5Cin+T.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n &#92;in T.' title='n &#92;in T.' class='latex' />    This is something we can measure even when our circuit has a black box around it:</p>
<div align="center"><img src="https://i0.wp.com/math.ucr.edu/home/baez/networks/circuit_made_of_resistors_black_boxed.png" /></div>
<p>So is the potential <img src='https://s0.wp.com/latex.php?latex=%5Cphi_n&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;phi_n' title='&#92;phi_n' class='latex' /> at the terminal <img src='https://s0.wp.com/latex.php?latex=n.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n.' title='n.' class='latex' />  It&#8217;s these currents and potentials <i>at terminals</i> that matter when we try to describe the behavior of a circuit while ignoring its inner workings.</p>
<h3> Black boxing </h3>
<p>Now let me quickly sketch how black boxing becomes a functor.</p>
<p>A circuit made of resistors gives a <i>linear relation</i> between the potentials and currents at terminals.  A relation is something that can hold or fail to hold.  A &#8216;linear&#8217; relation is one defined using linear equations.</p>
<p>A bit more precisely, suppose we choose potentials and currents at the terminals:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cpsi+%3A+T+%5Cto+%5Cmathbb%7BR%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;psi : T &#92;to &#92;mathbb{R} ' title='&#92;psi : T &#92;to &#92;mathbb{R} ' class='latex' /></p>
<p><img src='https://s0.wp.com/latex.php?latex=J+%3A+T+%5Cto+%5Cmathbb%7BR%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='J : T &#92;to &#92;mathbb{R} ' title='J : T &#92;to &#92;mathbb{R} ' class='latex' /></p>
<p>Then we seek potentials and currents at all the nodes and edges of our circuit:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cphi%3A+N+%5Cto+%5Cmathbb%7BR%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;phi: N &#92;to &#92;mathbb{R} ' title='&#92;phi: N &#92;to &#92;mathbb{R} ' class='latex' /></p>
<p><img src='https://s0.wp.com/latex.php?latex=I+%3A+E+%5Cto+%5Cmathbb%7BR%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='I : E &#92;to &#92;mathbb{R}' title='I : E &#92;to &#92;mathbb{R}' class='latex' /></p>
<p>that are compatible with our choice of <img src='https://s0.wp.com/latex.php?latex=%5Cpsi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;psi' title='&#92;psi' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=J.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='J.' title='J.' class='latex' />  Here <b>compatible</b> means that</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cpsi_n+%3D+%5Cphi_n&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;psi_n = &#92;phi_n' title='&#92;psi_n = &#92;phi_n' class='latex' /></p>
<p>and</p>
<p><img src='https://s0.wp.com/latex.php?latex=J_n+%3D+%5Cdisplaystyle%7B++%5Csum_%7Be%3A+%5C%3B+s%28e%29+%3D+n%7D+I_e+%5C%3B+-+%5C%3B+%5Csum_%7Be%3A+%5C%3B+t%28e%29+%3D+n%7D++I_e+%7D+++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='J_n = &#92;displaystyle{  &#92;sum_{e: &#92;; s(e) = n} I_e &#92;; - &#92;; &#92;sum_{e: &#92;; t(e) = n}  I_e }   ' title='J_n = &#92;displaystyle{  &#92;sum_{e: &#92;; s(e) = n} I_e &#92;; - &#92;; &#92;sum_{e: &#92;; t(e) = n}  I_e }   ' class='latex' /></p>
<p>whenever <img src='https://s0.wp.com/latex.php?latex=n+%5Cin+T%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n &#92;in T,' title='n &#92;in T,' class='latex' /> but also</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+I_e+%3D+%5Cfrac%7B1%7D%7Br_e%7D+%28%5Cphi_%7Bs%28e%29%7D+-+%5Cphi_%7Bt%28e%29%7D%29+%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ I_e = &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) }' title='&#92;displaystyle{ I_e = &#92;frac{1}{r_e} (&#92;phi_{s(e)} - &#92;phi_{t(e)}) }' class='latex' /></p>
<p>for every <img src='https://s0.wp.com/latex.php?latex=e+%5Cin+E%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='e &#92;in E,' title='e &#92;in E,' class='latex' /> and</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B++%5Csum_%7Be%3A+%5C%3B+s%28e%29+%3D+n%7D+I_e+%5C%3B+%3D+%5C%3B+%5Csum_%7Be%3A+%5C%3B+t%28e%29+%3D+n%7D++I_e+%7D+++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{  &#92;sum_{e: &#92;; s(e) = n} I_e &#92;; = &#92;; &#92;sum_{e: &#92;; t(e) = n}  I_e }   ' title='&#92;displaystyle{  &#92;sum_{e: &#92;; s(e) = n} I_e &#92;; = &#92;; &#92;sum_{e: &#92;; t(e) = n}  I_e }   ' class='latex' /></p>
<p>whenever <img src='https://s0.wp.com/latex.php?latex=n+%5Cin+N+-+T.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n &#92;in N - T.' title='n &#92;in N - T.' class='latex' />  (The last two equations combine Kirchoff&#8217;s laws and Ohm&#8217;s law.)</p>
<p>There either exist <img src='https://s0.wp.com/latex.php?latex=I&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='I' title='I' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=%5Cphi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;phi' title='&#92;phi' class='latex' /> making all these equations true, in which case we say our potentials and currents at the terminals obey the relation&#8230; or they <i>don&#8217;t</i> exist, in which case we say the potentials and currents at the terminals <i>don&#8217;t</i> obey the relation.</p>
<p>The relation is clearly linear, since it&#8217;s defined by a bunch of linear equations.  With a little work, we can make it into a linear relation between potentials and currents in</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%5EI+%5Coplus+%5Cmathbb%7BR%7D%5EI&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{R}^I &#92;oplus &#92;mathbb{R}^I' title='&#92;mathbb{R}^I &#92;oplus &#92;mathbb{R}^I' class='latex' /></p>
<p>and potentials and currents in</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%5EO+%5Coplus+%5Cmathbb%7BR%7D%5EO&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{R}^O &#92;oplus &#92;mathbb{R}^O' title='&#92;mathbb{R}^O &#92;oplus &#92;mathbb{R}^O' class='latex' /></p>
<p>Remember, <img src='https://s0.wp.com/latex.php?latex=I&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='I' title='I' class='latex' /> is our set of inputs and <img src='https://s0.wp.com/latex.php?latex=O&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='O' title='O' class='latex' /> is our set of outputs.</p>
<p>In fact, this process of getting a linear relation from a circuit made of resistors defines a functor:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cblacksquare+%3A+%5Cmathrm%7BResCirc%7D+%5Cto+%5Cmathrm%7BLinRel%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;blacksquare : &#92;mathrm{ResCirc} &#92;to &#92;mathrm{LinRel} ' title='&#92;blacksquare : &#92;mathrm{ResCirc} &#92;to &#92;mathrm{LinRel} ' class='latex' /></p>
<p>Here <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BResCirc%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{ResCirc}' title='&#92;mathrm{ResCirc}' class='latex' /> is the category where morphisms are circuits made of resistors, while <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BLinRel%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{LinRel}' title='&#92;mathrm{LinRel}' class='latex' /> is the category where morphisms are linear relations.</p>
<p>More precisely, here is the category <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BResCirc%7D%3A&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{ResCirc}:' title='&#92;mathrm{ResCirc}:' class='latex' /></p>
<p>&bull; an object of <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BResCirc%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{ResCirc}' title='&#92;mathrm{ResCirc}' class='latex' /> is a finite set;</p>
<p>&bull; a morphism from <img src='https://s0.wp.com/latex.php?latex=I&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='I' title='I' class='latex' /> to <img src='https://s0.wp.com/latex.php?latex=O&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='O' title='O' class='latex' />  is an isomorphism class of circuits made of resistors:</p>
<div align="center">
<img width="205" src="https://i2.wp.com/math.ucr.edu/home/baez/networks/cospan.jpg" />
</div>
<p>having <img src='https://s0.wp.com/latex.php?latex=I&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='I' title='I' class='latex' /> as its set of inputs and <img src='https://s0.wp.com/latex.php?latex=O&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='O' title='O' class='latex' /> as its set of outputs;</p>
<p>&bull; we compose morphisms in <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BResCirc%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{ResCirc}' title='&#92;mathrm{ResCirc}' class='latex' /> by composing isomorphism classes of cospans.</p>
<p>(Remember, circuits made of resistors are cospans.  This lets us talk about isomorphisms between them.  If you forget the how isomorphism between cospans work, you can review it in <a href="https://johncarlosbaez.wordpress.com/2014/10/13/network-theory-part-31/">Part 31</a>.)</p>
<p>And here is the category <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BLinRel%7D%3A&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{LinRel}:' title='&#92;mathrm{LinRel}:' class='latex' /></p>
<p>&bull; an object of <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BLinRel%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{LinRel}' title='&#92;mathrm{LinRel}' class='latex' /> is a finite-dimensional real vector space;</p>
<p>&bull; a morphism from <img src='https://s0.wp.com/latex.php?latex=U&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='U' title='U' class='latex' /> to <img src='https://s0.wp.com/latex.php?latex=V&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='V' title='V' class='latex' /> is a <b>linear relation</b> <img src='https://s0.wp.com/latex.php?latex=R+%5Csubseteq+U+%5Ctimes+V%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='R &#92;subseteq U &#92;times V,' title='R &#92;subseteq U &#92;times V,' class='latex' /> meaning a linear subspace of the vector space <img src='https://s0.wp.com/latex.php?latex=U+%5Ctimes+V%3B&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='U &#92;times V;' title='U &#92;times V;' class='latex' /></p>
<p>&bull; we compose a linear relation <img src='https://s0.wp.com/latex.php?latex=R+%5Csubseteq+U+%5Ctimes+V&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='R &#92;subseteq U &#92;times V' title='R &#92;subseteq U &#92;times V' class='latex' /> and a linear relation <img src='https://s0.wp.com/latex.php?latex=S+%5Csubseteq+V+%5Ctimes+W&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S &#92;subseteq V &#92;times W' title='S &#92;subseteq V &#92;times W' class='latex' /> in the usual way we compose relations, getting:</p>
<p><img src='https://s0.wp.com/latex.php?latex=SR+%3D+%5C%7B%28u%2Cw%29+%5Cin+U+%5Ctimes+W+%3A+%5C%3B+%5Cexists+v+%5Cin+V+%5C%3B+%28u%2Cv%29+%5Cin+R+%5Cmathrm%7B%5C%3B+and+%5C%3B%7D+%28v%2Cw%29+%5Cin+S+%5C%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='SR = &#92;{(u,w) &#92;in U &#92;times W : &#92;; &#92;exists v &#92;in V &#92;; (u,v) &#92;in R &#92;mathrm{&#92;; and &#92;;} (v,w) &#92;in S &#92;} ' title='SR = &#92;{(u,w) &#92;in U &#92;times W : &#92;; &#92;exists v &#92;in V &#92;; (u,v) &#92;in R &#92;mathrm{&#92;; and &#92;;} (v,w) &#92;in S &#92;} ' class='latex' /></p>
<h3> Next steps </h3>
<p>So far I&#8217;ve set up most of the necessary background but not precisely defined the black boxing functor</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cblacksquare+%3A+%5Cmathrm%7BResCirc%7D+%5Cto+%5Cmathrm%7BLinRel%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;blacksquare : &#92;mathrm{ResCirc} &#92;to &#92;mathrm{LinRel} ' title='&#92;blacksquare : &#92;mathrm{ResCirc} &#92;to &#92;mathrm{LinRel} ' class='latex' /></p>
<p>There are some nuances I&#8217;ve glossed over, like the difference between inputs and outputs as elements of <img src='https://s0.wp.com/latex.php?latex=I&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='I' title='I' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=O&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='O' title='O' class='latex' /> and their images in <img src='https://s0.wp.com/latex.php?latex=N.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='N.' title='N.' class='latex' />  If you want to see the precise definition and the <i>proof</i> that it&#8217;s a functor, read our paper:</p>
<p>&bull; John Baez and Brendan Fong, <a href="http://math.ucr.edu/home/baez/circuits.pdf">A compositional framework for passive linear networks</a>.</p>
<p>The proof is fairly long: there may be a much quicker one, but at least this one has the virtue of introducing a lot of nice ideas that will be useful elsewhere.</p>
<p>Next time I&#8217;ll define the black box functor more carefully.</p>
]]></html><thumbnail_url><![CDATA[https://i2.wp.com/math.ucr.edu/home/baez/networks/circuit_made_of_resistors.png?fit=440%2C330]]></thumbnail_url><thumbnail_height><![CDATA[250]]></thumbnail_height><thumbnail_width><![CDATA[375]]></thumbnail_width></oembed>