right_atrial_compliance = 75
INIT Right_Artrial_Volume_Vra = 1000
unstressed_right_atrial_volume = 700
intrapleural_pressure = 4
Right_Artrial_Presure_Pra = (1/right_atrial_compliance)*(Right_Artrial_Volume_Vra-
unstressed_right_atrial_volume)-intrapleural_pressure
venous_compliance = 150
INIT Venous_Volume_VV = 3000
venous_unstressed_volume = 2450
Venous_Pressure_Pv = (1/venous_compliance)*(Venous_Volume_VV-venous_unstressed_volume)
venous_resistance = 0.0014
arterial_compliance = 1.5
INIT Arterial_Volume_Va = 1000
arterial_unstressed_volume = 350
Arterial_pressure_Pa = (1/arterial_compliance)*(Arterial_Volume_Va-arterial_unstressed_volume)
Flow_of_peripheral_return_Fp = (Arterial_pressure_Pa-Venous_Pressure_Pv)/.0186
venous_return_Fvr = (Venous_Pressure_Pv-Right_Artrial_Presure_Pra)/venous_resistance
Flow_of_Cardiac_Output_Fco = IF(Right_Artrial_Presure_Pra>=6) THEN(12500) ELSE(1250*(Right_Artrial_Presure_Pra+4))
Right_Artrial_Volume_Vra(t) = Right_Artrial_Volume_Vra(t - dt) + (venous_return_Fvr - Flow_of_Cardiac_Output_Fco) * dt
Venous_Volume_VV(t) = Venous_Volume_VV(t - dt) +
(Flow_of_peripheral_return_Fp - venous_return_Fvr) * dt
Arterial_Volume_Va(t) = Arterial_Volume_Va(t - dt) +
(Flow_of_Cardiac_Output_Fco - Flow_of_peripheral_return_Fp) * dt
Right_Artrial_Presure_Pra = (1/right_atrial_compliance)*(Right_Artrial_Volume_Vra-
unstressed_right_atrial_volume)-intrapleural_pressure
Venous_Pressure_Pv = (1/venous_compliance)*(Venous_Volume_VV-venous_unstressed_volume)
Arterial_pressure_Pa = (1/arterial_compliance)*(Arterial_Volume_Va-arterial_unstressed_volume)
Flow_of_peripheral_return_Fp = (Arterial_pressure_Pa-Venous_Pressure_Pv)/.0186
venous_return_Fvr = (Venous_Pressure_Pv-Right_Artrial_Presure_Pra)/venous_resistance
Flow_of_Cardiac_Output_Fco = IF(Right_Artrial_Presure_Pra>=6) THEN(12500) ELSE(1250*(Right_Artrial_Presure_Pra+4))