GithubHelp home page GithubHelp logo

epanet-msx's People

Contributors

fengshang1972 avatar jamesuber avatar samhatchett avatar ttaxon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

epanet-msx's Issues

MSX File with Undefined Constant Running without Error

When an undefined variable was referred to in the [TERMS] section of a .msx file due to a typo, MSX ran without outputting an error message. Not sure if MSX just assumes a default value for undefined constants in cases like this, but an error message would have helped us quickly realize that a typo was responsible for the odd results we were getting. 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_undefined_constant.msx - MSX input file with the undefined constant due to a typo. In line 97, 'DCO1' was typed instead of 'DOC1'

chloramine_undefined_constant.rpt - report file generated from running 'chloramine.inp' with 'chloramine_undefined_constant.msx'. The results are odd due to the typo, but no error message was output

Undefined_Constant_Issue.zip

Ordering 'Species' Section of .msx File

We have noticed behavior with MSX where the order of the species in the [SPECIES] section of the .msx input file appears to impact the results. The only difference between chloramine.msx and chloramine_ordered.msx (both attached) is the ordering of the species in the [SPECIES] section, but they produce different results. In the "_ordered" file, species are ordered in the same order as the reactions specified in the [PIPES] section. However, this ordering produces negative concentrations for some species. The following 5 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.msx - MSX input file with an ordering that seems to produce stable results for monochloramine decomposition

chloramine_ordered.msx - MSX input file with an ordering that seems to produce negative concentrations for some species for monochloramine decomposition

chloramine.rpt - report file generated from running 'chloramine.inp' with 'chloramine.msx'

chloramine_ordered.rpt - report file generated from running 'chloramine.inp' with 'chloramine_ordered.msx'

Species_Order_Issue.zip

Starting to develop New MSX API

The new MSX API has a few specific goals that it will need to accomplish in order to be successful. First, it will not be dependent on the EPANET libraries as the current version of MSX is. Next, it will not use input files such as the .inp EPANET input file, or the .msx MSX input file. Instead it will take input through a REST API with higher level language bindings. In this way, users will not have to worry about following a specific particular input/output format.

In order to start development of this, it will likely be easiest if we have a test environment that calls the API in the ways we desire, and then move over the functional pieces implementing the core logic of MSX. For example, a simple pseudo-code:

MSX msx_proj = msx_init()
msx_build_network(&msx_proj, net_description)
msx_add_species(&msx_proj, chemical_stuff)
msx_add_source(&msx_proj, location_info, species, concentration, ...)
msx_set_option(&msx_proj, ... option data ...)
msx_init_q(&msx_proj)
msx_evolve(&msx_proj, hydraulic_state, timestep)
msx_get_values(...)
etc...

After this starts to become more and more functional, then it will be important to start building adaptors to allow the old API to work with the new one for full backwards compatibility.

Let me know if you have any thoughts!

Node and Pipe Concentrations not Matching

The species concentrations reported by MSX at nodes don't seem to match with the concentrations reported in pipes. For example, in the simple example network provided with the MSX manual, Pipe 1 flows into Node A, and Pipe 2 and Pipe 3 flow out of Node A. The NH2Cl concentration reported at Node A is higher than the NH2Cl concentrations reported in any of these 3 pipes once they have all reached steady concentrations. This doesn't make sense to me - how can the concentration at a node be higher than the concentrations in any of the entering or exiting pipes? 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.msx - MSX input file that produces the results discussed above

chloramine.rpt - report file generated from running 'chloramine.inp' with 'chloramine.msx'. This shows Node A having higher NH2Cl concentrations than any of the pipes that enter or exit Node A. Concentrations are steady at Node A and all 3 pipes by hour 8.

Node_Pipe_Conc_Issue.zip

parsing exponents

MSX doesn't parse the following formula expression

FORMULA Xn X0_(2.71828^(-kb_t))

In this case you should really be using exp(-kb*t) but that's besides the point.

Source Code Files Not Up To Date With EPA Files

The source code files in this repository are out of date when compared with those published by US EPA on their web site . The latter files are from 2010/2011 while those in this repository are from 2007/2008. The newer EPA files include a fix for the "parsing exponents" problem noted in issue #1 . When comparing the two sets of files I found that 19 of 30 files had been updated in the EPA release.

Merge Strategy for the USEPA version and Feng's (cancelled) Pull Request

I have recently worked with the CMake files in Issue #7 (#7) in order to compile and run the USEPA version of the repository which can be found on the epa-upstream-1.1.0 branch.

I then used the same strategy to compile and run the code found in Feng's cancelled pull request. In Feng's version of the code, the reports contain additional water quality information at the bottom of the reports. This information includes the water quality mass balance for different chemicals. It details the Initial Mass, Mass Inflow, Mass Outflow, Mass Reacted, Final Mass, and Mass Ratio.

After successfully running Feng's code, I merged it with the USEPA version and fixed all merge conflicts. I favored Feng's version of the code over the USEPA version with the conflicts to make sure not to mess up any of the additional features. I then made sure it could compile and successfully ran examples.

If wanted, I can create a pull request for this code, including the CMake files and I can create a document with compiling instructions specifically for Windows as I have not had the ability to compile this on Mac or Linux.

Illegal Math Expression Error for 10^-x

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.