EnergySystemsModellingLab / MUSE_OS

Welcome to the MUSE-OS repository
https://muse-os.readthedocs.io/en/latest/
GNU General Public License v3.0
22 stars 9 forks source link

`maximum_iterations` value for the example/tutorial models? #372

Closed tsmbland closed 2 months ago

tsmbland commented 3 months ago

I hadn't quite appreciated the importance of the maximum_iterations parameter before, and have just gone with 1 for all of the tutorials as this is what the default model was already using. However, after reading this page of the documentation, it seems there's quite a fundamental difference between a value of 1 and anything >1.

@ahawkes do you have a sense of what we should be using for maximum_iterations in the tutorial/example models?

It currently defaults to 3 if it isn't specified in settings.toml, but I'm not sure how that number was arrived at.

ahawkes commented 3 months ago

I thought maximum_iterations was the max number of times the model will attempt to clear the market (ie run all sectors and check if prices/quantities converge.

It should usually be a high number like 100 I think.

ahawkes commented 3 months ago

Though I'm not sure this is what has actually been implemented!

tsmbland commented 3 months ago

Yeah, that's what I think it's doing (although I'll need to dig into the code to verify).

100 seems reasonable. The default model used to use 100, but this was changed to 1 in #94 for some unexplained reason (may have been an unintended change that never got caught), so this is what I've been working with.

I'll change it back to 100.

tsmbland commented 3 months ago

@alexdewar @dalonsoa This will be a case where I add two zeros to the code and end up with 25,000 lines changed, so it will be good to come up with a solution for #351 !

ahawkes commented 2 months ago

Can we dig a little here? Does the solution still look sensible? There are two other parameters that might bear on what's happening here in the toml - they are tolerance = 0.1 and tolerance_unmet_demand = -0.1. @tsmbland can you take a look and let me know what these are doing? And when tolerance = 0.1 does that mean the solver stops when the difference between two iterations is less than 10%?

tsmbland commented 2 months ago

Closed by #386. See also #406 and #410. On my to-do list to look at the tolerance parameter