Skip to content

Simulation of the effects of acidosis in phase 1A ischemia by Maleckar's human atrial cardiomyocyte model. A cellular level study.

License

Notifications You must be signed in to change notification settings

simosgorby/AcidoCardioSim

Repository files navigation

AcidoCardioSim

Electrophysiology simulations of a cardiac atrial cell (Maleckar model) with acidosis modulation (pH variation) affecting ionic currents and action potential dynamics. The project is designed to study transient and steady-state behavior of state variables, currents, conductances, and AP metrics under healthy and acidotic conditions.

Key Features

  • Maleckar atrial cell model simulation in MATLAB
  • pH profile: fixed or linearly decreasing over time (ischemia phase 1A)
  • Automatic plots of 30 state variables and ionic species
  • Extraction and visualization of currents (i_Na, i_CaL, i_NaCa ...), apparent conductances, and Nernst potentials
  • Metrics computation: Vrest, Vpp, dV/dt_max, APD90, APD50, TRI, DI
  • Restitution curves (APD–DI) across different BCLs
  • AP shape video over time (plot_video.mp4)

AP Media (Ischemia 1A, decreasing pH)

Animated visualization of the action potential (AP) morphology as extracellular pH decreases from ≈7.2 to ≈6.2 (ischemia phase 1A). Each trace corresponds to the last beat of successive minutes during the protocol. Notice the progressive reduction of upstroke velocity (dV/dt_max) and peak-to-peak amplitude (Vpp), the shortening of AP duration (APD), increased triangulation (TRI), and a gradual shift in the resting potential. Important: after 10 minutes, Delayed After Depolarizations (DADs) start to appear!

AP acidosis (GIF)

Figures

Acidosis Mechanism — Main Players

Schematic of the main processes modulated by extracellular acidosis during ischemia 1A: reduced sodium current (i_Na) and L-type calcium current (i_CaL), altered Na–Ca exchanger (i_NaCa), and consequent shifts in Nernst potentials and buffering. Together, these changes reduce upstroke velocity and peak amplitude, shorten AP duration, and increase triangulation.

Acidosis players

State Variables Overview (SV1–SV30)

Overview panel of all 30 state variables tracked by the model across the simulation, covering ionic concentrations, gating variables, SR handling, and buffering dynamics.

State Variables (SV)

Prerequisites

  • MATLAB R2019b or newer (R2021a+ recommended)
  • Platform: macOS (tested; VideoWriter with MPEG-4 works)
  • No extra toolboxes required

Project Structure

  • driver.m: main simulation and plotting script
  • maleckar_main.m: orchestrates numerical integration and settings (returns StateControl, TiControl, Ns, pH, extra_var)
  • maleckarnorm.m: Maleckar model dynamics + pH modulation, currents, and extra variables

Quick Start

  1. Open MATLAB and set the project folder as the current directory.
  2. Run:
    driver
  3. The script will generate plots of state variables, ionic species, currents/conductances, and metrics. If enabled, a video (plot_video.mp4) is also saved.

Headless run from macOS terminal (if MATLAB is on PATH):

matlab -batch "driver"

Configuration (settings)

Main options are defined at the top of driver.m. Default example:

  • settings.BCL = 800; stimulation period [ms]
  • settings.TSim = 900000; simulation duration [ms] (15 min)
  • settings.NumStim = floor(settings.TSim / settings.BCL); number of stimuli
  • settings.storeLast = settings.NumStim; store the last beat of each stimulation series
  • settings.pH_status = 1; 1 = decreasing pH; 0 = fixed pH
  • settings.saving_status = 0; control intermediate saving

Additional model options (typically in maleckar_main.m):

  • settings.StimOffset [ms]: stimulus onset
  • settings.Dur_stim [ms]: stimulus duration
  • settings.Amp_stim [pA/pF]: stimulus amplitude
  • settings.Ca_o, settings.K_o, settings.Na_o [mM]: extracellular reference concentrations

pH modulations applied in maleckarnorm.m:

  • f_pH_Na = 0.5*pH - 2.6 → scales i_Na and g_Na_max
  • f_pH_CaL = 0.5*pH - 2.6 → scales i_Ca_L and g_Ca_L_max
  • f_pH_NaCa = 0.9*pH - 5.48 → scales i_NaCa

With settings.pH_status = 1, pH decreases linearly from 7.2 to ~6.2 across the simulated horizon (depending on NumStim). With settings.pH_status = 0, pH remains fixed.

Main Outputs

  • pH vs time (min)
  • Jacobian sparsity and conditioning (if calculate_eigenvalues_jacobian is available)
  • Subplots of the 30 state variables over the entire simulation
  • Intracellular species comparison: Na_i, K_i, Ca_i
  • Single-variable trace (default V), selectable from a list
  • Currents: i_Na, i_Ca_L, i_NaCa (extensible)
  • Apparent conductances: e.g., g_Na = i_Na/(V-E_Na), g_CaL = i_CaL/(V-E_Ca)
  • AP video over time: plot_video.mp4
  • Metrics over time: Vrest, Vpp, dV/dt_max, APD90, APD50, TRI, and restitution curve (APD–DI)

Metrics & Definitions

  • Vrest: resting membrane potential
  • Vmax: AP peak
  • Vpp: peak-to-peak amplitude
  • dV/dt_max: maximum upstroke velocity
  • APD50, APD90: AP duration at 50% and 90% repolarization
  • TRI: triangulation, TRI = APD90 - APD50
  • CI: coupling interval, CI = BCL
  • DI: diastolic interval, DI = CI - APD90

Study Examples

  • BCL variation and restitution curve: blocks in driver.m sweep BCL and plot APD90 vs DI.
  • AP comparison between start (pH ≈ 7.2) and end (pH ≈ 6.2) of the simulation.
  • Percentage change of metrics vs acidosis progression.

Practical Tips

  • Reduce settings.TSim for quick tests (e.g., 60000 ms = 1 min)
  • For numerical stability, check stimulus parameters (Amp_stim, Dur_stim, StimOffset)
  • On macOS, VideoWriter('MPEG-4') relies on system codecs (available by default)

Troubleshooting

  • Error on calculate_eigenvalues_jacobian: ensure the function exists in your MATLAB path; otherwise comment out the related lines in driver.m.
  • Slow execution: decrease TSim, increase BCL, or disable non-essential plotting sections.
  • Video not generated: check write permissions and MPEG-4 support on MATLAB/macOS.
  • Units mismatch: units are indicated in plot titles/axes; refer to names_sv/units_sv in driver.m.

References & Credits

  • Cell model: Maleckar et al. (atrial cell; MATLAB implementation derived from CellML conversion)
  • CellML → MATLAB conversion: COR (Dr Alan Garny)
  • Adaptations: pH modulation on i_Na, i_CaL, i_NaCa and extra variables

License

Licensed under the MIT License. See LICENSE for details.

About

Simulation of the effects of acidosis in phase 1A ischemia by Maleckar's human atrial cardiomyocyte model. A cellular level study.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages