Creating a New Physics with a New Global Variable that can be Controlled via the Stim[] Interface
Problem to solve with the new feature
In a lot of my past work on cardiac optogenetics modelling & simulation, I used an version of the CARP code forked off of the maint trunk where I added a special state variable in the ionic model that can be controlled using the stimulation[] interface.
I would like to explore options for adding this to openCARP, so that it is available to all users. At the same time we could add limpet plugins for light-sensitive currents like I_ChR2.
Intended users
This is of interest to many research groups, not just mine. Any users wanting to simulate cardiac optogenetics would stand to benefit.
Further details
n.b., since this concerns an old version of the code and it may be helpful for me to share snippets from that (written by me) as part of the development process, I'm tagging this as confidential. I'm not sure I even have Reporter access, so I suppose we'll find out! :)
In a previous fork of carp, I created a separate global variable called "light" and there was a new stimulus type (stimtype = 6) that I could use to manipulate that value:
$ carp +Help stimulus[0].stimtype stimulus[0].stimtype: type of stimulus
type: Short default:(Short)(0) menu: { (Short)(6) illumination (optogenetics) ... [etc]
This worked in combination with custom-compiled .model files for optogenetic current plugins, e.g.:
Vm; .external(); .nodal(); .lookup(-800,800,0.05); Iion; .external(); .nodal(); Iion = Iion; light; .external(); .nodal(); .trace(); // illumination flux (mW/mm^2)
Iion += I_ChR2;
Th = light * attenuation; // "Theta" variable from Williams et al. paper ... [etc.] (Th is subsequently used to modulate dark-to-light state transitions in the ChR2 photocycle model.)
That's basically the whole deal -- it doesn't have to be much more complicated than that. Having the capability to modify the global variable (in this case light) via the stimulus[] interface proved very helpful because it made it straightforward for me to perturb the system using precise spatiotemporal patterns of illumination.
Importantly, I suppose this functionality could be extended (or made more generic) to control other relevant global variables via stimuli. For example, it is not hard to envision an application where a parameter like drug or neurotransmitter (e.g., [ACh]) concentration is clamped to a specific waveform over time in a particular region. It does not have to be called "light" it could have a more generic name like "glob_sv" and then the user could assign a specific name.
Proposal
Like I said, I have implemented this before but in an older version of the code. I am hoping I can get help from the openCARP team to do this in such a way that it integrates harmoniously with the new version of the code. I spoke about this 1:1 with Ed Vigmond and he said "You should be able to create a new physics with a new global variable like you have with new stimulus type." (hence the title of my post).
If the team can help, I am happy to attempt a first implementation of this but I am very unfamiliar with the protocols for pushing new changes into the repository (i.e., I am not very good at using git).
Also, as indicated above, if the group feels it would be favourable I am happy to roll my I_ChR2 LIMPET plugin implementation into the trunk so that it can be used by anyone.
Testing
If the team can help me get this up and running, I will volunteer to test this comprehensively and I will write tutorials and/or examples to be published on the website.
Links / references
A few papers that used this functionality in CARP: