Giter VIP home page Giter VIP logo

omsysident's Introduction

OMSysIdent - OpenModelica Parameter Estimation License: OSMC-PL

OMSysIdent is a module for the parameter estimation for linear and nonlinear parametric dynamic models (wrapped as FMUs) on top of the OMSimulator API. It uses the Ceres solver for the optimization task. It is part of the OpenModelica tool suite.

The module provides a Python scripting API as well a C API. They are documented in the OpenModelica User's Guide. Examples for using these APIs can be found below the testsuite directory.

Notice that this module was previously part of OMSimulator. It has been extracted out of the OMSimulator project and reorganized as a separate project in September 2020. As of 2020-10-07 the project is working on Linux but some more efforts are needed for migrating the Windows build and make the build and usage of the module more convenient.

Dependencies

  • OMSimulator
  • cmake
  • Optional - Python for using the Python scripting API
  • Included 3rdParty libraries
    • Ceres Solver
    • Eigen
    • gflags
    • glog

Build

Prerequisites:

  1. The OMSimulator project needs to be cloned and build.

  2. OMSysIdent needs to be cloned so that it shares the same parent directory with OMSimulator.

Linux

  1. Build the included 3rdParty libraries

    make -j4
  2. Build OMSysIdent

    mkdir build
    cd build
    cmake ..
    make -j4
    make install

Notice that make install will default to a relative installation at install/${PLATFORM_STRING} within the OMSysIdent project directory.

Windows

To Be Done

omsysident's People

Contributors

adeas31 avatar anheuermann avatar arun3688 avatar bernhard-thiele avatar frape315 avatar lochel avatar robbr48 avatar sjoelund avatar superlou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

omsysident's Issues

Running OMSysIdent

Hi,

I am trying to use the Python I installed on my system to run OMSysIdent. I set PYTHONPATH to point to OMSysIdent/install/linux/lib and /OMSimulator/install/linux/lib. When I try to run the HelloWorld_cs_Fit.py example from OMSysIdent/testsuite/python Python crashes at line simodel = OMSysIdent("HelloWorld_cs_Fit") and ouputs

free(): invalid pointer
Aborted

But when I run the example using /OMBUILD/OMSysIdent/install/linux/bin/OMSimulatorPython3 it runs correctly.

I'm sure I'm missing a point here. Could you help me figure out how to run it from my Python instance?

Building OMSysIdent

Hi,

I'm trying to build OMSysIdent but when I run 'make -j4' in the build directory it complains that it cannot find the OMSimulator header files ( fatal error: OMSimulator.h: No such file or directory) . I assume this is because I haven't properly set up the folder structure?

I tried having both ./OMSimulator/OMSysident, and having separate ./OMSimulator and ./OMSysident folders sharing the same parent folder. With the latter I get usr/bin/ld: cannot find -lOMSimulator.

Also, I've built OMSimulator and it can be run.

Thanks

Installation issues/instructions

Hi,

I'm moving over from OpenModelica on Windows in order to get OMSysIdent working under linux.

I've just installed a brand new copy of Ubuntu 21.04, and OpenModelica using the instructions here:
https://openmodelica.org/download/download-linux
(including the step to install all the libraries).

I opened the OMEdit GUI and it asked me something about 3.2.3 vs 4.0.0. I said 3.2.3, the default. The GUI partially seemed to work. I can open the OMEdit GUI, but none of the usual standard libaray is present. It threw an error like
[3] 16:39:51 Scripting Error Failed to load package ModelicaReference (default) using MODELICAPATH /usr/bin/../lib/omlibrary:/home/rwhite/.openmodelica/libraries/.

I don't think that's related to this, so I'll move on.

I attempted to install this tool. First I searched for the installation directory of OMSimulator, which seems to be /usr/lib/ on my install.

I cloned this repo into /usr/lib, which failed at first due to permissions errors. I ran the clone command again with sudo and it worked.

I went into /usr/lib/OMSysIdent/ and ran make -j8 (cos I have 8), and it failed again due to permissions. Did sudo again and it gave the output in OMSysIdent1.txt.

Did the mkdir build step, failed again on permissions, now I sudo su cos I'm bored of these now...

/usr/lib/OMSysIdent/build/cmake .. looks like it's failing on CMAKE_HAVE_LIBC_PTHREAD and -- OMSimulator - NOT Found -- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) WARNING,Python library not found.

The final step I tried, /usr/lib/OMSysIdent/build/make -j8 fails on a missing Types.h and OMSimulator.h. See output from these commands in OMSysIdent2.txt.

Can someone help with a more step-by-step set of installation instructions or let me know what I'm doing wrong?

Thanks!
R

Installation problems

Following the instructions, and starting from the GitHub repositories updated to the master, these problems are experienced:
The configuration phase 'make configure-OMSimulator' ends with an error related to
OMTLMSimulator.
In particular, the OMTLMSimulator / 3rdParty / misc / src / Bstring.cc folder is missing
By editing the Makefile in the OMSimulator folder with the line

  • from OMTLM? = ON to OMTLM? = OFF
    you are unable to successfully compile OMSimulator.
    At the end of the OMSysIdent compilation and installation process, the installation files in
    OMSysIdent / install / linux / *, are not usable as is.
    In particular, the .py files associated with OMSimulator (/ usr / lib / OMSimulator) are missing:
  • Model.py
  • NewAPI.py
  • Scope.py
  • System.py
  • Type.py
    To remedy the problem we installed OMSimulator in python with the command line
  • sudo pip3 install OMSimulator
    At this point we no longer have an execution error related to the missing OMSimulator files.
    In order to be able to successfully run the example script in the documentation we had to:
  • prepare a workbook with this structure
    \ working-dir
    | - lib
    | | OMSysIdent.py (copied from OMSysIdent / install / linux / lib / OMSysIdent.py)
    | | libOMSyIdent.so (copied from OMSysIdent / install / linux / lib / libOMSyIdent.so)
    | - resources
    | | HelloWorld.fmu (copied from OMSysIdent / testsuite / resources / HelloWorld.fmu)
    | - project
    | | HelloWorld_cs_Fit.py (source copied from site documentation)
  • from the project folder execute the command

bash OMSimulatorPython3 HelloWorld_cs_Fit.py
without the explicit call to bash, the PYTHONPATH and LD_LIBRARY_PATH variables set in OMSimulatorPython3 are not set.
@casella

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.