0 votes
by (120 points)

Hi everyone,

I'm new to OpenCARP and having trouble getting stimulus to work in my simulations. I'm using the Docker version (git hash 4f19932) on Mac.

My simulation runs fine - the mesh loads, the Tomek model works, everything completes without errors. But the tissue never gets stimulated. When I check the Stimulus_0.trc file, it shows 0.000 nodes selected every time.

I've tried several approaches:

First attempt - geometric stimulus using x0, xd, y0, yd parameters to define a box on the left side of my tissue. I made sure the coordinates overlap with actual nodes in my mesh, but still 0 nodes selected.

Second attempt - made the stimulus box much bigger to cover the entire left side. Still nothing.

Third attempt - created an explicit vertex file (left_stim.vtx) with 84 specific node numbers and used stimtype 1. The file format looks correct (first line is the count, then one node index per line). Still 0 nodes.

Fourth attempt - tried changing my mesh element regions from 1 to 0 in case there was a mismatch. No difference.

The weird thing is there's no error message - the simulation just runs and ignores the stimulus completely. The electrics.log file doesn't even mention stimulus initialization.

My mesh is a 2D triangular mesh with 1038 nodes and 1804 elements. Here's a typical command I'm using:

openCARP -meshname mesh_name -simID test -tend 100 -dt 0.02 
-parab_solve 1 -num_imp_regions 1 -imp_region[0].im Tomek 
-imp_region[0].num_IDs 1 -imp_region[0].ID[0] 0 
-num_stim 1 -stimulus[0].stimtype 1 
-stimulus[0].vtx_file left_stim.vtx 
-stimulus[0].strength -80.0 -stimulus[0].duration 2.0 
-stimulus[0].start 10.0 -bidomain 0

Is there something obvious I'm missing? Or is there a known issue with stimulus in this Docker version? Any suggestions would be really helpful - I've been stuck on this for a while!

Thanks in advance for any help!

1 Answer

0 votes
ago by (1.5k points)

Hey,

without having all the details of what you tried, I can try to address some common pitfalls I've came across myself with setting stimuli:

I've noticed you use the old stimulus parameter. This is a legacy parameter and only supported for backward compatibility. Please use the up to date stim convention.

When I check the Stimulus_0.trc file, it shows 0.000 nodes selected every time.

The trace file Stimulus_0.trc does not show you the selected nodes. It contains the waveform function of the chosen stimulus, i.e. its combinations of time and normalized amplitude. This function is later multiplied by stim.strength at corresponding time-steps. If you want to see the selected nodes, use the parameter stim[0].elec.dump_vtx_file 1, which will create a .vtx file containing the node IDs of the stimulus.

First attempt - geometric stimulus using x0, xd, y0, yd parameters to define a box on the left side of my tissue. I made sure the coordinates overlap with actual nodes in my mesh, but still 0 nodes selected.

For geometric definitions, it is important to get all the associated parameters correct for the shape you are using, e.g. for a block you need to make sure to have p0 defined as the lower left corner and p1 as the upper right corner. If you mix this up, you might end up with a block definition that doesn't catch the desired points.

Why your stimulus is not working:

You are defining an extracellular current stimulus (type = 1) in a monodomain simulation. This is not possible, since there is no extracellular domain defined in monodomain setups. Use a transmembrane current (type = 0) instead.

Welcome to openCARP Q&A. Ask questions and receive answers from other members of the community. For best support, please use appropriate TAGS!
architecture, carputils, documentation, experiments, installation-containers-packages, limpet, slimfem, website, governance
...