There was recently some discussion about the possibility of adding internal organs to the Noble Apes, for things such as digestion. I thought I’d start with arguably the most important organ after the brain, which is the heart. Without a heart beat not much other physiology would go on, so this seems like a good enough place to begin.
At first I looked at medical simulations of a heart beat. I did a little background reading on “vital signs simulators”, which are typically hand held or oscilloscope-sized electronic devices used for testing medical equipment or on things such as life support machines or the slightly uncanny patient simulators . With their frugal computing resources, such as PICs or other low power embedded computers they probably have a quite efficient set of equations for simulating heart beats under a wide variety of test scenarios. I also looked at an open source (GPL licensed) simulator called ECGSYN. ECGSYN produces a fairly realistic output, but is mathematically quite complex (with an inverse Fourier transform) and uses a lot of floating point arithmetic. There’s also the problem that to be able to simulate something like this the update rate has to be in the order of less than a second, and the current temporal resolution of Noble Ape is only 1 minute per time step.
With a low temporal resolution a heart beat could still be simulated, but only as an average value. There is however a lot of other bio-machinery attached to the heart which also could be simulated, and that is the vascular system which connects the central pump to all of the other organs. Simulations of this type seem to be quite scarce, but I did find a paper called “Simulating of Human Cardiovascular System and Blood Vessel Obstruction Using Lumped Method” which seemed simple enough and sufficiently documented to be implementable within a small amount of computing time, such that it could scale up to many apes. This model is based on an electrical analog of the vascular system. People teaching electronics often provide an analogy of pipes, reservoirs and valves, and this is the opposite of that. The flow of blood becomes equivalent to the flow of electrons through wires, such that the usual electronic circuit equations apply. Using this model it would be possible to construct a physical circuit which can be used to simulate a variety of medical situations, and without using any computing at all in a similar style to the early cybernetics models of economies or companies.
The vascular system isn’t just a set of tubes and valves. Instead it’s a dynamic system which is under neural (although unconscious) control, and mediated by a variety of neurotransmitters. Parts of the system can contract or dilate under different conditions to optimize the body for certain kinds of performance, with two major modes of “fight or flight” or “rest and digest”.
The implementation is currently at an early stage, and doesn’t do anything very exciting yet. It may be switched on or off using the VASCULAR_ON define. The aims are:
- To simulate the response of the sympathetic/parasympathetic nervous system.
- Vasoconstriction in cold climates, vasodilation in warmer ones.
- Homeostasis to try to maintain internal pressure/temperature.
- Simulate various illnesses, such as a heart attack, narrowed arteries or wounds after a fight.
- Link the neural control of vessel radius/elasticity to genetics factors.
- Calculate an amount of energy available to the digestive system (not yet implemented), based upon blood flow to the gut. This might mean that the energy resolution needs to be higher than it currently is (somewhere between 0-3000).
- Some sort of visualisation which could be saved as an image or maybe viewed in the GUI.
If the temporal resolution of the simulation was higher it would also be possible to see pressure waves due to the heart beat, and possibly resonances based on that.