Modifying pysb.bng.sympy_to_muparser to simply cast the sympy expression to a string using 'str' before returning. This is the second time I've modified this method. The first time I changed its use of sympy.fcode to sympy.ccode. This was because sympy.fcode writes out numbers in scientific notation using 'd' (for double) instead of 'e', e.g., 1.5d-8 instead of 1.5e-8. BNG doesn't recognize this and was flagging 'd' as an undefined variable. This time, the problem was that sympy.ccode writes out expressions like x**2 as pow(x, 2). BNG doesn't recognize 'pow' and was again flagging it as an undefined variable. I think the safest thing to do is just pass the expression as an unprocessed string directly to BNG and let BNG process it internally. For this reason, I also commented out the line 'code = code.replace('**', '^')'. BNG already does this substitution internally.
Modifying pysb.bng.sympy_to_muparser to simply cast the sympy expression
to a string using 'str' before returning. This is the second time I've
modified this method. The first time I changed its use of sympy.fcode to
sympy.ccode. This was because sympy.fcode writes out numbers in
scientific notation using 'd' (for double) instead of 'e', e.g., 1.5d-8
instead of 1.5e-8. BNG doesn't recognize this and was flagging 'd' as an
undefined variable. This time, the problem was that sympy.ccode writes
out expressions like x**2 as pow(x, 2). BNG doesn't recognize 'pow' and
was again flagging it as an undefined variable. I think the safest thing
to do is just pass the expression as an unprocessed string directly to
BNG and let BNG process it internally. For this reason, I also commented
out the line 'code = code.replace('**', '^')'. BNG already does this
substitution internally.
LoLab-VU/pysb,johnbachman/pysb,LoLab-VU/pysb,alubbock/pysb,johnbachman/pysb,pysb/pysb,jmuhlich/pysb