Professional Documents
Culture Documents
ü Code follows
itrbc@8r0_, m0_<, 8c_, f_, g_, γ_<D := K O.8r0, m0< + 80, c<
1−f 1
In[2]:=
γfg 1−g
H∗ returns the asymptotic count of rbcs for the whole day Hr+μL ∗L
c H1 + fL
In[3]:=
f g H1 − γL
asymptrbc@c_, f_, g_, γ_D :=
<,
H∗ Plotting particles ∗L
Show@
If@agents ≠ 8<,
Style@
Point ê@ agentsMoved,
Point@8− 1, − 1<D
D,
Antialiasing → TrueD
<,
ImageSize → 8350, 350<,
AspectRatio → Automatic,
Frame → False,
Axes → False,
PlotRange → 880, 1<, 80, 1<<,
Background → RGBColor@0.25, 0, 0D
D
D
D
2 023-rbc-homeostatic-simulation.nb
<,
8<,
If@elements ≠ 0,
H∗ there's something to do ∗L
If@elements > 0,
H∗ add ∗L
agents ∼ Join ∼ Table@RandomReal@80.1, 0.9<, 2D, 8elements<D,
H∗ remove ∗L
D,
Drop@agents, elementsD
D
agents
D
D
023-rbc-homeostatic-simulation.nb 3
simulation = Deploy@Module@
8moving = False,
In[8]:=
H∗ Style@"Working!",RGBColor@RandomReal@80.5,1<D,0,0DD ∗L
visualize@agents, 0.01D
TrackedSymbols → 8c<,
,
8<,
,
8"Parameters"<,
8
asympt = 100;
cellcount = 99; cellspeed = 0;
c = 2; f = 0.5; g = 0.15; γ = 0.6;
newcells = 0;
agents = initializeAgents@99D;
D<<D<
<
D
H∗ Options ∗L
D
D
D;
ü Simulation only
In[9]:= simulation
023-rbc-homeostatic-simulation.nb 5
Out[9]=
c 2
f 0.5
g 0.15
g 0.6
Run Simulation