bug in `SBMLTransforms::replaceFD`?
lkeegan opened this issue · 2 comments
I was using SBMLTransforms::replaceFD
to expand/inline functions in math expressions but ran into incorrect results in some cases:
spatial-model-editor/spatial-model-editor#856 (comment)
I think substituting each argument sequentially like this is only valid if there is no overlap between the variables in the function body and the variables that are passed to the function?
This has now been fixed and merged into development. We plan to have a new release including the fix within the next couple of weeks.
@fbergmann thanks! Unfortunately while this fixes the failing test case I don't think it is correct in general, e.g. changing the expression from p * S1
to p - S1
gives incorrect results. I think to do the substitution correctly it needs to be done for all variables at the same time - I've made a PR with an attempt at doing this here: #303