wsphillips / Conductor.jl

Choo-choo
MIT License
61 stars 12 forks source link

Direct support for ustrip? #1

Closed ChrisRackauckas closed 2 years ago

ChrisRackauckas commented 3 years ago

Is direct support for ustrip all that's needed for https://github.com/wsphillips/Conductor.jl/blob/089edeb5bea4c38098a5e1e5381edcd33ca033e0/test/hodgkinhuxley.jl#L34 that register to change to IfElse.ifelse and not be needed?

wsphillips commented 3 years ago

ustrip isn't strictly necessary here. I'm just being somewhat lazy, overtly cautious about unit exponents, and simultaneously showing that I could pass arbitrary functions in.

Better solution would be either 1) macro that takes any current units and interpolates the converted value as a constant into a returned function. Or 2) read it from a parameter in a Electrode/Stimulator wrapper component. Eventually I'll write a fleshed out module for doing current stimulus patterns (pulse trains/wave patterns, etc) like these properly.

ChrisRackauckas commented 3 years ago

okay yeah. I think you should try doing the units directly in MTK, though that system is not quite complete. We'll probably need to work together to get the units really to where they need to be 😅

wsphillips commented 2 years ago

implementation of units being tracked by #5