Implementing arythmia patterns


I wish to implement new “states” for the engine as to simulate a variety of arythmic cardiac patterns. I am wondering if you might have advise or guidance on how to go about that? where to look? where to start? Does it already exists and I just missed it?

Here is what I understood so far:

  • I think I will have to download the c++ source code, add my stuff and compile it again.
  • I will have to add some “cases” into the C# project in unity in order to find them.

I am not sure to understand fully how the changes on the curves are applied and would like to understand the philosophy and architecture of the engine before going into “details”.

ofc I would like to contribute and publish this on your rep if you allow me and would do my best to comply to your “standards”.

Oh, and the project I work on runs in unity.

While looking forward for getting an answer I wish you all the best!

Here are the arythmias we would like to use:

  1. Sinus dysrhythmia;
  2. Sinus pause;
  3. Premature atrial contraction (PAC);
  4. Wolf-Parkinson-White
  5. Atrial ectopic tachycardia
  6. Atrial fibrillation
  7. Atrial flutter;
  8. Supraventricular tachycardia;
  9. Junctional rythme;
  10. Junctional tachycardia;
  11. AV blocks (1st degree, 2nd degree (type 1 and 2), 3rd degree)
  12. Premature ventricular contraction (PVC)
  13. Torsade de pointes
  14. accelerated idioventricular rythme
  15. accelerated jonctionnal rythme

Our current supported arrhythmia’s are

enum eHeartRhythm
  NormalSinus                      = 0; /**<< @brief Normal electical signal and mechanical function. */ 
  SinusBradycardia                 = 1; /**<< @brief Normal electical signal with reduced heart rate.   */
  SinusTachycardia                 = 2; /**<< @brief Normal electical signal and increased heart rate.  */
  SinusPulselessElectricalActivity = 3; /**<< @brief Electical signal, but no mechanical function. */
  Asystole                         = 4; /**<< @brief No electrical signal or mechanical function. */
  CoarseVentricularFibrillation    = 5; /**<< @brief No organized electrical signal, no mechanical function. */
  FineVentricularFibrillation      = 6; /**<< @brief No organized electrical signal, reduced amplitude compared to coarse VF, no mechanical function. */
  PulselessVentricularTachycardia  = 7; /**<< @brief Normal electical signal with reduced amplitude, but no mechanical function. */
  StableVentricularTachycardia     = 8; /**<< @brief Ventricular tachycardia electrical signal with increased heart rate.  */
  UnstableVentricularTachycardia   = 9; /**<< @brief Ventricular tachycardia electrical signal with increased heart rate, reduced heart elastance. */


  1. You will need to do a literature search and find citations in papers describing how this new arrhythmia affects the physiology
    (Does it increase\decrease blood pressures\heart rates? and by how much 2x/3x etc.)

  2. Implement those changes here
    Depending on what the literature says, we may need to add logic in other places in the code

  3. Provide an ECG wavefrom associated with that arrhythmia.
    This would be an array of mV for one cardiac cycle of the arrhythmia.
    So you would need to find and digitize a single cardiac cycle of your new arrhythmia
    You can see that data on the ECG tab of our data.xls
    Then associate an ecg waveform with one or more arrhythmias

From there, there are more things to do, but at a high level, that’s the process


Some guidance on code contribution can be found in our wiki here.

You would be extending the Arrhythmia action.

If you would like to discuss this, we would be happy to have a quick call to give some guidance. You are welcome to email me at to set up a time to talk.