- 
                Notifications
    
You must be signed in to change notification settings  - Fork 128
 
Open
Labels
Description
Overview of the feature
We use SymPy in NMODL to solve ODEs, as well as linear and nonlinear systems analytically, or, if the system is not analytically solvable, using Newton iteration. Since NMODL may use some keywords from SymPy or Python, the procedure basically looks like this:
- rename all variables and function calls which collide with Python/SymPy to something like 
_sympy_[name]_var - use SymPy to parse the fixed expression and derive a result
 - put back the original variable names and function calls
 - generate C code from the resulting expression
 
This is currently done by calling functions like search_and_replace_protected_identifiers_from_sympy, search_and_replace_protected_identifiers_to_sympy, but it would be easier to use a class or a context manager since for any new functionality we would not need to worry about whether or not the identifiers have been correctly replaced (or replaced twice).
Foreseeable Impact
- Area(s) of change: NMODL Python module 
ode, NMODL C++ modulewrapper.cpp - Possible issues: none