Giter Club home page Giter Club logo

modelica-ibpsa-mpc's Introduction

IBPSA Project 1 - Modelica MPC library

This repository contains code for formulating models for use in a Model Predictive Controller. The code is being developed as part of the IBPSA Project 1 (https://ibpsa.github.io/project1/).

modelica-ibpsa-mpc's People

Contributors

dhblum avatar mathadon avatar mwetter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

cmbnor

modelica-ibpsa-mpc's Issues

sources

This issue is for adding fluid sources to the library.

consistency with IBPSA

@dhblum
One thing that I lost track of:
if we now copy models from IBPSA into IbpsaMpc manually, we will gradually diverge from IBPSA since new changes of IBPSA don't get merged into IbpsaMpc. To avoid this, it would make sense to set up some way to automate the merging process. Two problems here:

  1. The buildingspy merger could be used for the merging, but it's not practical to use it for merging only a limited set of models (while it's easy to exclude a limit set of models). This functionality should thus be added to buildingspy. @mwetter do you agree?
  2. The merging will overwrite our custom changes to the models that make them compatible with JModelica. One approach to reapply the changes is to use git cherry-pick, although I'm not sure whether this will work as intended, especially when merge conflicts arise. We would also have to keep track of all commits that modify IBPSA code.

Perhaps there is a better way but we better look into this before making too many PRs?

Create testing framework

This issue is to create a unit testing framework that tests the compilation, simulation, and optimization of library models.

merge script

I have completed (the first version of) the merge script. The merge script relies on the git patch functionality, which can generate merge conflicts to sort out conflicting edits. Furthermore, I prefer not to make automated git commits. Therefore, the merge process is now split up in two steps, which consists of multiple commits and two python calls to https://github.com/ibpsa/modelica-ibpsa-mpc/blob/issue1_sources_modifications/IbpsaMpc/Resources/Scripts/merge.py.

The following instructions are generated upon calling the merge script for the first time:

[parallels@localhost IbpsaMpc]$ python Resources/Scripts/merge.py 

The merge has been succesfully prepared. The following steps still have to be completed:
1) Commit the updated files that have been copied using:
> git commit -a -m "Merged files from the library IBPSA"
2) Run the merge script again, which updates .copiedFiles.txt, upon which the merge process continues. To abort, checkout all files.

and these the second time:

[parallels@localhost IbpsaMpc]$ python Resources/Scripts/merge.py 
The merge continues. The stored sha is 1b3b2a6e23d7de10cb62634a2dea57069cc74ab9. Next steps are:
3) Reapply earlier modifications using the patch file:
> git apply --3way merge.patch
4) Resolve conflicts if required, then also commit these changes, without amending:
> git commit -a

What happens in the back-end: the file .copiedFiles contains the sha of code before the previous patch was applied. When starting the script, a patch file is generated compared to this sha and stored to file (only for the files that are listed in the script), which effectively summarizes all changes compared to last merge. After that the file selection is copied from the IBPSA library using the normal merge scripts, which overwrites custom changes that may exist in these files. The file .copiedFiles is updated, but does not contain the new sha yet. This version of the code has to be committed for the patch process to work and the sha of that commit is also saved in.copiedFiles in phase 2 of the merge script. In phase 2, the sha is amended to .copiedFiles and further instructions are printed to apply the patch, which may or may not result in merge conflicts, which must then be resolved, then committed by the developer.

This works for the checkBoundary() removal (without merge conflict) but I'm sure that corner cases will pop up. @dhblum any feedback on this?

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.