ModellingWebLab / project_issues

An issues-only repository for issues that cut across multiple repositories
1 stars 0 forks source link

Automatic code generation for dynamic clamp platforms #42

Closed mirams closed 5 years ago

mirams commented 6 years ago

Dynamic clamp platforms use real-time computing to inject simulated currents into real cells, and take voltage from real cells as an input over the next time interval.

A common use case is a sub-model like a sodium current from a whole AP model, or a whole AP model that is missing particular currents. Our Functional Curation framework should be able to export these nicely, and already makes a sub-model Chaste .hpp and .cpp files from a given input and outputs.

We would want to generate code with fixed-time solvers like Rush-Larsen / RK4 in a format for some dynamic clamp platforms.

I manually ‘flattened’ (combined the abstract class and solver with the concrete ODE system) one of our Rush-Larsen models for Teun in Utrecht, and he translated from C++ to Labview, this was a bit laborious. It would be a very nice application of FC framework to just be able to export him any current module from any model in a format he could readily use. I would like this to be a feature of Web Lab that people could use like they do for whole models in PMR at the moment. Other dynamic clamp softwares include David Christini’s RTXi and Randy Rasmusson also has some dynamic clamp software. All would probably want a similar 'flattened' optimised compute time model, but we can check that with them.

(A nice optional extra would be to do R-L style exact solves on Markov models automatically too with old-school linear system eigenvalues/vectors etc. over fixed V timesteps. Might need some clever business to assemble a transition matrix from randomly written equations, work out maple analytic expressions for eigenvalues and vectors etc. This would also be great for our parameter fitting exercises as it would speed up calculations with voltage steps massively.)

MichaelClerx commented 5 years ago

Some updates on this:

MichaelClerx commented 5 years ago

Moving this to weblab_cg, where we can handle it (separate from general WL) if needed

https://github.com/ModellingWebLab/weblab-cg/issues/21