Skip to content
Snippets Groups Projects
Select Git revision
  • master
  • multi-level
  • bli-multilevel
  • dev-ede
4 results

blueprint.md

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.

    OpenModelica functions

    pseudocode for the om-functions
    self wont be described in parametersections

    global reminder:

    • check for None as result for functions that call OpenModelicas internal API

    omOpen(self)

    • @params: none
    • set up a OM server
    • set options like dymOpen() does ?

    omTranslate(self)

    omApplyModifier(self, modifiersList)

    omSimulate(self, simOptions = "", resultName = "simResults")

    omSimulateMultiResults(self, resultName = "simResult", simOptions = "", initialNames="", initialValues="", resultNames="")

    • @params:
      • resultName:
        • string with name of the file, the result should be written to
      • simOptions:
        • ?
      • initialNames:
        • ?
      • initialValues:
        • ?
      • resultNames:
        • not needed as OpenModelica automatically writes the results to a file called "modelName_res.mat"
    • TODO check which options are available
    • see omSimulate for further informations

    omGetResultsFast(self, resultName = "simResult", outputVarList = [])

    • @params:
      • resultName:
        • not needed as OpenModelica automatically writes the results to a file called "modelName_res.mat"
      • outputVarList:
        • array with the wanted variables
    • return an numpy.array containing the trajectories for the variables in outputVarList using ModelicaRes's SimRes() function

    omGetResults(self, resultName = "simResult", outputVarList = [])

    • @params:
      • resultName:
        • not needed as OpenModelica automatically writes the results to a file called "modelName_res.mat"
      • outputVarList:
        • array with the wanted variables
    • values are read from the file with the name resultName
    • return numpy.array with the results for the given variables
    • OpenModelica's function getSolutions()

    omGetResultVarNames(self, resultName = "simResult")

    • @params:
      • resultName:
        • not needed as OpenModelica automatically writes the results to a file called "modelName_res.mat"
    • return the variable names from the simulation result
    • OpenModelica's function getSolutions()

    omClose(self)

    • @params: none
    • close the OpenModelica session with ModelicaSystem.getconn.sendExpression(close()) like here
    • set the ModelicaSystem-Object self.__omObj to None
      • ModelicaSystem handles shutdown of OMCSession etc. in its Destructor