Hemodynamic Simulations Workbench:
An Open-Source JavaScript Framework for Pulmonary Artery Pressure Modeling

This workbench delivers an intuitive, browser-based environment for simulating pulmonary artery pressure (PAP) models, turning intricate hemodynamic equations into interactive visualizations. Built entirely in JavaScript and released as open source, it lets clinicians and researchers adjust model coefficients in real time and immediately see the impact on predicted PAP, thereby bridging the gap between theoretical hemodynamics and bedside decision-making. By prioritizing clarity, ease of use, and community extensibility, the platform embodies George Box’s reminder that “all models are wrong, but some are useful,” providing a practical tool that makes complex vascular dynamics both accessible and clinically meaningful.


Graph vs Simulation: Why Simulations Are Essential for Hemodynamic Research

Traditional graph drawing, while effective in providing a clear visual representation of data, often falls short in addressing the dynamic and complex nature inherent in systems like hemodynamics. This is precisely where the power of simulations, especially hemodynamic models, becomes evident. Unlike static graphs, which display a fixed dataset, simulations of hemodynamic models offer a dynamic platform that enables researchers to interact with the model, adjust parameters, and observe how these changes influence the system in real-time. This level of interactivity is pivotal for understanding the impact of various physiological conditions on blood flow and heart function, offering insights that are both detailed and predictive.

Simulations excel in their predictive capabilities, allowing researchers to forecast cardiovascular behaviors under conditions that have not been previously observed. This is particularly invaluable in medical fields, where accurately predicting outcomes can guide the planning of surgical interventions or the design of therapeutic devices. Moreover, hemodynamic simulations can integrate complex fluid dynamics and biological interactions through advanced computational methods, providing a depth of realism and detail far surpassing what can be achieved through simple graph drawing. This includes modeling responses to physical activities, drug interactions, or therapeutic measures, thereby not only describing but also predicting physiological responses.

The interactivity offered by simulations supports experimental design and testing within a controlled virtual environment, which can dramatically reduce the costs, time, and ethical concerns associated with direct physical experimentation. In contrast, traditional graphs, once created, do not allow for modifications to test different scenarios or predict the outcomes of variable changes, limiting their utility in dynamic and complex areas such as cardiovascular health.

Adding to the clinical relevance, hemodynamic models help bridge the gap between clinical issues and theoretical models through effective visualization. For instance, the development of logistic-based equations for estimating Pulmonary Artery Pressure (PAP), based on hemodynamic models (Frank, 2018), illustrates how simulations can turn complex equations into accessible insights for clinicians. Such tools are essential not only for their ability to simulate but also for their user-friendliness in allowing clinicians to derive meaningful interpretations from complex data. Therefore, while traditional graph drawing remains useful for straightforward presentations, simulations are indispensable for deeper understanding, innovation, and advancement in dynamic and complex fields like hemodynamics, enhancing both the exploration and explanation of intricate medical phenomena.



Browser Cache Refresh & DevTools Shortcuts



Table of Contents
nGeneHS (Hemodynamic Simulation):

nGeneHS.js: A Base JavaScriptv Class for Hemodynamic Simulation Development

nGeneHS_LBSM.js: Class Inheritance for LBSM (Roh, 2018)

nGeneHS_deLavalNozzle.js: Class Inheritance for Nozzle Model


Debugging Notes:

Practical notes on the fully-working nGeneHS_LBSM.html (Written June 10, 2025)


Source Codes:

BASE: nGeneHS.js


LBSM: nGeneHS_LBSM.js


Nozzle: nGeneHS_deLavalNozzle.js


Debugging Notes


Practical notes on the fully-working nGeneHS_LBSM.html (Written June 10, 2025)

A concise record is presented below to recall the minor HTML-only tweaks that remove console warnings, keep the visible interface unchanged, and guarantee automatic start-up of the LBSM simulation.

Main achievements

Hidden helpers added

The base class looks for two “Test Slope” sliders and one demo button. Silent placeholders were therefore inserted:

All reside in a single wrapper block set to display:none.

Console messages explained

Console output Underlying cause How the revised file fixes it
Slider element with key scaleTestSlope1/2 not found The base class always queries two demo sliders. Hidden sliders + outputs are provided.
testButton_method1 not found A demo button is assumed to exist. A hidden button with that ID is inserted.
Uncaught TypeError ... addEventListener Because the missing sliders were null, wiring listeners failed. The placeholders ensure each call receives a valid node.
Removing unpermitted intrinsics Message from lockdown-install.js; not an error. No action required.

Sequence of events on page load

  1. The DOM finishes parsing.
  2. An nGeneHS_LBSM instance is created.
  3. The PNG background loads and triggers a load event.
  4. refreshSimulation() clears the canvas, redraws the grid, paints the PNG, and re-plots the yellow and blue traces above the image.

Outcome

No warnings appear, the simulation starts automatically, traces remain visible, and manual re-runs continue to function through the existing “Run Simulation” button.

Written on June 10, 2025


Hemodynamic Simulation Source Code

nGeneHS.js


nGeneHS_LBSM.js


nGeneHS_deLavalNozzle.js


Back to Top