Git Product home page Git Product logo

prdc_omoctave's Introduction

PR-DC OMOctave

GNU Octave scripting OpenModelica interface using ZEROMQ based on OMMatlab available at:
https://github.com/OpenModelica/OMMatlab/

Requirements

OpenModelica
GNU Octave

Provided interface is partially tested with GNU Octave 6.2.0 and OpenModelica 1.16.5.

Installation

Clone the repository and add the installation directory to Octave PATH. For Example

>> addpath('C:\OMOctave\')

You can also directly use the OMOctave package directly from the directory where you have cloned, without need to perform the above steps. But the package cannot be used globally.

Usage

>> omc = OMOctave();
>> omc.sendExpression("getVersion()")
ans =
{
  [1,1] = OpenModelica v1.16.5 (64-bit)
}
>> omc.sendExpression("model a end a;")
ans =
{
  [1,1] = a
}
>> omc.sendExpression('loadFile("C:/Program Files/OpenModelica1.16.5-64bit/OMSens/resource/BouncingBall.mo")')
ans =
{
  [1,1] = true
}
>> omc.sendExpression("getClassNames()")
ans =
{
  [1,1] = BouncingBall
  [1,2] = a
}
>> omc.sendExpression("simulate(BouncingBall)")
ans =

  scalar structure containing the fields:

    resultFile = C:/Users/User/Desktop/OMOctave/BouncingBall_res.mat
    simulationOptions = startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'BouncingBall', options = '', outputFormat = 'mat', variabl
eFilter = '.*', cflags = '', simflags = ''
    messages = LOG_SUCCESS       | info    | The initialization finished successfully without homotopy method.
LOG_SUCCESS       | info    | The simulation finished successfully.

    timeFrontend = 0.0065355
    timeBackend = 0.0096361
    timeSimCode = 0.0013927
    timeTemplates = 0.0318059
    timeCompile = 8.706928700000001
    timeSimulation = 0.3084547
    timeTotal = 9.0651016
>> omc.close();

To see the list of available OpenModelicaScripting API see https://www.openmodelica.org/doc/OpenModelicaUsersGuide/latest/scripting_api.html

License

Copyright (C) 2021 PR-DC [email protected]

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.

prdc_omoctave's People

Contributors

mpetrasinovic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

prdc_omoctave's Issues

Contribution to the OpenModelica code base

@mpetrasinovic, would you be interested at providing your solution directly to the OpenModelica codebase?

We can't do that currently because your code is GPL'd, and we also release OMC under the OSMC-PL license. If you contribute yourself, you'd be transferrring copyright to the non-profit Open Source Modelica Consortium, that will release it under dual license (GPL and OSMC-PL).

Thanks!

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.