Unfortunately I don’t really have much in the way of fully formatted test cases, because I’m trying to work out how the lowest level behaviour (e.g. parsing some form of expression/function into the odefunction) is going to work, before building the rest of the pipelines from the reaction/species databases, and how everything fits together.
Basically I would read the reaction and reaction rate expression from a database, use a parser which I’ve already coded to identify which species are involved in the reaction and in what way, and generate an appropriate string form for the expression. This would result in expressions of the form 1.54e-16*Te^3.12*exp(-7.56/Te)*u[1]*u[2]
or 5.6e3*E_wall*u[1]
, where the electron temperature Te is solved for or provided, the local electric field at the wall E_wall is a system variable which may or may not be a function of time evaluated in the odefunction, and u[1],u[2] are the densities of the species being solved for which are involved in the reactions, for example.
I would then want to parse these expressions (either as strings, :(expressions), or functions) into the odefunction to be evaluated in the local environment, with the locally defined Te, E, etc.
I feel the overall behaviour that I want is fairly well represented in the pseudo code I provided in #5
Ultimately I either need to be able to parse some arbitrary array of functions which are as performant as the comprehension described in jerryling315’s response, or I need to be able to do the equivalent of eval(Meta.parse("expression"))
in a local function scope.