""" Simulation eines simplen Blutkreislaufs des menschlichen Koerpers """ from __future__ import print_function import os from compartments import Vorhof, Artery, CompartmentSet, Herzkammer, TerminalVessel from subprocess import Popen, PIPE tIntegration = 4.0 # integration end time tEinschwing = 2. dt = 0.01 # time step size # generate one heart to be connected to multiple cycles theHeart = [Vorhof(), Herzkammer()] theHeart[0].addNeighbour(theHeart[1]) # create a list of blood circuits, each sharing the same heart compartments = [] compartments += theHeart numberOfCircuits = 2 for i in range(numberOfCircuits): # create a new circuit newCircuit = [Artery(), TerminalVessel(), Artery()] # add to list of all compartments compartments += newCircuit # connect as a ring theHeart[1].addNeighbour(newCircuit[0]) newCircuit[0].addNeighbour(newCircuit[1]) newCircuit[1].addNeighbour(newCircuit[2])
""" from __future__ import print_function import os from compartments import Vorhof, Artery, CompartmentSet from subprocess import Popen, PIPE tIntegration = 1.0 # integration end time tEinschwing = 0. dt = 0.01 # time step size # generate a line of connected compartments compartments = [ Artery(Q1=0.0003), # eine Arterie mit einer Quelle links Artery(), Vorhof(C=Artery().C), # eine Klappe ohne Vorhof Compliance Artery(), Artery() ] # connect as a ring compartments[0].addNeighbour(compartments[1]) compartments[1].addNeighbour(compartments[2]) compartments[2].addNeighbour(compartments[3]) compartments[3].addNeighbour(compartments[4]) # compartments[4].addNeighbour(compartments[0]) system = CompartmentSet(*compartments) # integration and output if not os.path.exists('out'): os.makedirs('out')
from __future__ import print_function import os from compartments import Herzkammer, Vorhof, Artery, TerminalVessel, CompartmentSet from subprocess import Popen, PIPE tIntegration = 4.0 # integration end time tEinschwing = 10. dt = 0.01 # time step size # generate a ring of connected compartments compartments = [ Vorhof( C=0.0001, P1=10000., P2=10000., Q1=0.0, Q2=0.0 ), Herzkammer( C=0.0000002, P1=10000., P2=10000., Q1=0.0, Q2=0.0 ), Artery( R=1000000., L=300., C=0.0000001, P1=10000.,
""" Simulation eines simplen Blutkreislaufs des menschlichen Koerpers """ from __future__ import print_function import os from compartments import Herzkammer, Vorhof, Artery, TerminalVessel, CompartmentSet from subprocess import Popen, PIPE tIntegration = 4.0 # integration end time tEinschwing = 16. dt = 0.01 # time step size # generate a ring of connected compartments compartments = [ Vorhof(C=0.000005), Herzkammer(C=0.0000001), Artery(R=100000., L=300., C=0.0000001), TerminalVessel(R=10000000., C=0.000001), Artery(R=100000., L=300., C=0.0000001) ] # connect as a ring compartments[0].addNeighbour(compartments[1]) compartments[1].addNeighbour(compartments[2]) compartments[2].addNeighbour(compartments[3]) compartments[3].addNeighbour(compartments[4]) compartments[4].addNeighbour(compartments[0]) system = CompartmentSet(*compartments) # integration and output