NCAR / music-box

A box/column model using MICM chemistry
https://ncar.github.io/music-box/branch/main/
Apache License 2.0
29 stars 11 forks source link

Discrepancy between local docker image & latest web calculations #254

Closed kkowalsk closed 1 week ago

kkowalsk commented 2 weeks ago

There appears to be a mathematical error between docker image 1.1.1. (downloaded last year) and the latest web version (Oct 7th, 24).

Inputting the same concentrations and reactions between both models results in different results with the web version appearing to be inaccurate by an order of 10^3.

NOx chemistry reaction:

We are expecting this graph: image

But, those results only occur if the concentrations are bumped up by an order of 10^3 to:

K20shores commented 2 weeks ago

Hi @kkowalsk! Thanks for the report!

The old version of musicbox used the camp solver. We are now using our musica python package which uses the micm solver. All of music box has been rewritten so there may be some things that are wrong.

We'll look into this and see if we can figure out the discrepancy. Thanks for using music box!

K20shores commented 1 week ago

I believe this config file contains a configuration for this. Dropping it here so I don't lose it

config.zip

kkowalsk commented 1 week ago

Hi @K20shores ,

I'm new to MusicBox, how should I configure this configuration file? We are using MusicBox in my class at CU Boulder.

K20shores commented 1 week ago

Hi @kkowalsk

The attached configuration file recreates the simulation conditions you listed, assuming I didn't make any typos.

You can use it in two ways.

  1. Run from the command line directly. The command line tool for musicbox is available from pypi with pip install acom_music_box. After you install that, a command line tool music_box should be available for you to use. You would unzip the configuration file, and then run it like this music_box -c /Users/kshores/Downloads/configuration/my_config.json -o ~/Desktop/results.csv. The command line tool can useful if you already have a configuration you want to run. We are also working to expand the python package so that you could define your simulation entirely in data in python and run simulations that way
  2. Upload to the website.

Hope that helps. In the meantime I'll continue investigating why the values appear to be incorrect.

kkowalsk commented 1 week ago

Oh, gotcha, thanks @K20shores.

I didn't pay close enough attention - I thought maybe you had solved the issue, but you were just dropping the configuration that demonstrates the bug.

I double checked the configuration - yes, that is how we replicated the issue.

K20shores commented 1 week ago

@kkowalsk I think we were converting from mol cm-3 to mol m-3 incorrectly, hence the factor of 10^3.

255, which focues on other work, should also fix this. In particular, the changes to this file should fix things.

I'll push a fix to the website on Monday morning and ping you when that's done. Thanks for reporting this!

kkowalsk commented 1 week ago

Ah, yup, that makes a lot of sense!

Cool, thanks for the quick turn around on this!

K20shores commented 1 week ago

@kkowalsk of course! I've published a fixed; attached is a screenshot of a run of your mechanism on the website. Please let us know if you find anything else incorrect or any new features you may think of!

Screenshot 2024-10-13 at 2 15 13 PM