I want to use Mathematica to model blood flow through a capillary network. The approach we are using is going to be to create a directed graph, and have a system of differential equations at each vertex, depending on the previous vertices as inputs.

Currently, I just want to get a basic model working, where I have an input at one end of the graph, output at the other end, and at a vertex where the graph splits, half of the flow goes to the top and half to the bottom. For example, in this graph:

GraphPlot[{1 -> 2, 2 -> 3, 2 -> 4, 3 -> 5, 4 -> 5, 5 -> 6}, 
           DirectedEdges -> True, VertexLabeling -> True]

I would say u[t] is the concentration (parts per million) of something in the blood at time t. Each vertex has it's own equation where

 u'[t] == input[t] - output[t]

At vertex 2, half the output goes to vertex 3, half goes to 4, etc.

I have no idea how to get started implementing this, can anyone point me in the right direction?


Not sure if this is what you're after.

The following is the steady state supposing null divergences except at the source:

g = DirectedGraph[CompleteGraph[5], "Acyclic", VertexLabels -> "Name"]

Mathematica graphics

in[n_] := Tr[v[#]/VertexOutDegree[g, #]  & /@ Complement[VertexInComponent[g, n, 1], {n}]]

Solve[Join[{v[1] == 1}, Table[v[n] == in[n], {n, 2, Length@VertexList@g}]]]

(* {{v[1] -> 1, v[2] -> 1/4, v[3] -> 1/3, v[4] -> 1/2, v[5] -> 1}} *)
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.