# Exercise issue in Java

**URL:** https://discourse.kitware.com/t/exercise-issue-in-java/617
**Category:** Pulse Physiology Engine
**Created:** [March 15, 2021, 4:25pm UTC](https://discourse.kitware.com/t/exercise-issue-in-java/617 "2021-03-15T16:25:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bob.marinier](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@bob.marinier](https://discourse.kitware.com/u/bob.marinier)
#### Post date: [March 15, 2021, 4:25pm UTC](https://discourse.kitware.com/t/exercise-issue-in-java/617/1 "2021-03-15T16:25:45Z")

</div>

I’m trying to re-create a version of the HowTo-Exercise scenario from the C++ examples in Java. In my version, I’m using the soldier@0.json state file and I’m letting it run longer (because I’m hoping to see a complete recovery of vitals back to baseline). I start with an exercise action at 0.5 intensity at time 0, and at time 30 seconds I put in a new exercise action with intensity 0. I’m using the REL\_3\_1\_0 tag on Windows 10 with Java 11.

What I see is that the vitals increase a lot in the first 30 seconds, with the heart rate holding steady at 187.5. At 30 seconds the second exercise action goes in, and at 32 seconds the heart rate goes up to 200. It stays there until just after 92 seconds, when I get the errors below.

Thoughts?

```auto
[INFO] [2021-03-15 12:11:11,127] [pool-2-thread-1] [CppPulseEngine] : [92.4(s)] [Event] 92.4(s), Patient no longer has Tachycardia
FATAL:Can't transport with a negative volume included. Node = LeftHeart. Volume = -634.644 mL : 
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] FATAL: : [92.62(s)] Can't transport with a negative volume included. Node = LeftHeart. Volume = -634.644 mL
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-6.95012 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Nitrogen
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateConcentration: Concentration is negative:-6.95012 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Nitrogen
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-69.8117 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Oxygen
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateConcentration: Concentration is negative:-69.8117 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Oxygen
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-613.495 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : CarbonDioxide
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateConcentration: Concentration is negative:-613.495 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : CarbonDioxide
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-38065.8 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Hemoglobin
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-44596.6 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Oxyhemoglobin
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-1454.7 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Carbaminohemoglobin
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-1457.58 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,150] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : OxyCarbaminohemoglobin
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-54.1451 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Bicarbonate
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-0.000190452 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Epinephrine
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-4.50562 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Acetoacetate
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-20667.3 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Albumin
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-26.8978 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Calcium
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-2018.9 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Chloride
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-6.73218 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Creatinine
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-231.03 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Glucose
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-7.09327e-05 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Insulin
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-83.6564 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Lactate
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-87.3227 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Potassium
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-1863.64 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Sodium
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-553.785 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Tristearin
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Mass is negative:-133.935 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] GeneralMath::CalculateMass: Volume is negative:-634.644 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,152] [pool-2-thread-1] [CppPulseEngine] : [92.62(s)] Compartment : LeftHeart, Substance : Urea
FATAL:Can't transport with a negative volume included. Node = RightHeart. Volume = -9071.75 mL : 
[ERROR] [2021-03-15 12:11:11,155] [pool-2-thread-1] [CppPulseEngine] FATAL: : [92.64(s)] Can't transport with a negative volume included. Node = RightHeart. Volume = -9071.75 mL
FATAL:Can't transport with a negative volume included. Node = LeftHeart. Volume = -636.316 mL : 
[ERROR] [2021-03-15 12:11:11,155] [pool-2-thread-1] [CppPulseEngine] FATAL: : [92.64(s)] Can't transport with a negative volume included. Node = LeftHeart. Volume = -636.316 mL
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-0.583543 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Nitrogen
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateConcentration: Concentration is negative:-0.583543 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Nitrogen
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-3.50652 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Oxygen
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateConcentration: Concentration is negative:-3.50652 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Oxygen
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-62.3257 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : CarbonDioxide
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateConcentration: Concentration is negative:-62.3257 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : CarbonDioxide
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-6887.39 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Hemoglobin
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-229.929 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Oxyhemoglobin
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-154.937 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Carbaminohemoglobin
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-155.244 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : OxyCarbaminohemoglobin
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-3.85961 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Bicarbonate
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-1.6009e-05 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Epinephrine
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-0.389782 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Acetoacetate
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-1795.51 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Albumin
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-2.33713 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Calcium
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-175.385 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Chloride
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-0.585886 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Creatinine
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-19.9587 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Glucose
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-5.60132e-06 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Insulin
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-7.2914 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Lactate
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-7.58587 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Potassium
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-161.957 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Sodium
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-48.0871 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Tristearin
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-11.6528 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-9071.75 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightHeart, Substance : Urea
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-0.0351453 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightPulmonaryArteries, Substance : Oxygen
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateConcentration: Concentration is negative:-0.0351453 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : RightPulmonaryArteries, Substance : Oxygen
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-0.00147587 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-636.316 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : LeftHeart, Substance : Nitrogen
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateConcentration: Concentration is negative:-0.00147587 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : LeftHeart, Substance : Nitrogen
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Mass is negative:-0.000316409 ug/mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] GeneralMath::CalculateMass: Volume is negative:-636.316 mL. Setting it to 0.
[ERROR] [2021-03-15 12:11:11,156] [pool-2-thread-1] [CppPulseEngine] : [92.64(s)] Compartment : LeftHeart, Substance : Oxygen

(cutoff due to limits on size of a posting on this board)

```

---

<div class="post-metadata">

### Author: ![bob.marinier](https://discourse.kitware.com/letter_avatar_proxy/v4/letter/b/7ab992/32.png) [@bob.marinier](https://discourse.kitware.com/u/bob.marinier)
#### Post date: [March 15, 2021, 4:29pm UTC](https://discourse.kitware.com/t/exercise-issue-in-java/617/2 "2021-03-15T16:29:53Z")

</div>

FYI, if I use an intensity of 0.2, then it seems to recover just fine and there are no errors.

---

<div class="post-metadata">

### Author: ![abray](https://discourse.kitware.com/user_avatar/discourse.kitware.com/abray/32/12_2.png) [@abray](https://discourse.kitware.com/u/abray)
#### Post date: [March 15, 2021, 5:36pm UTC](https://discourse.kitware.com/t/exercise-issue-in-java/617/3 "2021-03-15T17:36:53Z")

</div>

Exercise is a weird action in that the action is an intensity, not a severity, which is not as intuitive as others

Check out this post:

> [@Problems on energy system. How to set correct intensity for an activity performed by different patients?](https://discourse.kitware.com/t/problems-on-energy-system-how-to-set-correct-intensity-for-an-activity-performed-by-different-patients/357):
>
> Hello, I am learning the energy system. I don’t know how to set correct intensity for different activities performed by different patients. The average adult male has a maximal work rate of 1200W, according to the documentation in [https://physiology.kitware.com/\_energy\_methodology.html](https://physiology.kitware.com/_energy_methodology.html). Can Pulse calculate the maximal work rate depending on different patients? I think an old male has a less maximal work rate. How to get a maximal work rate corresponding to a specific patient? I check some…

Check out our [Exercise stages](https://gitlab.kitware.com/physiology/engine/-/blob/master/data/human/adult/scenarios/energyenvironment/ExerciseStages.json), where we are going from an intensity of `0.0375`, to `0.075`, to `0.1583`

And our VO2max scenario uses `0.3583`

Again, this intensity is not as linear as our other severity based actions

---

<div class="post-metadata">

### Author: ![hamblingreg52](https://discourse.kitware.com/user_avatar/discourse.kitware.com/hamblingreg52/32/399_2.png) [@hamblingreg52](https://discourse.kitware.com/u/hamblingreg52)
#### Post date: [April 21, 2021, 7:03am UTC](https://discourse.kitware.com/t/exercise-issue-in-java/617/4 "2021-04-21T07:03:30Z")

</div>

@bob.marinier I think you have done wonderful job. I also try to make it but all in wane. Keep on bro it will help you. 🙂
