OpenWaterAnalytics / epanet-msx

multi-species extension to epanet
MIT License
13 stars 18 forks source link

Illegal Math Expression Error for 10^-x #4

Closed henryricca closed 6 years ago

henryricca commented 6 years ago

MSX doesn't appear to be able to handle expressions in the form of 10^-x. It handles expressions in the the form of 10^x fine. We discovered this when trying to incorporate temperature dependent equilibrium constants in a chloramine decay model. The following 3 files are in the attached .zip folder, which highlight the issue.

chloramine.inp - EPANET input file for the simple example network provided with the manual

chloramine_temp_issue.msx - MSX input file that produces the error discussed above

chlormaine_temp_issue.rep - report file generated from running 'chloramine.inp' with 'chloramine_temp_issue.msx'. This shows the errors generated when including expressions in the form of 10^-x

Negative_Power_Issue.zip

samhatchett commented 6 years ago

possible dupe of #1

bradleyjeck commented 6 years ago

I ran across something similar working on a paper on temp, chlorine decay, and DBP formation. The work-around was to use extra parentheses e.g. ( 10^(-x)) instead of 10^-x.

henryricca commented 6 years ago

Thanks for the quick reply, adding the extra parentheses seems to have solved it!