-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add modest-py fmu-based parameter estimation #47
Comments
Thanks, I created a branch for this issue: https://github.com/lbl-srg/MPCPy/tree/issue47_add_modestpy |
@krzysztofarendt @LisaRivalin I've merged the latest master to this branch. |
@krzysztofarendt I recommend you merge the latest master with refactored unittests. Note the function |
Do you have the Modelica Buildings Library path on your MODELICAPATH
environmental variable?
…On Thursday, November 16, 2017, Krzysztof Arendt ***@***.***> wrote:
@dhblum <https://github.com/dhblum>, I haven't merge yet, because 6 tests
are failing for me. The tests that are failing are using this model:
mpcpy/unittests/resources/model/LBNL71T_MPC.mo.
The unit tests fail due to compilation errors, similar to this one (there
are many of them):
Error: in file '/home/krza/link/code/mpcpy/unittests/resources/model/LBNL71T_MPC.mo':
Semantic error at line 882, column 23:
Cannot find class or component declaration for H
Failing tests:
test_estimate_and_validate (unittests.test_models.EstimateFromJModelicaEmulationFMU)
test_simulate_initial_parameters (unittests.test_models.EstimateFromJModelicaEmulationFMU)
test_estimate_and_validate (unittests.test_models.EstimateFromJModelicaRealCSV)
test_simulate_initial_parameters (unittests.test_models.EstimateFromJModelicaRealCSV)
test_energycostmin (unittests.test_optimization.OptimizeAdvancedFromJModelica)
test_energymin (unittests.test_optimization.OptimizeAdvancedFromJModelica)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#47 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ASlBpx0UCosiUCno0jjkyXoZeEvwGiYDks5s3BCEgaJpZM4ODvAy>
.
|
Dave, I added one unit test for ModestPy: I also have a comment to other unit tests in test_models.py. In
However you do not simulate the model in this unit test. Instead, you simulate it in another unit test For this reason I combined both unit tests into a one in |
I don't see how changing the tolerance will change the computational time of the test, unless the testing of values of a timeseries terminates early because an error is found greater than the tolerance. I'd like to keep the tolerance value of 1e-3 as it is for now, which is based on the tolerance used in regression tests of the buildings library using https://github.com/lbl-srg/BuildingsPy. Thank you for pointing out the other unit tests in test_models. There are a couple things going on here at once. First, the tests are not intended to be run in a particular order. It is a typo that the model is not simulated directly after estimation. I will make this fix. The I'd still like to test that the initial guess simulation results are consistent. I suggest simulating the model before estimation, checking the results, estimating, then simulating again, and then checking the new results. Essentially, as you suggested, combining the tests into one, but adding a simulation of the model before estimation:
I've also noticed that start/final_time_emulation is not needed, only _estimation and _validation. I've opened a new issue to perform cleaning not related to ModestPy integration. See #94. |
The closing and reopening of this issue was accidental. It is not closed. |
@krzysztofarendt please check if you agree with the latest commits to this branch. Please also check that the unit test passes on your machine with the reference results I've committed. I think the implementation is looking good and we are ready to merge to master very soon. |
Thanks @dhblum for your help on it. I run unit tests and everything works. I agree with the changes with one comment: models.py, lines 1015-1017
|
Great, thanks. Good catch, I will implement Two questions regarding the options of ModestPy:
For 1) I recommend adding |
I added As for In ModestPy it's implemented as follows:
But as for now, I agree that it would be confusing to add |
Agree that it could be implemented wholistically in MPCPy. I do not want to implement that in this issue, however. For now, let's not implement the ic_param argument for ModestPy. Before merging we need to add some documentation, for use and installation, such as adding modestpy to the list of python packages. |
I can take care of it. Please check if this list is complete:
I'm not sure what's the best way to modify 2.2.4. Maybe a subsection 2.2.4.1: Alternative Estimation Methods? That may be a good choice if you plan to add more methods later. Although replacing JModelica to ModestPy is as easy as changing one argument in the model instantiation, each alternative method will likely have a list of optional parameters to document. I will also have to
|
I added 6.1.2 to the check list. You can do this by adding the ModestPy class in the docstring of mpcpy/models.py in the section:
For 2.2.4 you could either reinstantiate the model with the modestpy estimation method or demonstrate the use of the |
I updated ModestPy on PyPi. Current version: 0.0.7. |
ModestPy added to Section 1.2: bee632e |
ModestPy added to Section 2.1: 53cfa91 I changed the version specifier in |
ModestPy added to Section 2.2.4: 82c11c8 @dhblum, I enabled a sphinx extension for automatic links to other sections (
The extension worked for me in this example, but after enabling it I got some warnings in other places in the documentation:
|
Thanks for this. I added some comments to 82c11c8 and will look into the warnings generated. |
This issue is to architect the use of fmu-based parameter estimation using https://github.com/sdu-cfei/modest-py.
The text was updated successfully, but these errors were encountered: