diff --git a/OMCompiler/CMakeLists.txt b/OMCompiler/CMakeLists.txt index ae804cf8994..558c21cc388 100644 --- a/OMCompiler/CMakeLists.txt +++ b/OMCompiler/CMakeLists.txt @@ -61,4 +61,4 @@ endif() omc_add_subdirectory(SimulationRuntime) omc_add_subdirectory(Parser) omc_add_subdirectory(Compiler) - +omc_add_subdirectory(Examples) diff --git a/OMCompiler/Compiler/FrontEnd/ModelicaBuiltin.mo b/OMCompiler/Compiler/FrontEnd/ModelicaBuiltin.mo index 0d92f1d2aa4..dc74adf8557 100644 --- a/OMCompiler/Compiler/FrontEnd/ModelicaBuiltin.mo +++ b/OMCompiler/Compiler/FrontEnd/ModelicaBuiltin.mo @@ -2501,7 +2501,11 @@ The only required argument is the className, while all others have some default input String version = "2.0" "FMU version, 1.0 or 2.0."; input String fmuType = "me" "FMU type, me (model exchange), cs (co-simulation), me_cs (both model exchange and co-simulation)"; input String fileNamePrefix = "" "fileNamePrefix. = \"className\""; - input String platforms[:] = {"static"} "The list of platforms to generate code for. \"dynamic\"=current platform, dynamically link the runtime. \"static\"=current platform, statically link everything. Else, use a host triple, e.g. \"x86_64-linux-gnu\" or \"x86_64-w64-mingw32\""; + input String platforms[:] = {"static"} "The list of platforms to generate code for. + \"dynamic\"=current platform, dynamically link the runtime. + \"static\"=current platform, statically link everything. + \"--\", host tripple, e.g. \"x86_64-linux-gnu\" or \"x86_64-w64-mingw32\". + \"-- docker run \" host tripple with Docker image, e.g. \"x86_64-linux-gnu docker run --pull=never multiarch/crossbuild\""; input Boolean includeResources = false "include Modelica based resources via loadResource or not"; output String generatedFileName "Returns the full path of the generated FMU."; external "builtin"; diff --git a/OMCompiler/Compiler/NFFrontEnd/NFModelicaBuiltin.mo b/OMCompiler/Compiler/NFFrontEnd/NFModelicaBuiltin.mo index f3c2fac6d3a..70cd4cbb280 100644 --- a/OMCompiler/Compiler/NFFrontEnd/NFModelicaBuiltin.mo +++ b/OMCompiler/Compiler/NFFrontEnd/NFModelicaBuiltin.mo @@ -2754,7 +2754,11 @@ The only required argument is the className, while all others have some default input String version = "2.0" "FMU version, 1.0 or 2.0."; input String fmuType = "me" "FMU type, me (model exchange), cs (co-simulation), me_cs (both model exchange and co-simulation)"; input String fileNamePrefix = "" "fileNamePrefix. = \"className\""; - input String platforms[:] = {"static"} "The list of platforms to generate code for. \"dynamic\"=current platform, dynamically link the runtime. \"static\"=current platform, statically link everything. Else, use a host triple, e.g. \"x86_64-linux-gnu\" or \"x86_64-w64-mingw32\""; + input String platforms[:] = {"static"} "The list of platforms to generate code for. + \"dynamic\"=current platform, dynamically link the runtime. + \"static\"=current platform, statically link everything. + \"--\", host tripple, e.g. \"x86_64-linux-gnu\" or \"x86_64-w64-mingw32\". + \"-- docker run \" host tripple with Docker image, e.g. \"x86_64-linux-gnu docker run --pull=never multiarch/crossbuild\""; input Boolean includeResources = false "include Modelica based resources via loadResource or not"; output String generatedFileName "Returns the full path of the generated FMU."; external "builtin"; diff --git a/OMCompiler/Compiler/Script/CevalScriptBackend.mo b/OMCompiler/Compiler/Script/CevalScriptBackend.mo index 81658bb35c1..c2181aae5b8 100644 --- a/OMCompiler/Compiler/Script/CevalScriptBackend.mo +++ b/OMCompiler/Compiler/Script/CevalScriptBackend.mo @@ -3972,7 +3972,6 @@ protected SimCode.SimulationSettings simSettings; list libs; Boolean isWindows; - Boolean useCrossCompileCmake = false; list fmiFlagsList; Boolean needs3rdPartyLibs; String FMUType = inFMUType; @@ -4060,38 +4059,16 @@ algorithm // Check flag fmiFlags if we need additional 3rdParty runtime libs and files needs3rdPartyLibs := SimCodeUtil.cvodeFmiFlagIsSet(SimCodeUtil.createFMISimulationFlags(false)); - // Use CMake on Windows when cross-compiling with docker - _ := match (Flags.getConfigString(Flags.FMU_CMAKE_BUILD), needs3rdPartyLibs) - case ("true", _) algorithm - useCrossCompileCmake := true; - then(); - case ("false", _) algorithm - useCrossCompileCmake := false; - then(); - case ("default", false) algorithm - if (listLength(platforms) > 1 and isWindows) then - Error.addCompilerNotification("OS is Windows and multiple platform detected. Using CMake to build FMU."); - useCrossCompileCmake := true; - else - for platform in platforms loop - if isWindows and 1 == System.regex(platform, " docker run ", 0, true, false) then - Error.addCompilerNotification("OS is Windows and docker platform detected. Using CMake to build FMU."); - useCrossCompileCmake := true; - end if; - end for; - end if; - then(); - else - algorithm - useCrossCompileCmake := false; - then(); - end match; - + // Warn about deprecated Makefile build + if not Flags.getConfigBool(Flags.FMU_CMAKE_BUILD) then + Error.addCompilerNotification("The Makefile build for FMUs is deprecated and will be removed in a future version of OpenModelica." + + " Use \"--" + Flags.getConfigName(Flags.FMU_CMAKE_BUILD) + "=true\"."); + end if; // Configure the FMU Makefile for platform in platforms loop configureLogFile := System.realpath(fmutmp)+"/resources/"+System.stringReplace(listGet(Util.stringSplitAtChar(platform," "),1),"/","-")+".log"; - if useCrossCompileCmake then + if Flags.getConfigBool(Flags.FMU_CMAKE_BUILD) then configureFMU_cmake(platform, fmutmp, filenameprefix, configureLogFile, libs, isWindows); else configureFMU(platform, fmutmp, configureLogFile, isWindows, needs3rdPartyLibs); diff --git a/OMCompiler/Compiler/SimCode/SimCodeMain.mo b/OMCompiler/Compiler/SimCode/SimCodeMain.mo index ccb651c01ae..9dcd8aa3be0 100644 --- a/OMCompiler/Compiler/SimCode/SimCodeMain.mo +++ b/OMCompiler/Compiler/SimCode/SimCodeMain.mo @@ -93,6 +93,7 @@ import HpcOmSimCodeMain; import HpcOmTaskGraph; import NFConvertDAE; import RuntimeSources; +import SemanticVersion; import SerializeInitXML; import SerializeModelInfo; import SerializeSparsityPattern; @@ -926,7 +927,21 @@ algorithm destination = fmu_tmp_sources_dir + "CMakeLists.txt"); cmakelistsStr := System.readFile(fmu_tmp_sources_dir + "CMakeLists.txt"); cmakelistsStr := System.stringReplace(cmakelistsStr, "@FMU_NAME_IN@", simCode.fileNamePrefix); + + // Set CMake runtime dependencies level _ := match (Flags.getConfigString(Flags.FMU_RUNTIME_DEPENDS)) + local + SemanticVersion.Version cmakeVersion; + SemanticVersion.Version minimumVersion; + case("default") algorithm + cmakeVersion := SimCodeUtil.getCMakeVersion(); + minimumVersion := SemanticVersion.SEMVER(3, 21, 0, {}, {}); // v3.21.0 + if SemanticVersion.compare(minimumVersion, cmakeVersion) <= 0 /* minimumVersion <= cmakeVersion */ then + cmakelistsStr := System.stringReplace(cmakelistsStr, "@RUNTIME_DEPENDENCIES_LEVEL@", "\"modelica\""); + else + cmakelistsStr := System.stringReplace(cmakelistsStr, "@RUNTIME_DEPENDENCIES_LEVEL@", "\"none\""); + end if; + then(); case("none") algorithm cmakelistsStr := System.stringReplace(cmakelistsStr, "@RUNTIME_DEPENDENCIES_LEVEL@", "\"none\""); then(); diff --git a/OMCompiler/Compiler/SimCode/SimCodeUtil.mo b/OMCompiler/Compiler/SimCode/SimCodeUtil.mo index b866fd680cd..42ae33ea34f 100644 --- a/OMCompiler/Compiler/SimCode/SimCodeUtil.mo +++ b/OMCompiler/Compiler/SimCode/SimCodeUtil.mo @@ -59,8 +59,9 @@ import HashSetString; // protected imports protected -import Array; import AbsynUtil; +import Array; +import Autoconf; import AvlSetString; import BackendDAEOptimize; import BackendDAETransform; @@ -105,6 +106,7 @@ import Matching; import MetaModelica.Dangerous; import Mutable; import PriorityQueue; +import SemanticVersion; import SimCodeDump; import SimCodeFunctionUtil; import SimCodeFunctionUtil.varName; @@ -15763,6 +15765,26 @@ algorithm end for; end make2CMakeInclude; +public function getCMakeVersion + "Get CMake version" + input String pathToCMake = Autoconf.cmake; + output SemanticVersion.Version cmakeVersion; +protected + Integer retVal; + String cmakeVersionLogFile = "systemCall_cmakeVersion.log"; + String cmakeVersionString; +algorithm + // Regex magic to read major.minor.patch version from cmake --version + retVal := System.systemCall(pathToCMake + " --version 2>&1 | grep \"^.*cmake version\" | sed -e 's/^.*cmake version *//' | sed -e 's/-.*//'", cmakeVersionLogFile); + if 0 <> retVal then + System.removeFile(cmakeVersionLogFile); + Error.addInternalError("Failed to get version from " + pathToCMake, sourceInfo()); + end if; + cmakeVersionString := System.trimWhitespace(System.readFile(cmakeVersionLogFile)); + cmakeVersion := SemanticVersion.parse(cmakeVersionString); + System.removeFile(cmakeVersionLogFile); +end getCMakeVersion; + function getSimIteratorSize input list iters; output Integer size = 1; diff --git a/OMCompiler/Compiler/Util/Flags.mo b/OMCompiler/Compiler/Util/Flags.mo index 5d6faa13400..df0a4ae47fd 100644 --- a/OMCompiler/Compiler/Util/Flags.mo +++ b/OMCompiler/Compiler/Util/Flags.mo @@ -1363,13 +1363,8 @@ constant ConfigFlag FMI_FLAGS = CONFIG_FLAG(141, "fmiFlags", NONE(), EXTERNAL(), Gettext.gettext("Add simulation flags to FMU. Will create _flags.json in resources folder with given flags. Use --fmiFlags or --fmiFlags=none to disable [default]. Use --fmiFlags=default for the default simulation flags. To pass flags use e.g. --fmiFlags=s:cvode,nls:homotopy or --fmiFlags=path/to/yourFlags.json.")); constant ConfigFlag FMU_CMAKE_BUILD = CONFIG_FLAG(142, "fmuCMakeBuild", - NONE(), EXTERNAL(), STRING_FLAG("default"), - SOME(STRING_DESC_OPTION({ - ("default", Gettext.notrans("Let omc decide if CMake should be used.")), - ("true", Gettext.notrans("Use CMake to compile FMU binaries.")), - ("false", Gettext.notrans("Use default GNU Autoconf toolchain to compile FMU binaries.")) - })), - Gettext.gettext("Defines if FMUs will be configured and build with CMake.")); + NONE(), EXTERNAL(), BOOL_FLAG(true), NONE(), + Gettext.gettext("Configured and build FMU with CMake if true.")); constant ConfigFlag NEW_BACKEND = CONFIG_FLAG(143, "newBackend", NONE(), EXTERNAL(), BOOL_FLAG(false), NONE(), @@ -1437,8 +1432,9 @@ constant ConfigFlag OBFUSCATE = CONFIG_FLAG(152, "obfuscate", Gettext.gettext("Obfuscates identifiers in the simulation model")); constant ConfigFlag FMU_RUNTIME_DEPENDS = CONFIG_FLAG(153, "fmuRuntimeDepends", - NONE(), EXTERNAL(), STRING_FLAG("modelica"), + NONE(), EXTERNAL(), STRING_FLAG("default"), SOME(STRING_DESC_OPTION({ + ("default", Gettext.notrans("Depending on CMake version. If CMake version >= 3.21 use \"modelica\", otherwise use \"none\"")), ("none", Gettext.notrans("No runtime library dependencies are copied into the FMU.")), ("modelica", Gettext.notrans("All modelica runtime library dependencies are copied into the FMU." + "System librarys located in '/lib*', '/usr/lib*' and '/usr/local/lib*' are excluded." + @@ -1490,6 +1486,14 @@ algorithm isMember := listMember(hasMember, Flags.getConfigStringList(inFlag)); end isConfigFlagSet; +public function getConfigName + "Returns name of configuration flag" + input ConfigFlag inFlag; + output String name; +algorithm + CONFIG_FLAG(name = name) := inFlag; +end getConfigName; + public function getConfigValue "Returns the value of a configuration flag." input ConfigFlag inFlag; diff --git a/OMCompiler/Compiler/Util/SemanticVersion.mo b/OMCompiler/Compiler/Util/SemanticVersion.mo index 80521f9fae7..eed60d2b030 100644 --- a/OMCompiler/Compiler/Util/SemanticVersion.mo +++ b/OMCompiler/Compiler/Util/SemanticVersion.mo @@ -39,16 +39,19 @@ import System; public uniontype Version -record SEMVER - Integer major, minor, patch; - list prerelease, meta; -end SEMVER; -record NONSEMVER - String version; -end NONSEMVER; + record SEMVER + "Semantic version number MAJOR.MINOR.PATCH, see https://semver.org/." + Integer major, minor, patch; + list prerelease, meta; + end SEMVER; + record NONSEMVER + "Non-semantic version number" + String version; + end NONSEMVER; end Version; function parse + "Parse version string into SemanticVersion.Version." input String s; input Boolean nonsemverAsZeroZeroZero = false; output Version v; @@ -93,6 +96,13 @@ algorithm end parse; function compare + "Compare two versions v1 and v2. + If v1 and v2 both non-semver or both semver: + Return -1 if the first is smallest, + 1 if the second is smallest, + or 0 if they are equal. + If v1 non-semver and v2 semver: return -1. + If v1 semver and v2 non-semver: return 1." input Version v1, v2; input Boolean comparePrerelease = true; input Boolean compareBuildInformation = false; @@ -151,6 +161,7 @@ algorithm end toString; function isPrerelease + "Return true if semver version has pre-release information." input Version v; output Boolean b; algorithm @@ -161,6 +172,7 @@ algorithm end isPrerelease; function hasMetaInformation + "Return true if semver version has meta information." input Version v; output Boolean b; algorithm @@ -172,12 +184,13 @@ algorithm end hasMetaInformation; function isSemVer + "Return true if version is of semantic versioning type." input Version v; output Boolean b; algorithm b := match v - case NONSEMVER() then false; - else true; + case SEMVER() then true; + else false; end match; end isSemVer; diff --git a/OMCompiler/Examples/CMakeLists.txt b/OMCompiler/Examples/CMakeLists.txt index 4f5e4651ab3..15fad87909b 100644 --- a/OMCompiler/Examples/CMakeLists.txt +++ b/OMCompiler/Examples/CMakeLists.txt @@ -7,4 +7,5 @@ FILE(GLOB ALL_C *.c) FILE(GLOB ALL_H *.h) SET(DOCS ${ALL_MO} ${ALL_MOS} ${ALL_ONB} ${ALL_C} ${ALL_H}) -INSTALL(FILES ${DOCS} DESTINATION testmodels) +# TODO: Add this install to some User's Guide target +INSTALL(FILES ${DOCS} DESTINATION "share/doc/omc/testmodels") diff --git a/OMCompiler/SimulationRuntime/c/simulation/simulation_runtime.cpp b/OMCompiler/SimulationRuntime/c/simulation/simulation_runtime.cpp index 2f140e6f72a..6c611749388 100644 --- a/OMCompiler/SimulationRuntime/c/simulation/simulation_runtime.cpp +++ b/OMCompiler/SimulationRuntime/c/simulation/simulation_runtime.cpp @@ -973,7 +973,7 @@ int initRuntimeAndSimulation(int argc, char**argv, DATA *data, threadData_t *thr setGlobalLoggingTime(data->simulationInfo); if(omc_flag[FLAG_LV_MAX_WARN]) { data->simulationInfo->maxWarnDisplays = atoi(omc_flagValue[FLAG_LV_MAX_WARN]); - infoStreamPrint(LOG_STDOUT, 0, "Display limit for repeating warnings changed to %u.", data->simulationInfo->maxWarnDisplays); + infoStreamPrint(LOG_STDOUT, 0, "Display limit for repeating warnings changed to %lu.", data->simulationInfo->maxWarnDisplays); } else { data->simulationInfo->maxWarnDisplays = DEFAULT_FLAG_LV_MAX_WARN; } diff --git a/doc/UsersGuide/Makefile b/doc/UsersGuide/Makefile index 923b7ed89dc..cae640a52ec 100644 --- a/doc/UsersGuide/Makefile +++ b/doc/UsersGuide/Makefile @@ -1,9 +1,15 @@ # Makefile for Sphinx documentation # -OPENMODELICA_ROOT = $(CURDIR)/../../ +OPENMODELICA_ROOT = $(CURDIR)/../.. # OMPython needs this -OPENMODELICAHOME := $(OPENMODELICA_ROOT)/build/ +OPENMODELICAHOME := $(shell \ + if [ -d $(OPENMODELICA_ROOT)/build_cmake/install ]; \ + then echo '$(OPENMODELICA_ROOT)/build_cmake/install'; \ + elif [ -d $(OPENMODELICA_ROOT)/install_cmake ]; \ + then echo '$(OPENMODELICA_ROOT)/install_cmake'; \ + else \ + echo '$(OPENMODELICA_ROOT)/build/'; fi) OMSUSERSGUIDE = $(OPENMODELICA_ROOT)/OMSimulator/doc/UsersGuide @@ -233,7 +239,7 @@ source/openmodelica.bib: resolve-crossref.py ../bibliography/openmodelica.bib ./resolve-crossref.py "../bibliography/openmodelica.bib" source/openmodelica.bib source/interface.inc: interface.mos @mkdir -p tmp - $(OPENMODELICA_ROOT)/build/bin/omc -g=MetaModelica -d=nogen interface.mos + $(OPENMODELICAHOME)/bin/omc -g=MetaModelica -d=nogen interface.mos mv interface.inc $@ OMEDIT_ICONS_BASE=connect-mode.svg transition-mode.svg parametric-plot-window.svg plot-window.svg array-parametric-plot-window.svg array-plot-window.svg re-simulate.svg tlm-simulate.svg interface-data.svg simulation-parameters.svg @@ -255,7 +261,6 @@ source/media/omedit-icons/%.png: source/media/omedit-icons/%.svg inkscape "$<" --export-png="$@" source/media/omedit-icons/%.pdf: source/media/omedit-icons/%.svg inkscape "$<" --export-pdf="$@" - source/media/omoptim-icons/%.png: $(OPENMODELICA_ROOT)/OMOptim/OMOptim/GUI/Resources/icons/%.png @mkdir -p source/media/omoptim-icons cp -a "$<" "$@" @@ -266,10 +271,10 @@ readme: readme/sphinxcontribopenmodelica.py ln -sf ../source/aplot.svg readme sphinx-build -b html -t nomathjax -d build/readme/doctrees readme build/readme/html source/simoptions.inc: - $(OPENMODELICA_ROOT)/build/bin/omc +help=simulation-sphinxoutput > "$@.tmp" + $(OPENMODELICAHOME)/bin/omc +help=simulation-sphinxoutput > "$@.tmp" mv "$@.tmp" "$@" source/omchelptext.rst: - $(OPENMODELICA_ROOT)/build/bin/omc +help=omcall-sphinxoutput > "$@.tmp" + $(OPENMODELICAHOME)/bin/omc +help=omcall-sphinxoutput > "$@.tmp" mv "$@.tmp" "$@" source/omsimulator-help.inc: $(OPENMODELICAHOME)/bin/OMSimulator --help > "$@.tmp" diff --git a/doc/UsersGuide/README.md b/doc/UsersGuide/README.md index fecbf6a63fd..02d589f08d3 100644 --- a/doc/UsersGuide/README.md +++ b/doc/UsersGuide/README.md @@ -10,8 +10,11 @@ set `GITHUB_AUTH`. - omc, omc-diff and omsimulator - Inkscape - - Sphinx - - Python3 and packages from [requirements.txt](https://raw.githubusercontent.com/OpenModelica/OpenModelica-doc/master/UsersGuide/source/requirements.txt) + - [Sphinx](http://sphinx-doc.org/) + - Python3 and packages from [source/requirements.txt](./source/requirements.txt) + ```bash + pip3 install --upgrade -r source/requirements.txt + ``` - Python PyGithub package ### GITHUB_AUTH @@ -43,6 +46,13 @@ https://github.com/OpenModelica/OpenModelica with the PyGithub package. - Install `inkscape` and make sure it's in PATH. ## Build instructions + ```bash make html ``` + +## Preview build + +```bash +python3 -m http.server --directory build/html +``` diff --git a/doc/UsersGuide/source/.gitignore b/doc/UsersGuide/source/.gitignore index bd109cccb6d..63cc7c06209 100644 --- a/doc/UsersGuide/source/.gitignore +++ b/doc/UsersGuide/source/.gitignore @@ -74,4 +74,4 @@ tmp.rst tmp.wiki VanDerPol.pdf VanDerPol.png -VanDerPol.svg \ No newline at end of file +VanDerPol.svg diff --git a/doc/UsersGuide/source/OM_DOWithAnnotations.rst b/doc/UsersGuide/source/OM_DOWithAnnotations.rst index 702312e8d24..49c22cd8731 100644 --- a/doc/UsersGuide/source/OM_DOWithAnnotations.rst +++ b/doc/UsersGuide/source/OM_DOWithAnnotations.rst @@ -303,7 +303,7 @@ vehicle. They are as follows: and they are as expected. -In this model we don’t use the Modelica capability to automatically +In this model we don't use the Modelica capability to automatically determine the system equations from the graphical description of a system. In other words, the above general formulation :math:`0 = f\left( \mathbf{x}(t),\dot{\mathbf{x}}(t),\mathbf{u}(t),t \right)` @@ -333,7 +333,7 @@ be done keeping the energy inside the storage at the final time, equal to the one at t=0 (otherwise it is easy to have zero consumption: just keep the Internal Combustion Engine OFF all the time!) -For simplicity’s sake, the propulsion power, in this simple example is +For simplicity's sake, the propulsion power, in this simple example is taken as being a sine wave plus an offset (needed to make the average positive). When the power is positive the wheels transfer power to the road, when negative they recover it (storing it into the battery). @@ -357,7 +357,7 @@ The DO algorithm is required to determine the battery power outBatPower (positive when the battery delivers power) so that to minimise the fuel consumption toGrams. Block toGperkWh is normalised, so that it can be used for different engines, adapting the horizontal scale through gain, -and the vertical’s through gain1. +and the vertical's through gain1. This diagram defines the system, whose equations will be automatically determined by OpenModelica, through model flattening. However, some code diff --git a/doc/UsersGuide/source/conf.py b/doc/UsersGuide/source/conf.py index a128e0bf1e3..638c3480af6 100644 --- a/doc/UsersGuide/source/conf.py +++ b/doc/UsersGuide/source/conf.py @@ -23,7 +23,13 @@ sys.setrecursionlimit(2000) if not 'OPENMODELICAHOME' in os.environ: - os.environ['OPENMODELICAHOME'] = os.path.realpath('../../../build') + if os.path.isdir('../../../build_cmake/install'): + os.environ['OPENMODELICAHOME'] = os.path.realpath('../../../build_cmake/install') + elif os.path.isdir('../../../install_cmake'): + os.environ['OPENMODELICAHOME'] = os.path.realpath('../../../install_cmake') + else: + os.environ['OPENMODELICAHOME'] = os.path.realpath('../../../build') + os.environ['PATH'] = "%s/bin:%s" % (os.environ['OPENMODELICAHOME'],os.environ['PATH']) # If extensions (or modules to document with autodoc) are in another directory, diff --git a/doc/UsersGuide/source/dataReconciliation.rst b/doc/UsersGuide/source/dataReconciliation.rst index f6ce34cb2cf..ed4d23538fa 100644 --- a/doc/UsersGuide/source/dataReconciliation.rst +++ b/doc/UsersGuide/source/dataReconciliation.rst @@ -318,7 +318,7 @@ The table below compares the results obtained with OpenModelica with those given .. figure :: media/dataReconciliationResult_2.png :name: dataReconciliationResult_2 -The value of mD is left unchanged after reconciliation. This is indicated by ‘Not reconciled’ in OpenModelica, +The value of mD is left unchanged after reconciliation. This is indicated by 'Not reconciled' in OpenModelica, and by repeating the initial measured values in VDI2048. In order to compute the reconciled values of mFD1, mFD2, mFD3 and mHDANZ, which have no measurements, it is possible to consider them as variables of interest with very large half-width confidence, e.g., 1e4, and assign them arbitrary measured values, e.g. 0. The result is .. figure :: media/dataReconciliationResult_3.png diff --git a/doc/UsersGuide/source/debugger.rst b/doc/UsersGuide/source/debugger.rst index 02ba8c5a2fb..2b28bdf0d23 100644 --- a/doc/UsersGuide/source/debugger.rst +++ b/doc/UsersGuide/source/debugger.rst @@ -107,7 +107,7 @@ Start the Algorithmic Debugger ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You should add breakpoints before starting the debugger because -sometimes the simulation finishes quickly and you won’t get any chance +sometimes the simulation finishes quickly and you won't get any chance to add the breakpoints. There are four ways to start the debugger, @@ -164,24 +164,24 @@ Using the Algorithmic Debugger Window :numref:`omedit-algorithmic-debugger` shows the Algorithmic Debugger window. The window contains the following browsers, -- *Stack Frames Browser* – shows the list of frames. It contains the +- *Stack Frames Browser* - shows the list of frames. It contains the program context buttons like resume, interrupt, exit, step over, step in, step return. It also contains a threads drop down which allows switching between different threads. -- *BreakPoints Browser* – shows the list of breakpoints. Allows +- *BreakPoints Browser* - shows the list of breakpoints. Allows adding/editing/removing breakpoints. -- *Locals Browser* – Shows the list of local variables with values. +- *Locals Browser* - Shows the list of local variables with values. Select the variable and the value will be shown in the bottom right window. This is just for convenience because some variables might have long values. -- *Debugger CLI* – shows the commands sent to gdb and their responses. +- *Debugger CLI* - shows the commands sent to gdb and their responses. This is for advanced users who want to have more control of the debugger. It allows sending commands to gdb. -- *Output Browser* – shows the output of the debugged executable. +- *Output Browser* - shows the output of the debugged executable. .. figure :: media/omedit-algorithmic-debugger.png :name: omedit-algorithmic-debugger diff --git a/doc/UsersGuide/source/fmitlm.rst b/doc/UsersGuide/source/fmitlm.rst index cb11bdd0f61..e47f1d27e1a 100644 --- a/doc/UsersGuide/source/fmitlm.rst +++ b/doc/UsersGuide/source/fmitlm.rst @@ -4,28 +4,30 @@ FMI and TLM-Based Simulation and Co-simulation of External Models Functional Mock-up Interface - FMI ---------------------------------- -The new standard for model exchange and co-simulation with Functional -Mockup Interface (`FMI `_) allows export of pre-compiled models, i.e., -C-code or binary code, from a tool for import in another tool, and vice -versa. The FMI standard is Modelica independent. Import and export works -both between different Modelica tools, or between certain non-Modelica -tools. +The `Functional Mock-up Interface (FMI) `_ Standard +for model exchange and co-simulation allows export, exchange and import of pre-compiled +models between different tools. +The FMI standard is Modelica independent, so import and export works both between +different Modelica or non-Modelica tools. -See also `OMSimulator documentation `_. +See also :ref:`OMSimulator documentation`. FMI Export ~~~~~~~~~~ -To export the FMU use the OpenModelica command -`translateModelFMU(ModelName) `_ -or `buildModelFMU(ModelName)` `_ -from command line interface, OMShell, OMNotebook or MDT. -The export FMU command is also integrated with OMEdit. -Select `File > Export > FMU`. Or alternatively, right click a model to obtain the export command. -The FMU package is generated in the current directory of omc. The location of the generated FMU is indicated in the Messages Browser. -You can use the `cd() `_ command to see the -current location. You can set which version of FMI to export through -OMEdit settings, see section :ref:`omedit-options-fmi`. +To export a FMU use the OpenModelica command :ref:`buildModelFMU()` from +the command line interface, OMShell, OMNotebook or MDT. +The FMU export command is also integrated in OMEdit. +Select `File > Export > FMU`. Or alternatively, right click a model to obtain the export +command. +The FMU package is generated in the current working directory of OMC or the directory set +in `OMEdit > Options > FMI > Move FMU`. +You can use the :ref:`cd()` command to see the current location. +The location of the generated FMU is printed in the Messages Browser of OMEdit or on the +command line. + +You can set which version of FMI to export through OMEdit settings, see section +:ref:`omedit-options-fmi`. .. figure :: media/fmiExport.png @@ -37,34 +39,42 @@ To export the bouncing ball example to an FMU, use the following commands: :erroratend: loadFile(getInstallationDirectoryPath() + "/share/doc/omc/testmodels/BouncingBall.mo") - translateModelFMU(BouncingBall) - system("unzip -l BouncingBall.fmu | egrep -v 'sources|files' | tail -n+3 | grep -o '[A-Za-z._0-9/]*$' > BB.log") + buildModelFMU(BouncingBall) + +After the command execution is complete you will see that a file BouncingBall.fmu has been +created. Its contents varies depending on the target platform. +On the machine generating this documentation the contents in +:numref:`BouncingBall-FMU-contents` are generated (along with the C source code). -After the command execution is complete you will see that a file -BouncingBall.fmu has been created. Its contents varies depending on the -current platform. -On the machine generating this documentation, the contents in -:numref:`BouncingBall FMU contents` are generated (along with the C source code). +.. omc-mos :: + :hidden: + + system("unzip -l BouncingBall.fmu | egrep -v 'sources|files' | tail -n+3 | grep -o '[A-Za-z._0-9/]*$' > BB.log") .. literalinclude :: ../tmp/BB.log - :name: BouncingBall FMU contents + :name: BouncingBall-FMU-contents :caption: BouncingBall FMU contents A log file for FMU creation is also generated named ModelName\_FMU.log. -If there are some errors while creating FMU they will be shown in the -command line window and logged in this log file as well. +If there are some errors while creating the FMU, they will be shown in the command line +window and logged in this log file as well. -By default an FMU that can be used for both Model Exchange and -Co-Simulation is generated. We support FMI 1.0 & FMI 2.0 for Model Exchange FMUs -and FMI 2.0 for Co-Simulation FMUs. +By default an FMU that can be used for both Model Exchange and Co-Simulation is generated. +We support FMI 1.0 & FMI 2.0.4 for Model Exchange FMUs and FMI 2.0.4 for Co-Simulation +FMUs. -Currently the Co-Simulation FMU uses the forward Euler solver as default -with root finding which does an Euler step of communicationStepSize -in fmi2DoStep. Events are checked for before and after the call to -fmi2GetDerivatives. +For the Co-Simulation FMU two integrator methods are available: -For FMI 2.0 for Co-Simulation OpenModelica can export an experimental -implementation of SUNDIALS CVODE (see [#f1]_) as internal integrator. +* Forward Euler [default] +* SUNDIALS CVODE (see [#f1]_) + +Forward Euler uses root finding, which does an Euler step of ``communicationStepSize`` +in ``fmi2DoStep``. Events are checked for before and after the call to +``fmi2GetDerivatives``. + +If CVODE is chosen as integrator the FMU should also include runtime dependencies +(:ref:`--fmuRuntimeDepends=modelica`) to copy all used dynamic +libraries into the generated FMU to make it exchangeable. To export a Co-Simulation FMU with CVODE for the bouncing ball example use the following commands: @@ -74,54 +84,144 @@ following commands: loadFile(getInstallationDirectoryPath() + "/share/doc/omc/testmodels/BouncingBall.mo") setCommandLineOptions("--fmiFlags=s:cvode") - translateModelFMU(BouncingBall, version = "2.0", fmuType="cs") - system("unzip -cqq BouncingBall.fmu resources/BouncingBall_flags.json > BouncingBall_flags.json") + buildModelFMU(BouncingBall, version = "2.0", fmuType="cs") -The FMU BouncingBall.fmu will have a new file BouncingBall_flags.json in its -resources directory. By manualy changing its contant users can change the -solver method without recompiling the FMU. +The FMU BouncingBall.fmu will have a new file BouncingBall_flags.json in its resources +directory. By manually changing its content users can change the solver method without +recompiling the FMU. The BouncingBall_flags.json for this example is displayed in -:numref:`BouncingBall FMI flags`. +:numref:`BouncingBall-FMI-flags`. + +.. omc-mos :: + :hidden: + + system("unzip -cqq BouncingBall.fmu resources/BouncingBall_flags.json > BouncingBall_flags.json") .. literalinclude :: ../tmp/BouncingBall_flags.json - :name: BouncingBall FMI flags + :name: BouncingBall-FMI-flags :caption: BouncingBall FMI flags -For this to work OpenModelica will export all needed dependencies into the FMU -if and only if the flag fmiFlags was set. -To have CVODE in a SourceCode FMU the user needs to add all sources for -SUNDIALS manualy and create a build script as well. -CMake FMU Export -~~~~~~~~~~~~~~~~ +Compilation Process +~~~~~~~~~~~~~~~~~~~ + +OpenModelica can export FMUs that are compiled with CMake (default) or Makefiles. CMake +version v3.21 or newer is recommended, minimum CMake version is v3.5. + +The Makefile FMU export will be removed in a future version of OpenModelica. +Set compiler flag :ref:`--fmuCMakeBuild=false` to use the +Makefiles export. + +The FMU contains a CMakeLists.txt file in the sources directory that can be used to +re-compile the FMU for a different host and is also used to cross-compile for different +platforms. + +The CMake compilation accepts the following settings: + +* ``BUILD_SHARED_LIBS``: + Boolean value to switch between dynamic and statically linked binaries. + + * ``ON`` (default): Compile DLL/Shared Object binary object. + + * ``OFF``: Compile static binary object. + +* ``FMI_INTERFACE_HEADER_FILES_DIRECTORY``: + String value specifying path to FMI header files containing ``fmi2Functions.h``, + ``fmi2FunctionTypes.h`` and ``fmi2TypesPlatforms.h``. + + * Defaults to a location inside the OpenModelica installation directory, which was used + to create the FMU. They need to be version 2.0.4 from the FMI Standard. -A prototype implementation of FMUs compiled with CMake instead of Makefiels is available -when using compiler flag :ref:`--fmuCMakeBuild`. -This is useful for creating Source-Code FMUs and for cross-platform compilation. -On Windows this is currently the only way to use Docker images for cross-platform compilation. +* ``RUNTIME_DEPENDENCIES_LEVEL``: + String value to specify runtime dependencies set. -It is possible to add runtime dependencies into the FMU using -:ref:`--fmuRuntimeDepends`. -The default value *modelica* will include every external libraries mentioned by an annotation -as well as its dependencies (recursive). The system default locations are excluded. + * ``none``: Adds no runtime dependencies to FMU. The FMU can't be used on a system if it + doesn't provided all needed dependencies. + + * ``modelica`` (default): Add Modelica runtime dependencies to FMU, e.g. a external C + library used from a Modelica function. Needs CMake version v3.21 or newer. + + * ``all``: Add system and Modelica runtime dependencies. Needs CMake version v3.21 or + newer. + +* ``NEED_CVODE``: + Boolean value to integrate CVODE integrator into CoSimulation FMU. + + * ``ON``: Link to SUNDIALS CVODE. If CVODE is not in a default location + ``CVODE_DIRECTORY`` needs to be set. + Its also recommended to use ``RUNTIME_DEPENDENCIES_LEVEL=modelica`` or higher to add + SUNDIALS runtime dependencies into the FMU. + + * ``OFF`` (default): Don't link to SUNDIALS CVODE. + +* ``CVODE_DIRECTORY``: + String value with location of libraries ``sundials_cvode`` and ``sundials_nvecserial`` + with SUNDIALS version 5.4.0. + + * Defaults to a location inside the OpenModelica installation directory, which was + used to create the FMU. + + +Then use CMake to configure, build and install the FMU. +To repack the FMU after installation use custom target ``create_zip``. + +For example to re-compile the FMU with cmake and runtime dependencies use: + +.. code-block:: bash + + $ unzip BouncingBall.fmu -d BouncingBall_FMU + $ cd BouncingBall_FMU/sources + $ cmake -S . -B build_cmake \ + -D RUNTIME_DEPENDENCIES_LEVEL=modelica \ + -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++ + $ cmake --build build_cmake --target install create_zip --parallel + +.. _fmitlm-export-options : + +Platforms +~~~~~~~~~ + +The ``platforms`` setting specifies for what target system the FMU is compiled: + +* Empty: Create a Source-Code-only FMU. + +* ``native``: Create a FMU compiled for the exporting system. + +* ``--`` host triple: OpenModelica searches for programs in PATH matching + pattern ``--cc`` to compile. + E.g. ``x86_64-linux-gnu`` for a 64 bit Linux OS or ``i686-w64-mingw32`` for a 32 bit + Windows OS using MINGW. + +* ``-- docker run `` Host triple with Docker image: + OpenModelica will use the specified Docker image to cross-compile for given host triple. + Because privilege escalation is very easy to achieve with Docker OMEdit adds + ``--pull=never`` to the Docker calls for the ``multiarch/crossbuild`` images. Only use + this option if you understand the security risks associated with Docker images from + unknown sources. + E.g. ``x86_64-linux-gnu docker run --pull=never multiarch/crossbuild`` to cross-compile + for a 64 bit Linux OS. + Because system libraries can be different for different versions of the same operating + system, it is advised to use :ref:`--fmuRuntimeDepends=all`. -The minimum CMake version required is v3.21. .. _fmi-import : -FMI Import -~~~~~~~~~~ +FMI Import - SSP +~~~~~~~~~~~~~~~~ If you want to simulate a single, stand-alone FMU, or possibly a connection of several FMUs, the recommended tool to do that is OMSimulator, see the -`OMSimulator documentation `_ -for further information. +:ref:`OMSimulator documentation` and +:ref:`omedit-graphical-modelling` for further information. + +FMI Import - Non-Standard Modelica Model +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FMI Import allows to use an FMU, generated according to the FMI for Model Exchange 2.0 standard, as a component in a Modelica model. This can be -useful if the FMU describes the behaviour of a component or sub-system in a +useful if the FMU describes the behavior of a component or sub-system in a structured Modelica model, which is not easily turned into a pure FMI-based model that can be handled by OMSimulator. @@ -130,28 +230,29 @@ a declarative description; this means that not all conceivable FMUs can be succe imported as Modelica models. Also, the current implementation of FMU import in OpenModelica is still somewhat experimental and not guaranteed to work in all cases. However, if the FMU-ME you want to import was exported from a Modelica model -and only represents continuous time dynamic behaviour, it should work without problems +and only represents continuous time dynamic behavior, it should work without problems when imported as a Modelica block. Please also note that the current implementation of FMI Import in OpenModelica is based on a built-in wrapper that uses a `reinit()` statement in an algorithm section. This is not allowed by the Modelica Language Specification, so it is necessary to set the compiler to accept this non-standard construct by setting -the `--allowNonStandardModelica=reinitInAlgorithms` compiler flag. In OMEdit, -you can set this option by activating the *Enable FMU Import* checkbox in the +the :ref:`--allowNonStandardModelica=reinitInAlgorithms` +compiler flag. +In OMEdit, you can set this option by activating the *Enable FMU Import* checkbox in the *Tools | Options | Simulation | Translation Flags* tab. This will generate a warning during compilation, as there is no guarantee that the imported model using this feature can be ported to other Modelica tools; if you want to use a model that contains imported FMUs in another Modelica tool, you should rely on the other tool's import feature to generate the Modelica blocks corresponding to the FMUs. -After setting the `--allowNonStandardModelica` flag, to import the FMU package -use the OpenModelica command importFMU, +After setting the :ref:`--allowNonStandardModelica` +flag, to import the FMU package use the OpenModelica command importFMU, .. omc-mos :: :parsed: - list(OpenModelica.Scripting.importFMU, interfaceOnly=true) + list(OpenModelica.Scripting.importFMU, interfaceOnly=true); The command could be used from command line interface, OMShell, OMNotebook or MDT. The importFMU command is also integrated with OMEdit @@ -170,9 +271,11 @@ co-simulation accessible via OMEdit. The TLM Based co-simulation provides the following general functionalities: -- Import and add External non-Modelica models such as **Matlab/SimuLink**, **Adams**, and **BEAST** models +- Import and add External non-Modelica models such as **Matlab/SimuLink**, **Adams**, + and **BEAST** models -- Import and add External Modelica models e.g. from tools such as **Dymola** or **Wolfram SystemModeler**, etc. +- Import and add External Modelica models e.g. from tools such as **Dymola** or + **Wolfram SystemModeler**, etc. - Specify startup methods and interfaces of the external model @@ -200,8 +303,8 @@ Loading a Composite Model for Co-Simulation To load the composite model, select **File > Open Composite Model(s)** from the menu and select compositemodel.xml. -OMEdit loads the composite model and show it in the **Libraries -Browser**. Double-clicking the composite model in the **Libraries Browser** will display +OMEdit loads the composite model and show it in the **Libraries Browser**. +Double-clicking the composite model in the **Libraries Browser** will display the composite model as shown below in :numref:`tlm-double-pendulum-compositemodel`. @@ -215,13 +318,16 @@ Co-Simulating the Composite Model There are two ways to start co-simulation: -- Click **TLM Co-Simulation setup button** (|tlm-simulate|) from the toolbar (requires a composite model to be active in ModelWidget) +- Click **TLM Co-Simulation setup button** (|tlm-simulate|) from the toolbar (requires a + composite model to be active in ModelWidget) .. |tlm-simulate| image:: media/omedit-icons/tlm-simulate.* :alt: Composite Model simulate Icon :height: 14pt -- Right click the composite model in the **Libraries Browser** and choose **TLM Co-Simulation setup** from the popup menu (see :numref:`tlm-library-browser-popup-menu`) +- Right click the composite model in the **Libraries Browser** and choose + **TLM Co-Simulation setup** from the popup menu (see + :numref:`tlm-library-browser-popup-menu`) .. figure :: media/tlm-library-browser-popup-menu.png :name: tlm-library-browser-popup-menu @@ -244,16 +350,19 @@ the progress information of the running co-simulation. TLM Co-Simulation Progress. -The editor also provides the means of reading the log files generated by the simulation manager and monitor. -When the simulation ends, click **Open Manager Log File** or **Open Monitor Log File** from the co-simulation progress bar -to check the log files. +The editor also provides the means of reading the log files generated by the simulation +manager and monitor. +When the simulation ends, click **Open Manager Log File** or **Open Monitor Log File** +from the co-simulation progress bar to check the log files. Plotting the Simulation Results ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When the co-simulation of the composite model is completed successful, simulation results are collected and visualized -in the OMEdit plotting perspective as shown in :numref:`tlm-plotting-cosimulation-results` and :numref:`tlm-cosimulation-visualization`. -The **Variables Browser** display variables that can be plotted. Each variable has a checkbox, checking it will plot the variable. +When the co-simulation of the composite model is completed successful, simulation results +are collected and visualized in the OMEdit plotting perspective as shown in +:numref:`tlm-plotting-cosimulation-results` and :numref:`tlm-cosimulation-visualization`. +The **Variables Browser** display variables that can be plotted. Each variable has a +checkbox, checking it will plot the variable. .. figure :: media/tlm-plotting-cosimulation-results.png :name: tlm-plotting-cosimulation-results @@ -270,7 +379,8 @@ Preparing External Models First step in co-simulation Modeling is to prepare the different external simulation models with TLM interfaces. Each external model belongs to a specific simulation -tool, such as **MATLAB/Simulink***, **BEAST**, **MSC/ADAMS**, **Dymola** and **Wolfram SystemModeler**. +tool, such as **MATLAB/Simulink***, **BEAST**, **MSC/ADAMS**, **Dymola** and +**Wolfram SystemModeler**. When the external models have all been prepared, the next step is to load external models in OMEdit by selecting the **File > Load External Model(s)** from the menu. @@ -328,7 +438,8 @@ Fetching Submodels Interface Data To retrieve list of TLM interface data for sub-models, do any of the following methods: -- Click **Fetch Interface Data button** (|interface-data|) from the toolbar (requires a composite model to be active in ModelWidget) +- Click **Fetch Interface Data button** (|interface-data|) from the toolbar (requires a + composite model to be active in ModelWidget) .. |interface-data| image:: media/omedit-icons/interface-data.* :alt: Composite Model Interface Data Icon diff --git a/doc/UsersGuide/source/githubreleases.py b/doc/UsersGuide/source/githubreleases.py index 72d80fd4eae..837000763d7 100644 --- a/doc/UsersGuide/source/githubreleases.py +++ b/doc/UsersGuide/source/githubreleases.py @@ -24,7 +24,7 @@ fout.write("\n") print(release.title) fout.close() -call(["pandoc", "--wrap=none", "-f", "gfm", "-t", "rst", "--base-header-level=2", "-o", "githubreleases.tmp.rst", "githubreleases.md"]) +call(["pandoc", "--wrap=none", "--standalone", "-f", "gfm", "-t", "rst", "--base-header-level=2", "-o", "githubreleases.tmp.rst", "githubreleases.md"]) with open("githubreleases.tmp.rst", "r", encoding="utf-8") as fin: with open("githubreleases.tmp2.rst", "w", encoding="utf-8") as fout: fout.write('''Major OpenModelica Releases @@ -38,3 +38,4 @@ fout.write("\n") fout.write(".. include :: tracreleases.inc") os.rename("githubreleases.tmp2.rst", "githubreleases.rst") +os.remove("githubreleases.tmp.rst") diff --git a/doc/UsersGuide/source/interop_c_python.rst b/doc/UsersGuide/source/interop_c_python.rst index 80273b8224c..88652eb15f9 100644 --- a/doc/UsersGuide/source/interop_c_python.rst +++ b/doc/UsersGuide/source/interop_c_python.rst @@ -1,6 +1,6 @@ .. _interop-c : -Interoperability – C and Python +Interoperability - C and Python =============================== Below is information and examples about the OpenModelica external C diff --git a/doc/UsersGuide/source/introduction.rst b/doc/UsersGuide/source/introduction.rst index 2620a45d761..4e7c3bf5a7e 100644 --- a/doc/UsersGuide/source/introduction.rst +++ b/doc/UsersGuide/source/introduction.rst @@ -176,7 +176,7 @@ Interactive Session with Examples --------------------------------- The following is an interactive session using the interactive session -handler in the OpenModelica environment, called OMShell – the +handler in the OpenModelica environment, called OMShell - the OpenModelica Shell. Most of these examples are also available in the :ref:`omnotebook` UsersGuideExamples.onb as well as the testmodels in: @@ -450,7 +450,7 @@ Now, first clear all loaded libraries and models: clear() -List the loaded models – nothing left: +List the loaded models - nothing left: .. omc-mos :: @@ -960,13 +960,13 @@ Running the compiler from command line The OpenModelica compiler can also be used from command line, in Windows cmd.exe or a Unix shell. The following examples assume omc is on the PATH; if it is not, you can run :code:`C:\\OpenModelica 1.16.0\\build\\bin\\omc.exe` or similar (depending on where you installed OpenModelica). -Example Session 1 – obtaining information about command line parameters +Example Session 1 - obtaining information about command line parameters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. command-output :: omc --help :ellipsis: 6,-2 -Example Session 2 – create an TestModel.mo file and run omc on it +Example Session 2 - create an TestModel.mo file and run omc on it ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. literalinclude:: TestModel.mo @@ -974,7 +974,7 @@ Example Session 2 – create an TestModel.mo file and run omc on it .. command-output :: omc TestModel.mo -Example Session 3 – create a mos-script and run omc on it +Example Session 3 - create a mos-script and run omc on it ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. literalinclude:: TestScript.mos diff --git a/doc/UsersGuide/source/mdt.rst b/doc/UsersGuide/source/mdt.rst index 8f9c218ed2a..e8806433219 100644 --- a/doc/UsersGuide/source/mdt.rst +++ b/doc/UsersGuide/source/mdt.rst @@ -1,4 +1,4 @@ -MDT – The OpenModelica Development Tooling Eclipse Plugin +MDT - The OpenModelica Development Tooling Eclipse Plugin ========================================================= .. role:: bash(code) @@ -7,7 +7,7 @@ MDT – The OpenModelica Development Tooling Eclipse Plugin Introduction ------------ -The Modelica Development Tooling (MDT) Eclipse Plugin as part of OMDev – +The Modelica Development Tooling (MDT) Eclipse Plugin as part of OMDev - The OpenModelica Development Environment integrates the OpenModelica compiler with Eclipse. MDT, together with the OpenModelica compiler, provides an environment for working with Modelica and MetaModelica @@ -47,22 +47,22 @@ The latest installation instructions are available through the `OpenModelica Tra 2. Select Help->Software Updates->Find and Install.\ **..** from the menu -3. Select ‘Search for new features to install’ and click ‘Next’ +3. Select 'Search for new features to install' and click 'Next' -4. Select ‘New Remote Site...’ +4. Select 'New Remote Site...' -5. Enter ‘MDT’ as name and +5. Enter 'MDT' as name and http://www.ida.liu.se/labs/pelab/modelica/OpenModelica/MDT - as URL and click ‘OK’ + as URL and click 'OK' -6. Make sure ‘MDT’ is selected and click ‘Finish’ +6. Make sure 'MDT' is selected and click 'Finish' -7. In the updates dialog select the ‘MDT’ feature and click ‘Next’ +7. In the updates dialog select the 'MDT' feature and click 'Next' -8. Read through the license agreement, select ‘I accept...’ and click - ‘Next’ +8. Read through the license agreement, select 'I accept...' and click + 'Next' -9. Click ‘Finish’ to install MDT +9. Click 'Finish' to install MDT Getting Started --------------- @@ -76,8 +76,8 @@ environment variable OPENMODELICAHOME to do so. If you have problems using MDT, make sure that OPENMODELICAHOME is pointing to the folder where the OpenModelica Compiler is installed. In other words, OPENMODELICAHOME must point to the folder that contains the -Open Modelica Compiler (OMC) binary. On the Windows platform it’s called -omc.exe and on Unix platforms it’s called omc. +Open Modelica Compiler (OMC) binary. On the Windows platform it's called +omc.exe and on Unix platforms it's called omc. Using the Modelica Perspective ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -96,7 +96,7 @@ choose a workspace folder for this session, see :numref:`mdt-switch-workspace`. .. figure :: media/mdt-switch-workspace.png :name: mdt-switch-workspace - Eclipse Setup – Switching Workspace. + Eclipse Setup - Switching Workspace. Creating one or more Modelica Projects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -107,14 +107,14 @@ the Modelica Projects view and selecting New->Modelica Project. .. figure :: media/mdt-create-project.* - Eclipse Setup – creating a Modelica project in the workspace. + Eclipse Setup - creating a Modelica project in the workspace. You need to disable automatic build for the project(s) (:numref:`mdt-disable-automatic-build`). .. figure :: media/mdt-disable-automatic-build.png :name: mdt-disable-automatic-build - Eclipse Setup – disable automatic build for the projects. + Eclipse Setup - disable automatic build for the projects. Repeat the procedure for all the projects you need, e.g. for the exercises described in the MetaModelica users guide: 01\_experiment, @@ -132,7 +132,7 @@ After having created a project, you eventually need to build the project .. figure :: media/mdt-build-project.png :name: mdt-build-project - Eclipse MDT – Building a project. + Eclipse MDT - Building a project. The build options are the same as the make targets: you can build, build from scratch (clean), or run simulations depending on how the @@ -142,11 +142,11 @@ can be compiled (:bash:`make omc` builds OMC). .. figure :: media/mdt-build-prompt.* :name: mdt-build-prompt - Eclipse – building a project. + Eclipse - building a project. .. figure :: media/mdt-build-log.png - Eclipse – building a project, resulting log. + Eclipse - building a project, resulting log. Switching to Another Perspective ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -158,7 +158,7 @@ in :numref:`mdt-switch-perspective`. .. figure :: media/mdt-switch-perspective.png :name: mdt-switch-perspective - Eclipse – Switching to another perspective – e.g. the Java Perspective. + Eclipse - Switching to another perspective - e.g. the Java Perspective. Creating a Package ~~~~~~~~~~~~~~~~~~ @@ -181,8 +181,8 @@ creating a Modelica class you can add different restrictions on what the class can contain. These can for example be model, connector, block, record, or function. When you have selected your desired class type, you can select modifiers that add code blocks to the generated code. -‘Include initial code block’ will for example add the line ‘initial -equation’ to the class. +'Include initial code block' will for example add the line 'initial +equation' to the class. .. figure :: media/mdt-create-class.png diff --git a/doc/UsersGuide/source/mdtdebugger.rst b/doc/UsersGuide/source/mdtdebugger.rst index 08169fdb65b..d8d2378c6ec 100644 --- a/doc/UsersGuide/source/mdtdebugger.rst +++ b/doc/UsersGuide/source/mdtdebugger.rst @@ -31,14 +31,14 @@ The debugger provides the following general functionalities: - Adding/Removing breakpoints. -- Step Over – moves to the next line, skipping the function calls. +- Step Over - moves to the next line, skipping the function calls. -- Step In – takes the user into the function call. +- Step In - takes the user into the function call. -- Step Return – complete the execution of the function and takes the +- Step Return - complete the execution of the function and takes the user back to the point from where the function is called. -- Suspend – interrupts the running program. +- Suspend - interrupts the running program. .. figure :: media/mdt-debugger-overview.png @@ -156,13 +156,13 @@ frame is shown as . The Variables view shows the list of variables at a certain point in the program, containing four colums: -- Name – the variable name. +- Name - the variable name. -- Declared Type – the Modelica type of the variable. +- Declared Type - the Modelica type of the variable. -- Value – the variable value. +- Value - the variable value. -- Actual Type – the mapped C type. +- Actual Type - the mapped C type. By preserving the stack frames and variables it is possible to keep track of the variables values. If the value of any variable is changed diff --git a/doc/UsersGuide/source/media/fmiExport.png b/doc/UsersGuide/source/media/fmiExport.png old mode 100644 new mode 100755 index ef23ff0ba45..f0ff2050281 Binary files a/doc/UsersGuide/source/media/fmiExport.png and b/doc/UsersGuide/source/media/fmiExport.png differ diff --git a/doc/UsersGuide/source/omedit.rst b/doc/UsersGuide/source/omedit.rst index c09eb4a0326..9a4141ebded 100644 --- a/doc/UsersGuide/source/omedit.rst +++ b/doc/UsersGuide/source/omedit.rst @@ -1,7 +1,7 @@ -OMEdit – OpenModelica Connection Editor +OMEdit - OpenModelica Connection Editor ======================================= -OMEdit – OpenModelica Connection Editor is the new Graphical User +OMEdit - OpenModelica Connection Editor is the new Graphical User Interface for graphical model editing in OpenModelica. It is implemented in C++ using the Qt graphical user interface library and supports the Modelica Standard Library that is included in the latest @@ -12,21 +12,21 @@ editor. OMEdit provides several user friendly features for creating, browsing, editing, and simulating models: -- *Modeling* – Easy model creation for Modelica models. +- *Modeling* - Easy model creation for Modelica models. -- *Pre-defined models* – Browsing the Modelica Standard library to +- *Pre-defined models* - Browsing the Modelica Standard library to access the provided models. -- *User defined models* – Users can create their own models for +- *User defined models* - Users can create their own models for immediate usage and later reuse. -- *Component interfaces* – Smart connection editing for drawing and +- *Component interfaces* - Smart connection editing for drawing and editing connections between model interfaces. -- *Simulation* – Subsystem for running simulations and specifying +- *Simulation* - Subsystem for running simulations and specifying simulation parameters start and stop time, etc. -- *Plotting* – Interface to plot variables from simulated models. +- *Plotting* - Interface to plot variables from simulated models. Starting OMEdit --------------- @@ -173,7 +173,7 @@ See section :ref:`omedit-options-messages` for Messages Browser options. Perspectives ------------ -The perspective tabs are loacted at the bottom right of the MainWindow: +The perspective tabs are located at the bottom right of the Main Window: - Welcome Perspective @@ -200,7 +200,7 @@ See section :ref:`omedit-options-general`. Modeling Perspective ~~~~~~~~~~~~~~~~~~~~ -The Modeling Perpective provides the interface where user can create and +The Modeling Perspective provides the interface where user can create and design their models. See :numref:`omedit-modeling-perspective`. .. figure :: media/omedit-modeling-perspective.png @@ -209,7 +209,7 @@ design their models. See :numref:`omedit-modeling-perspective`. OMEdit Modeling Perspective. The Modeling Perspective interface can be viewed in two different modes, -the tabbed view and subwindow view, see section :ref:`omedit-options-general`. +the tabbed view and sub-window view, see section :ref:`omedit-options-general`. Plotting Perspective ~~~~~~~~~~~~~~~~~~~~ @@ -217,9 +217,9 @@ Plotting Perspective The Plotting Perspective shows the simulation results of the models. Plotting Perspective will automatically become active when the simulation of the model is finished successfully. It will also become -active when user opens any of the OpenModelica’s supported result file. +active when user opens any of the OpenModelica's supported result file. Similar to Modeling Perspective this perspective can also be viewed in -two different modes, the tabbed view and subwindow view, see section +two different modes, the tabbed view and sub-window view, see section :ref:`omedit-options-general`. .. figure :: media/omedit-plotting-perspective.png @@ -230,9 +230,9 @@ two different modes, the tabbed view and subwindow view, see section Debugging Perspective ~~~~~~~~~~~~~~~~~~~~~ -The application automatically switches to Debugging Perpective +The application automatically switches to Debugging Perspective when user simulates the class with algorithmic debugger. -The prespective shows the list of stack frames, breakpoints and variables. +The perspective shows the list of stack frames, breakpoints and variables. .. figure :: media/omedit-debugging-perspective.png :name: omedit-debugging-perspective @@ -243,56 +243,103 @@ File Menu --------- - *New* + - *New Modelica Class* - Creates a new Modelica class. + - *New SSP Model* - Creates a new SSP model. + - *Open Model/Library File(s)* - Opens the Modelica file or a library. + - *Open/Convert Modelica File(s) With Encoding* - Opens the Modelica file or a library with a specific encoding. It is also possible to convert to UTF-8. + - *Load Library* - Loads a Modelica library. Allows the user to select the library path assuming that the path contains a package.mo file. + - *Load Encrypted Library* - Loads an encrypted library. see :ref:`encryption` + - *Open Result File(s)* - Opens a result file. + - *Open Transformations File* - Opens a transformational debugger file. + - *Unload All* - Unloads all loaded classes. + - *New Composite Model* - Creates a new composite model. + - *Open Composite Model(s)* - Loads an existing composite model. + - *Load External Model(s)* - Loads the external models that can be used within composite model. + - *Open Directory* - Loads the files of a directory recursively. The files are loaded as text files. + - *Save* - Saves the class. + - *Save As* - Save as the class. -- *Save Total* - Saves the class and all the classes it uses in a single file. The class and its dependencies can only be loaded later by using the *loadFile()* API function in a script. Allows third parties to reproduce an issue with a class without worrying about library dependencies. + +- *Save Total* - Saves the class and all the classes it uses in a single file. + The class and its dependencies can only be loaded later by using the *loadFile()* API + function in a script. Allows third parties to reproduce an issue with a class without + worrying about library dependencies. + - *Import* + - *FMU* - Imports the FMU. + - *FMU Model Description* - Imports the FMU model description. + - *From OMNotbook* - Imports the Modelica models from OMNotebook. + - *Ngspice netlist* - Imports the ngspice netlist to Modelica code. -- "Export" + +- *Export* + - *To Clipboard* - Exports the current model to clipboard. + - *Image* - Exports the current model to image. + - *FMU* - Exports the current model to FMU. + - *Read-only Package* - Exports a zipped Modelica library with file extension .mol + - *Encrypted Package* - Exports an encrypted package. see :ref:`encryption` + - *XML* - Exports the current model to a xml file. + - *Figaro* - Exports the current model to Figaro. + - *To OMNotebook* - Exports the current model to a OMNotebook file. + - *System Libraries* - Contains a list of system libraries. + - *Manage Libraries* - - *Install Library* - Opens a dialog to select and install a new library. see :ref:`omedit-install-library-label` + + - *Install Library* - Opens a dialog to select and install a new library, + see :ref:`omedit-install-library-label` + - *Upgrade Installed Libraries* - Opens a dialog to upgrade the installed libraries. + - *Update Library Index* - Updates the library index. + - *Recent Files* - Contains a list of recent files. + - *Clear Recent Files* - Clears the list of recent files. + - *Print* - Prints the current model. + - *Quit* - Quit the OpenModelica Connection Editor. + Edit Menu --------- - *Undo* - Undoes the last change. + - *Redo* - Redoes the last undone change. -- *Filter Classes* - Filters the classes in Libraries Browser. see :ref:`omedit-filter-classes` + +- *Filter Classes* - Filters the classes in Libraries Browser, + see :ref:`omedit-filter-classes` .. _omedit-view-menu : @@ -300,44 +347,73 @@ View Menu --------- - *Toolbars* - Toggle visibility of toolbars. + - *Windows* - Toggle visibility of windows. + - *Close Window* - Closes the current model window. + - *Close All Windows* - Closes all the model windows. + - *Close All Windows But This* - Closes all the model windows except the current. + - *Cascade Windows* - Arranges all the child windows in a cascade pattern. + - *Tile Windows Horizontally* - Arranges all child windows in a horizontally tiled pattern. + - *Tile Windows Vertically* - Arranges all child windows in a vertically tiled pattern. -- *Toggle Tab/Sub-window View* - Switches between tab and subwindow view. + +- *Toggle Tab/SubWindow View* - Switches between tab and sub-window view. + - *Grid Lines* - Toggle grid lines of the current model. + - *Reset Zoom* - Resets the zoom of the current model. + - *Zoom In* - Zoom in the current model. + - *Zoom Out* - Zoom out the current model. + - *Fit to Diagram* - Fit the current model diagram in the view. + SSP Menu -------- - *Add System* - Adds the system to a model. + - *Add/Edit Icon* - Add/Edit the system/submodel icon. + - *Delete Icon* - Deletes the system/submodel icon. + - *Add Connector* - Adds a connector to a system/submodel. + - *Add Bus* - Adds a bus to a system/submodel. + - *Add TLM Bus* - Adds a TLM bus to a system/submodel. + - *Add SubModel* - Adds a submodel to a system. + Simulation Menu --------------- - *Check Model* - Checks the current model. + - *Check All Models* - Checks all the models of a library. + - *Instantiate Model* - Instantiates the current model. + - *Simulation Setup* - Opens the simulation setup window. + - *Simulate* - Simulates the current model. + - *Simulate with Transformational Debugger* - Simulates the current model and opens the transformational debugger. + - *Simulate with Algorithmic Debugger* - Simulates the current model and opens the algorithmic debugger. + - *Simulate with Animation* - Simulates the current model and open the animation. + - *Archived Simulations* - Shows the list of simulations already finished or running. Double clicking on any of them opens the simulation output window. @@ -362,23 +438,36 @@ Tools Menu - *OpenModelica Compiler CLI* - Opens the OpenModelica Compiler command line interface window. + - *OpenModelica Command Prompt* - Opens the OpenModelica Command Prompt (Only available on Windows). + - *Open Temporary Directory* - Opens the current temporary directory. + - *Open Working Directory* - Opens the current working directory. + - *Open Terminal* - Runs the terminal command set in :ref:`omedit-options-general`. + - *Options* - Opens the options window. Help Menu --------- - *OpenModelica User's Guide* - Opens the OpenModelica User's Guide. + - *OpenModelica User's Guide (PDF)* - Opens the OpenModelica User's Guide (PDF). + - *OpenModelica System Documentation* - Opens the OpenModelica System Documentation. + - *OpenModelica Scripting Documentation* - Opens the OpenModelica Scripting Documentation. + - *Modelica Documentation* - Opens the Modelica Documentation. + - *OMSimulator User's Guide* - Opens the OMSimulator User's Guide. -- *OpenModelica TLM Simulator Documentation* - Opens the OpenModelica TLM Simulator Documentation. + +- *OpenModelica TLM Simulator Documentation* - Opens the OpenModelica TLM Simulator + Documentation. + - *About OMEdit* - Shows the information about OpenModelica Connection Editor. Modeling a Model @@ -449,7 +538,8 @@ In order to connect one component model to another the user first needs to enable the connect mode (|connect-mode|) from the toolbar. Move the mouse over the connector. The mouse cursor will change from arrow cursor to cross cursor. -To start the connection press left button and move while keeping the button pressed. Now release the left button. +To start the connection press left button and move while keeping the button pressed. +Now release the left button. Move towards the end connector and click when cursor changes to cross cursor. .. |connect-mode| image:: media/omedit-icons/connect-mode.* @@ -461,23 +551,29 @@ Simulating a Model The simulation process in OMEdit is split into three main phases: -#. The Modelica model is translated into C/C++ code. The model is first instantiated by the - frontend, which turns it into a flat set of variables, parameters, equations, +#. The Modelica model is translated into C/C++ code. The model is first instantiated by + the frontend, which turns it into a flat set of variables, parameters, equations, algorithms, and functions. The backend then analyzes the mathematical structure - of the flat model, applies symbolic simplifications and determines how the equations can be solved efficiently. - Finally, based on this information, model-specific C/C++ code is generated. This part of - the process can be influenced by setting :ref:`Translation Flags ` (a.k.a. *Command Line Options*), - e.g. deciding which kind of structural simplifications should be performed during the translation phase. -#. The C/C++ code is compiled and linked into an executable simulation code. Additional :ref:`C/C++ compiler flags ` - can be given to influence this part of the process, e.g. by setting compiler optimizations - such as ``-O3``. Since multiple C/C++ source code files are generated for a given model, they - are compiled in parallel by OMEdit, exploiting the power of multi-core CPUs. + of the flat model, applies symbolic simplifications and determines how the equations + can be solved efficiently. + Finally, based on this information, model-specific C/C++ code is generated. This part + of the process can be influenced by setting + :ref:`Translation Flags ` (a.k.a. + *Command Line Options*), e.g. deciding which kind of structural simplifications should + be performed during the translation phase. + +#. The C/C++ code is compiled and linked into an executable simulation code. Additional + :ref:`C/C++ compiler flags ` can be given to influence this + part of the process, e.g. by setting compiler optimizations such as ``-O3``. + Since multiple C/C++ source code files are generated for a given model, they are + compiled in parallel by OMEdit, exploiting the power of multi-core CPUs. + #. The simulation executable is started and produces the simulation results in a `.mat` or - `.csv` file. The runtime behaviour can be influenced by *Simulation Flags*, e.g. by choosing - specific solvers, or changing the output file name. Note that it it possible to re-simulate a model - multiple times, changing parameter values from the Variables Browser and/or changing some - Simulation Flags. In this case, only Phase 3. is repeated, skipping Phases 1. and 2., which - enables much faster iterations. + `.csv` file. The runtime behavior can be influenced by *Simulation Flags*, e.g. by + choosing specific solvers, or changing the output file name. Note that it it possible + to re-simulate a model multiple times, changing parameter values from the Variables + Browser and/or changing some Simulation Flags. In this case, only Phase 3. is repeated, + skipping Phases 1. and 2., which enables much faster iterations. The simulation options for each model are stored inside the OMEdit data structure. They are set according to the following sequence, @@ -492,7 +588,8 @@ They are set according to the following sequence, - After that all the changes done via Simulation Setup window for a certain model are preserved for the whole session. If you want to use the same settings in - future sessions then you should store them inside ``experiment``, ``__OpenModelica_commandLineOptions``, and ``__OpenModelica_simulationFlags`` + future sessions then you should store them inside ``experiment``, + ``__OpenModelica_commandLineOptions``, and ``__OpenModelica_simulationFlags`` annotations. The OMEdit Simulation Setup can be launched by, @@ -511,19 +608,19 @@ General - Simulation Interval - - *Start Time* – the simulation start time. + - *Start Time* - the simulation start time. - - *Stop Time* – the simulation stop time. + - *Stop Time* - the simulation stop time. - - *Number of Intervals* – the simulation number of intervals. + - *Number of Intervals* - the simulation number of intervals. - - *Interval* – the length of one interval (i.e., stepsize) + - *Interval* - the length of one interval (i.e., stepsize) - Integration - - *Method* – the simulation solver. See section :ref:`cruntime-integration-methods` for solver details. + - *Method* - the simulation solver. See section :ref:`cruntime-integration-methods` for solver details. - - *Tolerance* – the simulation tolerance. + - *Tolerance* - the simulation tolerance. - *Jacobian* - the jacobian method to use. @@ -541,22 +638,23 @@ General .. _omedit-C-Compiler-flags : -- *C/C++ Compiler Flags (Optional)* – the optional C/C++ compiler flags. +- *C/C++ Compiler Flags (Optional)* - the optional C/C++ compiler flags. -- *Number of Processors* – the number of processors used to build the simulation. +- *Number of Processors* - the number of processors used to build the simulation. -- *Build Only* – only builds the class. +- *Build Only* - only builds the class. -- *Launch Transformational Debugger* – launches the transformational debugger. +- *Launch Transformational Debugger* - launches the transformational debugger. -- *Launch Algorithmic Debugger* – launches the algorithmic debugger. +- *Launch Algorithmic Debugger* - launches the algorithmic debugger. -- *Launch Animation* – launches the 3d animation window. +- *Launch Animation* - launches the 3d animation window. :ref:`omedit-interactive` -~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~ -- Simulate with steps (makes the interactive simulation synchronous; plots nicer curves at the expense of performance) +- Simulate with steps (makes the interactive simulation synchronous; plots nicer curves + at the expense of performance) - Simulation server port @@ -566,93 +664,146 @@ General Simulation Flags ~~~~~~~~~~~~~~~~ -- *Model Setup File (Optional)* – specifies a new setup XML file to the generated simulation code. +- *Model Setup File (Optional)* - specifies a new setup XML file to the generated + simulation code. -- *Initialization Method (Optional)* – specifies the initialization method. +- *Initialization Method (Optional)* - specifies the initialization method. -- *Equation System Initialization File (Optional)* – specifies an +- *Equation System Initialization File (Optional)* - specifies an external file for the initialization of the model. -- *Equation System Initialization Time (Optional)* – specifies a time +- *Equation System Initialization Time (Optional)* - specifies a time for the initialization of the model. -- *Clock (Optional)* – the type of clock to use. +- *Clock (Optional)* - the type of clock to use. -- *Linear Solver (Optional)* – specifies the linear solver method. +- *Linear Solver (Optional)* - specifies the linear solver method. -- *Non Linear Solver (Optional)* – specifies the nonlinear solver. +- *Non Linear Solver (Optional)* - specifies the nonlinear solver. -- *Linearization Time (Optional)* – specifies a time where the +- *Linearization Time (Optional)* - specifies a time where the linearization of the model should be performed. -- *Output Variables (Optional)* – outputs the variables a, b and c at +- *Output Variables (Optional)* - outputs the variables a, b and c at the end of the simulation to the standard output. -- *Profiling* – creates a profiling HTML file. +- *Profiling* - creates a profiling HTML file. -- *CPU Time* – dumps the cpu-time into the result file. +- *CPU Time* - dumps the cpu-time into the result file. -- *Enable All Warnings* – outputs all warnings. +- *Enable All Warnings* - outputs all warnings. - *Logging (Optional)* - - *LOG_STDOUT* - standard output stream. This stream is always active, can be disabled with -lv=-LOG_STDOUT + - *LOG_STDOUT* - standard output stream. This stream is always active, can be disabled + with -lv=-LOG_STDOUT + - *LOG_ASSERT* - This stream is always active, can be disabled with -lv=-LOG_ASSERT + - *LOG_DASSL* - additional information about dassl solver. + - *LOG_DASSL_STATES* - outputs the states at every dassl call. + - *LOG_DEBUG* - additional debug information. + - *LOG_DELAY* - Debug information for delay operator. + - *LOG_DIVISION* - Log division by zero. + - *LOG_DSS* - outputs information about dynamic state selection. + - *LOG_DSS_JAC* - outputs jacobian of the dynamic state selection. + - *LOG_DT* - additional information about dynamic tearing. + - *LOG_DT_CONS* - additional information about dynamic tearing (local and global constraints). + - *LOG_EVENTS* - additional information during event iteration. + - *LOG_EVENTS_V* - verbose logging of event system. + - *LOG_GBODE* - Information about GBODE solver. + - *LOG_GBODE_V* - Verbose information about GBODE solver. + - *LOG_GBODE_NLS* - Log non-linear solver process of GBODE solver. + - *LOG_GBODE_NLS_V* - Verbose log non-linear solver process of GBODE solver. + - *LOG_GBODE_STATES* - Output states at every GBODE call. + - *LOG_INIT* - additional information during initialization. + - *LOG_INIT_HOMOTOPY* - Log homotopy initialization. + - *LOG_INIT_V* - Verbose information during initialization. + - *LOG_IPOPT* - information from Ipopt. + - *LOG_IPOPT_FULL* - more information from Ipopt. + - *LOG_IPOPT_JAC* - check jacobian matrix with Ipopt. + - *LOG_IPOPT_HESSE* - check hessian matrix with Ipopt. + - *LOG_IPOPT_ERROR* - print max error in the optimization. + - *LOG_JAC* - Outputs the jacobian matrix used by ODE solvers. + - *LOG_LS* - logging for linear systems. + - *LOG_LS_V* - verbose logging of linear systems. + - *LOG_NLS* - logging for nonlinear systems. + - *LOG_NLS_V* - verbose logging of nonlinear systems. + - *LOG_NLS_HOMOTOPY* - logging of homotopy solver for nonlinear systems. + - *LOG_NLS_JAC* - outputs the jacobian of nonlinear systems. + - *LOG_NLS_JAC_TEST* - tests the analytical jacobian of nonlinear systems. - - *LOG_NLS_NEWTON_DIAG* - Log Newton diagnostics. A Diagnostic method to figure out which individual initial guess values are more likely to be causing the convergence failure of Newton-type iterative nonlinear solvers. + + - *LOG_NLS_NEWTON_DIAG* - Log Newton diagnostics. A Diagnostic method to figure out + which individual initial guess values are more likely to be causing the convergence + failure of Newton-type iterative nonlinear solvers. + - *LOG_NLS_RES* - outputs every evaluation of the residual function. + - *LOG_NLS_EXTRAPOLATE* - outputs debug information about extrapolate process. + - *LOG_RES_INIT* - outputs residuals of the initialization. + - *LOG_RT* - additional information regarding real-time processes. + - *LOG_SIMULATION* - additional information about simulation process. + - *LOG_SOLVER* - additional information about solver process. + - *LOG_SOLVER_V* - verbose information about the integration process. + - *LOG_SOLVER_CONTEXT* - context information during the solver process. + - *LOG_SOTI* - final solution of the initialization. + - *LOG_SPATIALDISTR* - logging of internal operations for spatialDistribution. + - *LOG_STATS* - additional statistics about timer/events/solver. + - *LOG_STATS_V* - additional statistics for LOG_STATS. + - *LOG_SUCCESS* - This stream is always active, can be disabled with -lv=-LOG_SUCCESS. + - *LOG_SYNCHRONOUS* - Log clocks and sub-clocks for synchronous features. - - *LOG_ZEROCROSSINGS* - additional information about the zerocrossings. -- *Additional Simulation Flags (Optional)* – specify any other simulation flag. + - *LOG_ZEROCROSSINGS* - additional information about the zero-crossings. + +- *Additional Simulation Flags (Optional)* - specify any other simulation flag. Output ~~~~~~ -- *Output Format* – the simulation result file output format. +- *Output Format* - the simulation result file output format. - *Single Precision* - Output results in single precision (only for mat output format). @@ -660,46 +811,69 @@ Output - *Result File (Optional)* - the simulation result file name. -- *Variable Filter (Optional)* - only output variables with names fully matching the regular expression +- *Variable Filter (Optional)* - only output variables with names fully matching the + regular expression. -- *Protected Variables * - adds the protected variables in result file. +- *Protected Variables* - adds the protected variables in result file. -- *Equidistant Time Grid –* output the internal steps given by dassl instead of interpolating results into an equidistant time grid as given by stepSize or numberOfIntervals +- *Equidistant Time Grid -* output the internal steps given by dassl instead of + interpolating results into an equidistant time grid as given by stepSize or + numberOfIntervals. -- *Store Variables at Events –* adds the variables at time events. +- *Store Variables at Events -* adds the variables at time events. -- *Show Generated File* – displays the generated files in a dialog box. +- *Show Generated File* - displays the generated files in a dialog box. -The Variable Filter takes a regular expression input and only saves in the simulation results file those variables whose names fully match it. +The Variable Filter takes a regular expression input and only saves in the simulation +results file those variables whose names fully match it. Here are some simple examples: - ``.*`` matches any variable (default choice) + - ``xy.*`` matches variables starting with ``xy`` + - ``.*yz`` matches variables ending with ``yz`` -- ``abc\.def.*`` matches variables starting with ``abc.def``. Note that the ``.`` character is a regex metacharacter, so it must be escaped by a ``\`` -- ``.*body\.a_0\[1\]`` matches variables ending with ``body.a_0[1]``. Note that ``.``, ``[``, and ``]`` must be escaped + +- ``abc\.def.*`` matches variables starting with ``abc.def``. Note that the ``.`` + character is a regex meta-character, so it must be escaped by a ``\`` + +- ``.*body\.a_0\[1\]`` matches variables ending with ``body.a_0[1]``. Note that ``.``, + ``[``, and ``]`` must be escaped + - ``x\[.*\]`` matches all elements of array ``x`` + - ``x\[[2-4]\]`` matches elements 2, 3, and 4 of array ``x`` + - ``abc.*|def.*`` matches variables starting with ``abc`` or ``def`` -- ``.*der\(.*\)`` matches all derivatives in the model. Note that ``(`` and ``)`` must be escaped -Please note that all the model variables will still be shown in the Variables Browser tree; however, only those for which results were actually saved -will have a checkbox to plot them. +- ``.*der\(.*\)`` matches all derivatives in the model. Note that ``(`` and ``)`` must be + escaped + +Please note that all the model variables will still be shown in the Variables Browser +tree; however, only those for which results were actually saved will have a checkbox to +plot them. CSV-File Data Input ~~~~~~~~~~~~~~~~~~~ -When simulating Modelica models with top-level inputs (input variables or input connectors), these inputs are assumed to be equal to their start -value by default. However, it is possible to feed them with input signals obtained from CSV (Comma-Separated Value) input data files, by means of the -:ref:`-csvInput ` simulation flag, that can be set in the *Additional Simulation Flags (Optional)* field of -the Simulation Flags tab. For example, setting ``-csvInput=myinput.csv`` causes the runtime executable to read such input data from the ``myinput.csv`` -file. - -CSV files should contain the names of the input variables in the first row, beginning with ``time`` on the first column, and the values of such variables -for each point in time in subsequent rows, with non-decreasing time values. The variable names should be enclosed by quotation marks in case they contain spaces, to avoid ambiguities. The default separator for data items within each row is the comma, but it is also possible to use other separators, e.g., space, tab, -or semi-colon; in this case, the file should start with the separator specification ``"sep=x"`` (including the quotation marks), where ``x`` is the separator -character. - -For example, assume your model has three top-level inputs named ``u1``, ``u2``, and ``u3``. These are valid CSV input files: +When simulating Modelica models with top-level inputs (input variables or input +connectors), these inputs are assumed to be equal to their start value by default. +However, it is possible to feed them with input signals obtained from CSV (Comma-Separated +Value) input data files, by means of the :ref:`-csvInput ` simulation +flag, that can be set in the *Additional Simulation Flags (Optional)* field of the +Simulation Flags tab. For example, setting ``-csvInput=myinput.csv`` causes the runtime +executable to read such input data from the ``myinput.csv`` file. + +CSV files should contain the names of the input variables in the first row, beginning with +``time`` on the first column, and the values of such variables for each point in time in +subsequent rows, with non-decreasing time values. The variable names should be enclosed by +quotation marks in case they contain spaces, to avoid ambiguities. The default separator +for data items within each row is the comma, but it is also possible to use other +separators, e.g., space, tab, or semi-colon; in this case, the file should start with the +separator specification ``"sep=x"`` (including the quotation marks), where ``x`` is the +separator character. + +For example, assume your model has three top-level inputs named ``u1``, ``u2``, and +``u3``. These are valid CSV input files: .. code-block:: none @@ -718,23 +892,26 @@ For example, assume your model has three top-level inputs named ``u1``, ``u2``, 1.0 0.0 0.0 0.0 2.0 0.0 0.0 1.0 -Note that input labels need not be lexicographically ordered, the association between the columns and the inputs is given by the first row. +Note that input labels need not be lexicographically ordered, the association between the +columns and the inputs is given by the first row. -The CSV-file provides the values of the top level inputs at the specified points in time; linear interpolation is used to provide intermediate values between -any two subsequent data points. Discontinuous inputs can be obtained by providing two consecutive rows with the same time value, containing the left -limit values and the right limit values. +The CSV-file provides the values of the top level inputs at the specified points in time; +linear interpolation is used to provide intermediate values between any two subsequent +data points. Discontinuous inputs can be obtained by providing two consecutive rows with +the same time value, containing the left limit values and the right limit values. -Unless an absolute pathname is provided for the CSV-files, OMEdit will load it from the sub-directory of the working directory which has the same name of the model, -where all the other input and output data files are located. +Unless an absolute pathname is provided for the CSV-files, OMEdit will load it from the +sub-directory of the working directory which has the same name of the model, where all the +other input and output data files are located. Data Reconciliation ~~~~~~~~~~~~~~~~~~~ -- *Algorithm* – data reconciliation algorithm. +- *Algorithm* - data reconciliation algorithm. -- *Measurement Input File* – measurement input file. +- *Measurement Input File* - measurement input file. -- *Correlation Matrix Input File* – correlation matrix file. +- *Correlation Matrix Input File* - correlation matrix file. - *Epsilon* @@ -779,9 +956,9 @@ windows by clicking on the New Plot Parametric toolbar button (|parametric-plot- .. _array-plot : -Select the x-axis variable while holding down the shift key, release the shift key and then select -y-axis variables. One or many y-axis variables can be selected against one x-axis variable. To select -a new x-axis variable press and hold the shift key again. +Select the x-axis variable while holding down the shift key, release the shift key and +then select y-axis variables. One or many y-axis variables can be selected against one +x-axis variable. To select a new x-axis variable press and hold the shift key again. Unchecking the x-axis variable will uncheck all y-axis variables linked to it. @@ -804,11 +981,12 @@ A new Array Plot window is opened using the New Array Plot Window toolbar button Array Parametric Plot ^^^^^^^^^^^^^^^^^^^^^ -Plots the first array elements' values on the x-axis versus the second array elements' values on the y-axis. The time -is controlled by the slider above the variable tree. To create a new Array Parametric Plot, press -the New Array Parametric Plot Window toolbar button (|array-parametric-plot-window|), then match the principle -array node in the variable tree view to be plotted on the x-axis and match the principle array node to be plotted -on the y-axis. +Plots the first array elements' values on the x-axis versus the second array elements' +values on the y-axis. The time is controlled by the slider above the variable tree. To +create a new Array Parametric Plot, press the New Array Parametric Plot Window toolbar +button (|array-parametric-plot-window|), then match the principle array node in the +variable tree view to be plotted on the x-axis and match the principle array node to be +plotted on the y-axis. .. |array-parametric-plot-window| image:: media/omedit-icons/array-parametric-plot-window.* :alt: OMEdit New Array Parametric Plot Window Icon @@ -840,35 +1018,65 @@ Plot Window Menu ^^^^^^^^^^^^^^^^ - *Auto Scale* - Automatically scales the horizontal and vertical axes. + - *Fit in View* - Adjusts the plot canvas to according to the size of plot curves. + - *Save* - Saves the plot to file system as .png, .svg or .bmp. + - *Print* - Prints the plot. + - *Grid* - Shows grid lines. + - *Detailed Grid* - Shows detailed grid lines. + - *No Grid* - Hides grid lines. + - *Log X* - Logarithmic scale of the horizontal axis. + - *Log Y* - Logarithmic scale of the vertical axis. + - *Setup* - Shows a setup window. + - *Variables* - List of all plotted variables. + - *General* - Variable general information. + - *Legend* - Display name for legend. + - *File* - File name where variable data is stored. + - *Appearance* - Visual settings of variable. + - *Color* - Display color. + - *Pattern* - Line pattern of curve. + - *Thickness* - Line thickness of curve. + - *Hide* - Hide/Show the curve. + - *Toggle Sign* - Toggles the sign of curve. - - *Titles* - Plot, axes and footer titles settings. - - *Legend* - Sets legend position and font. - - *Range* - Automatic or manual axes range. - - *Auto Scale* - Automatically scales the horizontal and vertical axes. - - *X-Axis* - - *Minimum* - Minimum value for x-axis. - - *Maximum* - Maximum value for x-axis. - - *Y-Axis* - - *Minimum* - Minimum value for y-axis. - - *Maximum* - Maximum value for y-axis. + + - *Titles* - Plot, axes and footer titles settings. + + - *Legend* - Sets legend position and font. + + - *Range* - Automatic or manual axes range. + + - *Auto Scale* - Automatically scales the horizontal and vertical axes. + + - *X-Axis* + + - *Minimum* - Minimum value for x-axis. + + - *Maximum* - Maximum value for x-axis. + + - *Y-Axis* + + - *Minimum* - Minimum value for y-axis. + + - *Maximum* - Maximum value for y-axis. + - *Prefix Units* - Automatically pick the right prefix for units. Re-simulating a Model @@ -908,9 +1116,11 @@ choose “\ **Simulate with Animation**\ ” as shown in :numref:`omedit-simulat One can also run the visualization via Simulation > Simulate with Animation from the menu. When simulating a model in animation mode, the flag *+d=visxml* is set. -Hence, the compiler will generate a scene description file *_visual.xml* which stores all information on the multibody shapes. -This scene description references all variables which are needed for the animation of the multibody system. -When simulating with *+d=visxml*, the compiler will always generate results for these variables. +Hence, the compiler will generate a scene description file *_visual.xml* which stores all +information on the multibody shapes. +This scene description references all variables which are needed for the animation of the +multibody system. When simulating with *+d=visxml*, the compiler will always generate +results for these variables. Viewing a Visualization ~~~~~~~~~~~~~~~~~~~~~~~ @@ -923,11 +1133,14 @@ show up automatically as shown in :numref:`omedit-visualization`. OMEdit 3D Visualization. -The animation starts with pushing the *play* button. The animation is played until stopTime or until the *pause* button is pushed. +The animation starts with pushing the *play* button. The animation is played until +stopTime or until the *pause* button is pushed. By pushing the *previous* button, the animation jumps to the initial point of time. -Points of time can be selected by moving the *time slider* or by inserting a simulation time in the *Time-box*. +Points of time can be selected by moving the *time slider* or by inserting a simulation +time in the *Time-box*. The speed factor of animation in relation to realtime can be set in the *Speed-dialog*. -Other animations can be openend by using the *open file* button and selecting a result file with a corresping scene description file. +Other animations can be opened by using the *open file* button and selecting a result +file with a corresponding scene description file. The 3D camera view can be manipulated as follows: @@ -942,7 +1155,8 @@ Rotate Left Mouse Hold Move Mouse Shape context menu Right Mouse + Shift ======================== ============================== ======================== -Predefined views (Isometric, Side, Front, Top) can be selected and the scene can be tilted by 90° either clock or anticlockwise with the rotation buttons. +Predefined views (Isometric, Side, Front, Top) can be selected and the scene can be tilted +by 90° either clock or anticlockwise with the rotation buttons. Additional Visualization Features ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -972,9 +1186,11 @@ Remove Texture Removes the current texture of the shape. Animation of Realtime FMUs -------------------------- -Instead of a result file, OMEdit can load Functional Mock-up Units to retrieve the data for the animation of multibody systems. +Instead of a result file, OMEdit can load Functional Mock-up Units to retrieve the data +for the animation of multibody systems. Just like opening a mat-file from the animation-plotting view, one can open an FMU-file. -Necessarily, the FMU has to be generated with the *+d=visxml* flag activated, so that a scene description file is generated in the same directory as the FMU. +Necessarily, the FMU has to be generated with the *+d=visxml* flag activated, so that a +scene description file is generated in the same directory as the FMU. Currently, only FMU 1.0 and FMU 2.0 model exchange are supported. When choosing an FMU, the simulation settings window pops up to choose solver and step size. Afterwards, the model initializes and can be simulated by pressing the play button. @@ -983,8 +1199,10 @@ Interactive Realtime Animation of FMUs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FMUs can be simulated with realtime user interaction. -A possible solution is to equip the model with an interaction model from the Modelica_DeviceDrivers library (https://github.com/modelica/Modelica_DeviceDrivers). -The realtime synchronization is done by OMEdit so no additional time synchronization model is necessary. +A possible solution is to equip the model with an interaction model from the +Modelica_DeviceDrivers library (https://github.com/modelica/Modelica_DeviceDrivers). +The realtime synchronization is done by OMEdit so no additional time synchronization model +is necessary. .. figure :: media/interactive_model.png :name: An interactive multibody system model using Modelic_DeviceDrivers models. @@ -997,7 +1215,8 @@ Interactive Simulation .. warning :: Interactive simulation is an experimental feature. -Interactive simulation is enabled by selecting interactive simulation in the simulation setup. +Interactive simulation is enabled by selecting interactive simulation in the simulation +setup. There are two main modes of execution: asynchronous and synchronous (simulate with steps). The difference is that in synchronous (step mode), @@ -1016,13 +1235,13 @@ speed of the simulation does not directly correspond to real-time. -How to Create User Defined Shapes – Icons +How to Create User Defined Shapes - Icons ----------------------------------------- Users can create shapes of their own by using the shape creation tools available in OMEdit. -- *Line Tool* – Draws a line. A line is created with a minimum of two +- *Line Tool* - Draws a line. A line is created with a minimum of two points. In order to create a line, the user first selects the line tool from the toolbar and then click on the Icon/Diagram View; this will start creating a line. If a user clicks again on @@ -1030,13 +1249,13 @@ available in OMEdit. finish the line creation, user has to double click on the Icon/Diagram View. -- *Polygon Tool* – Draws a polygon. A polygon is created in a similar +- *Polygon Tool* - Draws a polygon. A polygon is created in a similar fashion as a line is created. The only difference between a line and a polygon is that, if a polygon contains two points it will look like a line and if a polygon contains more than two points it will become a closed polygon shape. -- *Rectangle Tool* – Draws a rectangle. The rectangle only contains two +- *Rectangle Tool* - Draws a rectangle. The rectangle only contains two points where first point indicates the starting point and the second point indicates the ending the point. In order to create rectangle, the user has to select the rectangle tool from the @@ -1046,12 +1265,12 @@ available in OMEdit. Icon/Diagram View where he/she wants to finish the rectangle. The second click will become the second point of rectangle. -- *Ellipse Tool* – Draws an ellipse. The ellipse is created in a +- *Ellipse Tool* - Draws an ellipse. The ellipse is created in a similar way as a rectangle is created. -- *Text Tool* – Draws a text label. +- *Text Tool* - Draws a text label. -- *Bitmap Tool* – Draws a bitmap container. +- *Bitmap Tool* - Draws a bitmap container. The shape tools are located in the toolbar. See :numref:`omedit-user-defined-shapes`. @@ -1067,7 +1286,7 @@ will become the icon representation of the model. For example, if a user creates a model with name testModel and add a rectangle using the rectangle tool and a polygon using the polygon tool, -in the Icon View of the model. The model’s Modelica Text will appear as +in the Icon View of the model. The model's Modelica Text will appear as follows: .. code-block :: modelica @@ -1084,8 +1303,9 @@ annotation of the model. Global head section in documentation ------------------------------------ -If you want to use same styles or same JavaScript for the classes contained inside a package then -you can define ``__OpenModelica_infoHeader`` annotation inside the ``Documentation`` annotation of a package. +If you want to use same styles or same JavaScript for the classes contained inside a +package then you can define ``__OpenModelica_infoHeader`` annotation inside the +``Documentation`` annotation of a package. For example, .. code-block :: modelica @@ -1104,9 +1324,10 @@ For example, ")); end P; -In the above example model ``M`` does not need to define the javascript function ``HelloWorld``. -It is only defined once at the package level using the ``__OpenModelica_infoHeader`` and then all classes -contained in the package can use it. +In the above example model ``M`` does not need to define the javascript function +``HelloWorld``. +It is only defined once at the package level using the ``__OpenModelica_infoHeader`` and +then all classes contained in the package can use it. In addition styles and JavaScript can be added from file locations using Modelica URIs. Example: @@ -1149,24 +1370,24 @@ General Options - General - - *Language* – Sets the application language. + - *Language* - Sets the application language. - - *Working Directory* – Sets the application working directory. + - *Working Directory* - Sets the application working directory. All files are generated in this directory. - - *Toolbar Icon Size* – Sets the size for toolbar icons. + - *Toolbar Icon Size* - Sets the size for toolbar icons. - - *Preserve User’s GUI Customizations* – If true then OMEdit will + - *Preserve User's GUI Customizations* - If true then OMEdit will remember its windows and toolbars positions and sizes. - - *Terminal Command* – Sets the terminal command. + - *Terminal Command* - Sets the terminal command. When user clicks on Tools > Open Terminal then this command is executed. - - *Terminal Command Arguments* – Sets the terminal command arguments. + - *Terminal Command Arguments* - Sets the terminal command arguments. - - *Hide Variables Browser* – Hides the variable browser when switching away from plotting perspective. + - *Hide Variables Browser* - Hides the variable browser when switching away from plotting perspective. - - *Activate Access Annotations* – Activates the access annotations + - *Activate Access Annotations* - Activates the access annotations for the non-encrypted libraries. Access annotations are always active for encrypted libraries. @@ -1177,27 +1398,27 @@ General Options - Libraries Browser - - *Library Icon Size* – Sets the size for library icons. + - *Library Icon Size* - Sets the size for library icons. - - *Max. Library Icon Text Length to Show* – Sets the maximum text length that can be shown + - *Max. Library Icon Text Length to Show* - Sets the maximum text length that can be shown in the icon in Libraries Browser. - - *Show Protected Classes* – If enabled then Libraries Browser will also list the protected classes. + - *Show Protected Classes* - If enabled then Libraries Browser will also list the protected classes. - - *Show Hidden Classes* – If enabled then Libraries Browser will also list the hidden classes. + - *Show Hidden Classes* - If enabled then Libraries Browser will also list the hidden classes. Ignores the annotation(Protection(access = Access.hide)) - - *Synchronize with Model Widget* – If enabled then Libraries Browser will scroll automatically + - *Synchronize with Model Widget* - If enabled then Libraries Browser will scroll automatically to the active Model Widget i.e., the current model. - Enable Auto Save - Enables/disables the auto save feature. -- *Auto Save interval* – Sets the auto save interval value. The minimum +- *Auto Save interval* - Sets the auto save interval value. The minimum possible interval value is 60 seconds. - Welcome Page - - *Horizontal View/Vertical View* – Sets the view mode for welcome page. + - *Horizontal View/Vertical View* - Sets the view mode for welcome page. - *Show Latest News* - If enabled then the latest news from https://openmodelica.org are shown. @@ -1205,20 +1426,21 @@ General Options - Optional Features - - *Enable instance API* - Enables/disables the use of json based instance api. The instance API enables the features - like conditional connectors, dialog enable, replaceable etc. + - *Enable instance API* - Enables/disables the use of json based instance api. + The instance API enables the features like conditional connectors, dialog enable, + replaceable etc. Libraries Options ~~~~~~~~~~~~~~~~~ - General - - *MODELICAPATH* – Sets the MODELICAPATH. MODELICAPATH is used to load libraries. + - *MODELICAPATH* - Sets the MODELICAPATH. MODELICAPATH is used to load libraries. - System libraries loaded automatically on startup - The list of system libraries that are loaded on startup. - *Load latest Modelica version on startup* - Is true then the latest available version of the - Modelica Standard Library is always loaded alongwith its dependencies. + Modelica Standard Library is always loaded along with its dependencies. - User libraries loaded automatically on startup - The list of user libraries/files that are loaded on startup. @@ -1234,15 +1456,15 @@ Text Editor Options - Tabs and Indentation - - *Tab Policy* – Sets the tab policy to either spaces or tabs only. + - *Tab Policy* - Sets the tab policy to either spaces or tabs only. - - *Tab Size* – Sets the tab size. + - *Tab Size* - Sets the tab size. - - *Indent Size* – Sets the indent size. + - *Indent Size* - Sets the indent size. - Syntax Highlight and Text Wrapping - - *Enable Syntax Highlighting* – Enable/Disable the syntax highlighting. + - *Enable Syntax Highlighting* - Enable/Disable the syntax highlighting. - *Enable Code Folding* - Enable/Disable the code folding. When code folding is enabled multi-line annotations are collapsed into a @@ -1250,88 +1472,90 @@ Text Editor Options a "+" sign becomes available at the left-side of the involved line, allowing the code to be expanded/re-collapsed at will. - - *Match Parentheses within Comments and Quotes* – Enable/Disable the matching of parentheses within comments and quotes. + - *Match Parentheses within Comments and Quotes* - Enable/Disable the matching of + parentheses within comments and quotes. - - *Enable Line Wrapping* – Enable/Disable the line wrapping. + - *Enable Line Wrapping* - Enable/Disable the line wrapping. - Autocomplete - - *Enable Autocomplete* – Enables/Disables the autocomplete. + - *Enable Autocomplete* - Enables/Disables the autocomplete. - Font - - *Font Family* – Shows the names list of available fonts. + - *Font Family* - Shows the names list of available fonts. Sets the font for the editor. - - *Font Size* – Sets the font size for the editor. + - *Font Size* - Sets the font size for the editor. Modelica Editor Options ~~~~~~~~~~~~~~~~~~~~~~~ -- *Preserve Text Indentation* – If true then uses *diffModelicaFileListings* API call otherwise uses the OMC pretty-printing. +- *Preserve Text Indentation* - If true then uses *diffModelicaFileListings* API call + otherwise uses the OMC pretty-printing. - Colors - - *Items* – List of categories used of syntax highlighting the code. + - *Items* - List of categories used of syntax highlighting the code. - - *Item Color* – Sets the color for the selected item. + - *Item Color* - Sets the color for the selected item. - - *Preview* – Shows the demo of the syntax highlighting. + - *Preview* - Shows the demo of the syntax highlighting. MetaModelica Editor Options ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Colors - - *Items* – List of categories used of syntax highlighting the code. + - *Items* - List of categories used of syntax highlighting the code. - - *Item Color* – Sets the color for the selected item. + - *Item Color* - Sets the color for the selected item. - - *Preview* – Shows the demo of the syntax highlighting. + - *Preview* - Shows the demo of the syntax highlighting. CompositeModel Editor Options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Colors - - *Items* – List of categories used of syntax highlighting the code. + - *Items* - List of categories used of syntax highlighting the code. - - *Item Color* – Sets the color for the selected item. + - *Item Color* - Sets the color for the selected item. - - *Preview* – Shows the demo of the syntax highlighting. + - *Preview* - Shows the demo of the syntax highlighting. SSP Editor Options ~~~~~~~~~~~~~~~~~~ - Colors - - *Items* – List of categories used of syntax highlighting the code. + - *Items* - List of categories used of syntax highlighting the code. - - *Item Color* – Sets the color for the selected item. + - *Item Color* - Sets the color for the selected item. - - *Preview* – Shows the demo of the syntax highlighting. + - *Preview* - Shows the demo of the syntax highlighting. C/C++ Editor Options ~~~~~~~~~~~~~~~~~~~~ - Colors - - *Items* – List of categories used of syntax highlighting the code. + - *Items* - List of categories used of syntax highlighting the code. - - *Item Color* – Sets the color for the selected item. + - *Item Color* - Sets the color for the selected item. - - *Preview* – Shows the demo of the syntax highlighting. + - *Preview* - Shows the demo of the syntax highlighting. HTML Editor Options ~~~~~~~~~~~~~~~~~~~ - Colors - - *Items* – List of categories used of syntax highlighting the code. + - *Items* - List of categories used of syntax highlighting the code. - - *Item Color* – Sets the color for the selected item. + - *Item Color* - Sets the color for the selected item. - - *Preview* – Shows the demo of the syntax highlighting. + - *Preview* - Shows the demo of the syntax highlighting. Graphical Views Options ~~~~~~~~~~~~~~~~~~~~~~~ @@ -1340,11 +1564,11 @@ Graphical Views Options - Modeling View Mode - - *Tabbed View/SubWindow View* – Sets the view mode for modeling. + - *Tabbed View/SubWindow View* - Sets the view mode for modeling. - Default View - - *Icon View/DiagramView/Modelica Text View/Documentation View* – If no + - *Icon View/DiagramView/Modelica Text View/Documentation View* - If no preferredView annotation is defined then this setting is used to show the respective view when user double clicks on the class in the Libraries Browser. @@ -1357,26 +1581,26 @@ Graphical Views Options - Extent - - *Left* – Defines the left extent point for the view. + - *Left* - Defines the left extent point for the view. - - *Bottom* – Defines the bottom extent point for the view. + - *Bottom* - Defines the bottom extent point for the view. - - *Right* – Defines the right extent point for the view. + - *Right* - Defines the right extent point for the view. - - *Top* – Defines the top extent point for the view. + - *Top* - Defines the top extent point for the view. - Grid - - *Horizontal* – Defines the horizontal size of the view grid. + - *Horizontal* - Defines the horizontal size of the view grid. - - *Vertical* – Defines the vertical size of the view grid. + - *Vertical* - Defines the vertical size of the view grid. - Component - - *Scale factor* – Defines the initial scale factor for the component + - *Scale factor* - Defines the initial scale factor for the component dragged on the view. - - *Preserve aspect ratio* – If true then the component’s aspect ratio + - *Preserve aspect ratio* - If true then the component's aspect ratio is preserved while scaling. .. _omedit-options-simulation : @@ -1390,9 +1614,9 @@ Simulation Options - Translation Flags - - *Matching Algorithm* – sets the matching algorithm for simulation. + - *Matching Algorithm* - sets the matching algorithm for simulation. - - *Index Reduction Method* – sets the index reduction method for + - *Index Reduction Method* - sets the index reduction method for simulation. - *Show additional information from the initialization process* - prints the @@ -1412,17 +1636,17 @@ Simulation Options - *Enable FMU Import* - See :ref:`fmi-import`. - - *Additional Translation Flags* – sets the translation flags see :ref:`omcflags-options` + - *Additional Translation Flags* - sets the translation flags see :ref:`omcflags-options` - - *Target Language* – sets the target language in which the code is generated. + - *Target Language* - sets the target language in which the code is generated. - - *Target Build* – sets the target build that is used to compile the generated code. + - *Target Build* - sets the target build that is used to compile the generated code. - - *C Compiler* – sets the C compiler for compiling the generated code. + - *C Compiler* - sets the C compiler for compiling the generated code. - - *CXX Compiler* – sets the CXX compiler for compiling the generated code. + - *CXX Compiler* - sets the CXX compiler for compiling the generated code. - - *Use static linking* – if true then static linking is used for simulation executable. + - *Use static linking* - if true then static linking is used for simulation executable. The default is dynamic linking. This option is only available on Windows. - *Post compilation command* - if not empty allows to run a command after the compilation step. @@ -1430,25 +1654,25 @@ Simulation Options The command is run in the same folder where the simulation executable is created. The interpreter executable must be passed to run shell scripts, eg on Windows: `powershell.exe -File C:\script.ps1` - - *Ignore __OpenModelica_commandLineOptions annotation* – if true then ignores the __OpenModelica_commandLineOptions + - *Ignore __OpenModelica_commandLineOptions annotation* - if true then ignores the __OpenModelica_commandLineOptions annotation while running the simulation. - - *Ignore __OpenModelica_simulationFlags annotation* – if true then ignores the __OpenModelica_simulationFlags + - *Ignore __OpenModelica_simulationFlags annotation* - if true then ignores the __OpenModelica_simulationFlags annotation while running the simulation. - - *Save class before simulation* – if true then always saves the class before running the simulation. + - *Save class before simulation* - if true then always saves the class before running the simulation. - - *Switch to plotting perspective after simulation* – if true then GUI always switches to plotting + - *Switch to plotting perspective after simulation* - if true then GUI always switches to plotting perspective after the simulation. - - *Close completed simulation output windows before simulation* – if true + - *Close completed simulation output windows before simulation* - if true then the completed simulation output windows are closed before starting a new simulation. - - *Delete intermediate compilation files* – if true then the files + - *Delete intermediate compilation files* - if true then the files generated during the compilation are deleted automatically. - - *Delete entire simulation directory of the model when OMEdit is closed* – + - *Delete entire simulation directory of the model when OMEdit is closed* - if true then the entire simulation directory is deleted on quit. - Output @@ -1471,47 +1695,47 @@ Messages Options Browser may have. If there are more rows then the rows are removed from the beginning. - - *Reset messages number before simulation* – Resets the messages + - *Reset messages number before simulation* - Resets the messages counter before starting the simulation. - - *Clear messages browser before checking, instantiation & simulation* – If enabled then the + - *Clear messages browser before checking, instantiation & simulation* - If enabled then the messages browser is cleared before checking, instantiation & simulation of model. - Font and Colors - - *Font Family* – Sets the font for the messages. + - *Font Family* - Sets the font for the messages. - - *Font Size –* Sets the font size for the messages. + - *Font Size -* Sets the font size for the messages. - - *Notification Color* – Sets the text color for notification messages. + - *Notification Color* - Sets the text color for notification messages. - - *Warning Color* – Sets the text color for warning messages. + - *Warning Color* - Sets the text color for warning messages. - - *Error Color* – Sets the text color for error messages. + - *Error Color* - Sets the text color for error messages. Notifications Options ~~~~~~~~~~~~~~~~~~~~~ - Notifications - - *Always quit without prompt* – If true then OMEdit will quit without prompting the user. + - *Always quit without prompt* - If true then OMEdit will quit without prompting the user. - - *Show item dropped on itself message* – If true then a message will + - *Show item dropped on itself message* - If true then a message will pop-up when a class is dragged and dropped on itself. - - *Show model is partial and component is added as replaceable message* – If true then a + - *Show model is partial and component is added as replaceable message* - If true then a message will pop-up when a partial class is added to another class. - - *Show component is declared as inner message* – If true then a + - *Show component is declared as inner message* - If true then a message will pop-up when an inner component is added to another class. - - *Show save model for bitmap insertion message* – If true then a message will pop-up + - *Show save model for bitmap insertion message* - If true then a message will pop-up when user tries to insert a bitmap from a local directory to an unsaved class. - - *Always ask for the dragged component name* – If true then a message will pop-up when + - *Always ask for the dragged component name* - If true then a message will pop-up when user drag & drop the component on the graphical view. - - *Always ask for what to do with the text editor error* – If true then a + - *Always ask for what to do with the text editor error* - If true then a message will always pop-up when there is an error in the text editor. - If new frontend for code generation fails @@ -1529,47 +1753,48 @@ Line Style Options - Line Style - - *Color* – Sets the line color. + - *Color* - Sets the line color. - - *Pattern* – Sets the line pattern. + - *Pattern* - Sets the line pattern. - - *Thickness* – Sets the line thickness. + - *Thickness* - Sets the line thickness. - - *Start Arrow* – Sets the line start arrow. + - *Start Arrow* - Sets the line start arrow. - - *End Arrow* – Sets the line end arrow. + - *End Arrow* - Sets the line end arrow. - - *Arrow Size* – Sets the start and end arrow size. + - *Arrow Size* - Sets the start and end arrow size. - - *Smooth* – If true then the line is drawn as a Bezier curve. + - *Smooth* - If true then the line is drawn as a Bezier curve. Fill Style Options ~~~~~~~~~~~~~~~~~~ - Fill Style - - *Color* – Sets the fill color. + - *Color* - Sets the fill color. - - *Pattern* – Sets the fill pattern. + - *Pattern* - Sets the fill pattern. Plotting Options ~~~~~~~~~~~~~~~~ - General - - *Auto Scale* – Sets whether to auto scale the plots or not. - - *Prefix Units* – Automatically pick the right prefix for units for the new plot windows. + - *Auto Scale* - Sets whether to auto scale the plots or not. + + - *Prefix Units* - Automatically pick the right prefix for units for the new plot windows. For existing plot windows use the :ref:`omedit-plot-window-menu`. - Plotting View Mode - - *Tabbed View/SubWindow View* – Sets the view mode for plotting. + - *Tabbed View/SubWindow View* - Sets the view mode for plotting. - Curve Style - - *Pattern* – Sets the curve pattern. + - *Pattern* - Sets the curve pattern. - - *Thickness* – Sets the curve thickness. + - *Thickness* - Sets the curve thickness. - Variable filter @@ -1597,11 +1822,11 @@ Figaro Options - Figaro - - *Figaro Library* – the Figaro library file path. + - *Figaro Library* - the Figaro library file path. - - *Tree generation options* – the Figaro tree generation options file path. + - *Tree generation options* - the Figaro tree generation options file path. - - *Figaro Processor* – the Figaro processor location. + - *Figaro Processor* - the Figaro processor location. .. _omedit-options-debugger : @@ -1610,28 +1835,28 @@ Debugger Options - Algorithmic Debugger - - *GDB Path* – the gnu debugger path + - *GDB Path* - the gnu debugger path - - *GDB Command Timeout* – timeout for gdb commands. + - *GDB Command Timeout* - timeout for gdb commands. - - *GDB Output Limit* – limits the GDB output to N characters. + - *GDB Output Limit* - limits the GDB output to N characters. - - *Display C frames* – if true then shows the C stack frames. + - *Display C frames* - if true then shows the C stack frames. - - *Display unknown frames* – if true then shows the unknown stack + - *Display unknown frames* - if true then shows the unknown stack frames. Unknown stack frames means frames whose file path is unknown. - - *Clear old output on a new run* – if true then clears the output window on new run. + - *Clear old output on a new run* - if true then clears the output window on new run. - - *Clear old log on new run* – if true then clears the log window on new run. + - *Clear old log on new run* - if true then clears the log window on new run. - Transformational Debugger - - *Always show Transformational Debugger after compilation* – if true + - *Always show Transformational Debugger after compilation* - if true then always open the Transformational Debugger window after model compilation. - - *Generate operations in the info xml* – if true then adds the + - *Generate operations in the info xml* - if true then adds the operations information in the info xml file. .. _omedit-options-fmi : @@ -1643,27 +1868,23 @@ FMI Options - Version - - *1.0* – Sets the FMI export version to 1.0 + - *1.0* - Sets the FMI export version to 1.0 - - *2.0* – Sets the FMI export version to 2.0 + - *2.0* - Sets the FMI export version to 2.0 - Type - - *Model Exchange* – Sets the FMI export type to Model Exchange. + - *Model Exchange* - Sets the FMI export type to Model Exchange. - - *Co-Simulation* – Sets the FMI export type to Co-Simulation. + - *Co-Simulation* - Sets the FMI export type to Co-Simulation. - - *Model Exchange and Co-Simulation* – Sets the FMI export type to Model Exchange and Co-Simulation. + - *Model Exchange and Co-Simulation* - Sets the FMI export type to Model Exchange and Co-Simulation. - - *FMU Name* – Sets a prefix for generated FMU file. + - *FMU Name* - Sets a prefix for generated FMU file. - - *Move FMU* – Moves the generated FMU to a specified path. + - *Move FMU* - Moves the generated FMU to a specified path. - - Platforms - - The list of platforms is created by searching for programs in the PATH matching pattern \"*-*-*-*cc\"." - Add the host triple to the PATH to get it listed. - A source-code only FMU is generated if no platform is selected. + - Platforms: See :ref:`fmitlm-export-options`. - Solver for Co-Simulation @@ -1671,12 +1892,14 @@ FMI Options - *CVODE* - - *Model Description Filters* - Sets the variable filter for model description file see :ref:`omcflag-fmifilter` + - *Model Description Filters* - Sets the variable filter for model description file, + see :ref:`--fmifilter`. - *Include Modelica based resources via loadResource* - *Include Source Code* - Sets if the exported FMU can contain source code. - Model Description Filter \"blackBox\" will override this, because black box FMUs do never contain their source code. + Model Description Filter \"blackBox\" will override this, because black box FMUs do + never contain their source code. - *Generate Debug Symbols* - Generates a FMU with debug symbols. @@ -1692,7 +1915,7 @@ OMTLMSimulator Options - *Path* - path to OMTLMSimulator bin directory. - - *Manager Process* - path to OMTLMSimulator managar process. + - *Manager Process* - path to OMTLMSimulator manager process. - *Monitor Process* - path to OMTLMSimulator monitor process. @@ -1702,6 +1925,7 @@ OMSimulator/SSP Options - General - *Command Line Options* - sets the OMSimulator command line options. + - *Logging Level* - OMSimulator logging level. __OpenModelica_commandLineOptions Annotation @@ -1797,9 +2021,13 @@ If you want to edit MSL you need to load it as user library instead of system li MSL but if you really need to and understand the consequences then follow these steps, - Go to *Tools > Options > Libraries*. + - Remove Modelica & ModelicaReference from list of system libraries. + - Uncheck *force loading of Modelica Standard Library*. + - Add *$OPENMODELICAHOME/lib/omlibrary/Modelica X.X/package.mo* under user libraries. + - Restart OMEdit. .. _omedit-install-library-label : @@ -1899,12 +2127,17 @@ stop time values, and initializes the visualization controls accordingly. The controls allows the easy manipulation of the visualization, -* Rewind – resets the visualization to start. -* Play – starts the visualization. -* Pause – pauses the visualization. -* Time – allows the user to jump at any specific time. -* Speed – speed of the visualization. -* Slider – controls the time. +* Rewind - resets the visualization to start. + +* Play - starts the visualization. + +* Pause - pauses the visualization. + +* Time - allows the user to jump at any specific time. + +* Speed - speed of the visualization. + +* Slider - controls the time. The visualization is based on the simulation result file. All three formats of the simulation result file are supported i.e., mat, csv and plt diff --git a/doc/UsersGuide/source/omjulia.rst b/doc/UsersGuide/source/omjulia.rst index dae76b4e17a..084244ead3d 100644 --- a/doc/UsersGuide/source/omjulia.rst +++ b/doc/UsersGuide/source/omjulia.rst @@ -1,7 +1,7 @@ -OMJulia – OpenModelica Julia Scripting +OMJulia - OpenModelica Julia Scripting ====================================== -OMJulia – the OpenModelica Julia API is a free, open source, +OMJulia - the OpenModelica Julia API is a free, open source, highly portable Julia based interactive session handler for Julia scripting of OpenModelica API functionality. It provides the modeler with components for creating a complete Julia-Modelica modeling, compilation diff --git a/doc/UsersGuide/source/ommatlab.rst b/doc/UsersGuide/source/ommatlab.rst index 63090a71a41..a994eb6db4a 100644 --- a/doc/UsersGuide/source/ommatlab.rst +++ b/doc/UsersGuide/source/ommatlab.rst @@ -1,7 +1,7 @@ -OMMatlab – OpenModelica Matlab Interface +OMMatlab - OpenModelica Matlab Interface ======================================== -OMMatlab – the OpenModelica Matlab API is a free, open source, highly +OMMatlab - the OpenModelica Matlab API is a free, open source, highly portable Matlab-based interactive session handler for Modelica scripting. It provides the modeler with components for creating a complete Modelica modeling, compilation and simulation environment based diff --git a/doc/UsersGuide/source/omnotebook.rst b/doc/UsersGuide/source/omnotebook.rst index d69cf492edc..e4b586ab585 100644 --- a/doc/UsersGuide/source/omnotebook.rst +++ b/doc/UsersGuide/source/omnotebook.rst @@ -61,14 +61,14 @@ have different kinds of contents, and can even contain other cells. The notebook hierarchy of cells thus reflects the hierarchy of sections and subsections in a traditional document such as a book. -DrModelica Tutoring System – an Application of OMNotebook +DrModelica Tutoring System - an Application of OMNotebook --------------------------------------------------------- Understanding programs is hard, especially code written by someone else. For educational purposes it is essential to be able to show the source code and to give an explanation of it at the same time. -Moreover, it is important to show the result of the source code’s +Moreover, it is important to show the result of the source code's execution. In modeling and simulation it is also important to have the source code, the documentation about the source code, the execution results of the simulation model, and the documentation of the simulation @@ -442,14 +442,14 @@ one cell can be a parent to one or more additional cells. A tree view is available close to the right border in the notebook window to display the relation between the cells. -- *Textcell* – This cell type is used to display ordinary text and +- *Textcell* - This cell type is used to display ordinary text and images. Each textcell has a style that specifies how text is displayed. The cell´s style can be changed in the menu Format->Styles, example of different styles are: Text, Title, and Subtitle. The Textcell type also has support for following links to other notebook documents. -- *Inputcell* – This cell type has support for syntax highlighting and +- *Inputcell* - This cell type has support for syntax highlighting and evaluation. It is intended to be used for writing program code, e.g. Modelica code. Evaluation is done by pressing the key combination Shift+Return or Shift+Enter. All the text in the cell @@ -459,7 +459,7 @@ the relation between the cells. view, the inputcell can be collapsed causing the result to be hidden. -- *Latexcell* – This cell type has support for evaluation of latex scripts. +- *Latexcell* - This cell type has support for evaluation of latex scripts. It is intended to be mainly used for writing mathematical equations and formulas for advanced documentation in OMNotebook. Each Latexcell supports a maximum of one page document output.To evaluate this cell, latex must be @@ -470,7 +470,7 @@ the relation between the cells. is evaluated and the output is displayed hiding the latex source. By double-clicking on the cell marker in the tree view,the latex source is displayed for further modification. -- *Groupcell* – This cell type is used to group together other cell. A +- *Groupcell* - This cell type is used to group together other cell. A groupcell can be opened or closed. When a groupcell is opened all the cells inside the groupcell are visible, but when the groupcell is closed only the first cell inside the groupcell is @@ -486,11 +486,11 @@ An OMNotebook document contains cells which in turn contain text. Thus, two kinds of cursors are needed for positioning, text cursor and cell cursor: -- *Textcursor* – A cursor between characters in a cell, appearing as a +- *Textcursor* - A cursor between characters in a cell, appearing as a small vertical line. Position the cursor by clicking on the text or using the arrow buttons. -- *Cellcursor* – This cursor shows which cell currently has the input +- *Cellcursor* - This cursor shows which cell currently has the input focus. It consists of two parts. The main cellcursor is basically just a thin black horizontal line below the cell with input focus. The cellcursor is positioned by clicking on a cell, @@ -509,13 +509,13 @@ Selection of Text or Cells To perform operations on text or cells we often need to select a range of characters or cells. -- *Select characters* – There are several ways of selecting characters, +- *Select characters* - There are several ways of selecting characters, e.g. double-clicking on a word, clicking and dragging the mouse, or click followed by a shift-click at an adjacent positioin selects the text between the previous click and the position of the most recent shift-click. -- *Select cells* – Cells can be selected by clicking on them. Holding +- *Select cells* - Cells can be selected by clicking on them. Holding down Ctrl and clicking on the cell markers in the tree view allows several cells to be selected, one at a time. Several cells can be selected at once in the tree view by holding down the @@ -528,11 +528,11 @@ File Menu The following file related operations are available in the file menu: -- *Create a new noteboo*\ k – A new notebook can be created using the +- *Create a new noteboo*\ k - A new notebook can be created using the menu File->New or the key combination Ctrl+N. A new document window will then open, with a new document inside. -- *Open a notebook* – To open a notebook use File->Open in the menu or +- *Open a notebook* - To open a notebook use File->Open in the menu or the key combination Ctrl+O. Only files of the type .onb or .nb can be opened. If a file does not follow the OMNotebook format or the FullForm Mathematica Notebook format, a message box is @@ -540,7 +540,7 @@ The following file related operations are available in the file menu: must be converted to fullform before they can be opened in OMNotebook. -- *Save a notebook* – To save a notebook use the menu item File->Save +- *Save a notebook* - To save a notebook use the menu item File->Save or File->Save As. If the notebook has not been saved before the save as dialog is shown and a filename can be selected. OMNotebook can only save in xml format and the saved file is not @@ -548,29 +548,29 @@ The following file related operations are available in the file menu: and for save as Ctrl+Shift+S. The saved file by default obtains the file extension .onb. -- *Print* – Printing a document to a printer is done by pressing the +- *Print* - Printing a document to a printer is done by pressing the key combination Ctrl+P or using the menu item File->Print. A normal print dialog is displayed where the usually properties can be changed. -- *Import old document* – Old documents, saved with the old version of +- *Import old document* - Old documents, saved with the old version of OMNotebook where a different file format was used, can be opened using the menu item File->Import->Old OMNotebook file. Old documents have the extension .xml. -- *Export text* – The text inside a document can be exported to a text +- *Export text* - The text inside a document can be exported to a text document. The text is exported to this document without almost any structure saved. The only structure that is saved is the cell structure. Each paragraph in the text document will contain text from one cell. To use the export function, use menu item File->Export->Pure Text. -- *Close a notebook window* – A notebook window can be closed using the +- *Close a notebook window* - A notebook window can be closed using the menu item File->Close or the key combination Ctrl+F4. Any unsaved changes in the document are lost when the notebook window is closed. -- *Quitting OMNotebook* – To quit OMNotebook, use menu item File->Quit +- *Quitting OMNotebook* - To quit OMNotebook, use menu item File->Quit or the key combination Crtl+Q. This closes all notebook windows; users will have the option of closing OMC also. OMC will not automatically shutdown because other programs may still use it. @@ -580,7 +580,7 @@ The following file related operations are available in the file menu: Edit Menu ~~~~~~~~~ -- *Editing cell text* – Cells have a set of of basic editing functions. +- *Editing cell text* - Cells have a set of of basic editing functions. The key combination for these are: Undo (Ctrl+Z), Redo (Ctrl+Y), Cut (Ctrl+X), Copy (Ctrl+C) and Paste (Ctrl+V). These functions can also be accessed from the edit menu; Undo (Edit->Undo), Redo @@ -589,17 +589,17 @@ Edit Menu double-clicking, triple-clicking (select a paragraph), dragging the mouse, or using (Ctrl+A) to select all text within the cell. -- *Cut cell* – Cells can be cut from a document with the menu item +- *Cut cell* - Cells can be cut from a document with the menu item Edit->Cut or the key combination Ctrl+X. The cut function will always cut cells if cells have been selected in the tree view, otherwise the cut function cuts text. -- *Copy cell* – Cells can be copied from a document with the menu item +- *Copy cell* - Cells can be copied from a document with the menu item Edit->Copy or the key combination Ctrl+C. The copy function will always copy cells if cells have been selected in the tree view, otherwise the copy function copy text. -- *Paste cell* – To paste copied or cut cells the cell cursor must be +- *Paste cell* - To paste copied or cut cells the cell cursor must be selected in the location where the cells should be pasted. This is done by clicking on the cell cursor. Pasteing cells is done from the menu Edit->Paste or the key combination Ctrl+V. If the @@ -611,15 +611,15 @@ Edit Menu pasted must still exist. Consequently a cell can not be pasted from a document that has been closed. -- *Find* – Find text string in the current notebook, with the options +- *Find* - Find text string in the current notebook, with the options match full word, match cell, search within closed cells. Short command Ctrl+F. -- *Replace –* Find and replace text string in the current notebook, +- *Replace -* Find and replace text string in the current notebook, with the options match full word, match cell, search+replace within closed cells. Short command Ctrl+H. -- *View expression* – Text in a cell is stored internally as a subset +- *View expression* - Text in a cell is stored internally as a subset of HTML code and the menu item Edit->View Expression let the user switch between viewing the text or the internal HTML representation. Changes made to the HTML code will affect how the @@ -628,38 +628,38 @@ Edit Menu Cell Menu ~~~~~~~~~ -- *Add textcell* – A new textcell is added with the menu item Cell->Add +- *Add textcell* - A new textcell is added with the menu item Cell->Add Cell (previous cell style) or the key combination Alt+Enter. The new textcell gets the same style as the previous selected cell had. -- *Add inputcell* – A new inputcell is added with the menu item +- *Add inputcell* - A new inputcell is added with the menu item Cell->Add Inputcell or the key combination Ctrl+Shift+I. -- *Add latexcell* – A new latexcell is added with the menu item +- *Add latexcell* - A new latexcell is added with the menu item Cell->Add Latexcell or the key combination Ctrl+Shift+E. -- *Add groupcell* – A new groupcell is inserted with the menu item +- *Add groupcell* - A new groupcell is inserted with the menu item Cell->Groupcell or the key combination Ctrl+Shift+G. The selected cell will then become the first cell inside the groupcell. -- *Ungroup groupcell* – A groupcell can be ungrouped by selecting it in +- *Ungroup groupcell* - A groupcell can be ungrouped by selecting it in the tree view and using the menu item Cell->Ungroup Groupcell or by using the key combination Ctrl+Shift+U. Only one groupcell at a time can be ungrouped. -- *Split cell* – Spliting a cell is done with the menu item Cell->Split +- *Split cell* - Spliting a cell is done with the menu item Cell->Split cell or the key combination Ctrl+Shift+P. The cell is splited at the position of the text cursor. -- *Delete cell* – The menu item Cell->Delete Cell will delete all cells +- *Delete cell* - The menu item Cell->Delete Cell will delete all cells that have been selected in the tree view. If no cell is selected this action will delete the cell that have been selected by the cellcursor. This action can also be called with the key combination Ctrl+Shift+D or the key Del (only works when cells have been selected in the tree view). -- *Cellcursor* – This cell type is a special type that shows which cell +- *Cellcursor* - This cell type is a special type that shows which cell that currently has the focus. The cell is basically just a thin black line. The cellcursor is moved by clicking on a cell or using the menu item Cell->Next Cell or Cell->Previous Cell. The @@ -669,14 +669,14 @@ Cell Menu Format Menu ~~~~~~~~~~~ -- *Textcell* – This cell type is used to display ordinary text and +- *Textcell* - This cell type is used to display ordinary text and images. Each textcell has a style that specifies how text is displayed. The cells style can be changed in the menu Format->Styles, examples of different styles are: Text, Title, and Subtitle. The Textcell type also have support for following links to other notebook documents. -- *Text manipulation* – There are a number of different text +- *Text manipulation* - There are a number of different text manipulations that can be done to change the appearance of the text. These manipulations include operations like: changing font, changing color and make text bold, but also operations like: @@ -709,7 +709,7 @@ Format Menu Insert Menu ~~~~~~~~~~~ -- *Insert image* – Images are added to a document with the menu item +- *Insert image* - Images are added to a document with the menu item Insert->Image or the key combination Ctrl+Shift+M. After an image has been selected a dialog appears, where the size of the image can be chosen. The images actual size is the default value of the @@ -717,7 +717,7 @@ Insert Menu size. All images are saved in the same file as the rest of the document. -- *Insert link* – A document can contain links to other OMNotebook file +- *Insert link* - A document can contain links to other OMNotebook file or Mathematica notebook and to add a new link a piece of text must first be selected. The selected text make up the part of the link that the user can click on. Inserting a link is done from @@ -731,7 +731,7 @@ Insert Menu Window Menu ~~~~~~~~~~~ -- *Change window* – Each opened document has its own document window. +- *Change window* - Each opened document has its own document window. To switch between those use the Window menu. The window menu lists all titles of the open documents, in the same order as they were opened. To switch to another document, simple click on the @@ -740,13 +740,13 @@ Window Menu Help Menu ~~~~~~~~~ -- *About OMNotebook* – Accessing the about message box for OMNotebook +- *About OMNotebook* - Accessing the about message box for OMNotebook is done from the menu Help->About OMNotebook. -- *About Qt* – To access the message box for Qt, use the menu +- *About Qt* - To access the message box for Qt, use the menu Help->About Qt. -- *Help Text* – Opening the help text (document OMNotebookHelp.onb) for +- *Help Text* - Opening the help text (document OMNotebookHelp.onb) for OMNotebook can be done in the same way as any OMNotebook document is opened or with the menu Help->Help Text. The menu item can also be triggered with the key F1. @@ -754,30 +754,30 @@ Help Menu Additional Features ~~~~~~~~~~~~~~~~~~~ -- *Links* – By clicking on a link, OMNotebook will open the document +- *Links* - By clicking on a link, OMNotebook will open the document that is referred to in the link. -- *Update link* – All links are stored with relative file path. +- *Update link* - All links are stored with relative file path. Therefore OMNotebook has functions that automatically updating links if a document is resaved in another folder. Every time a document is saved, OMNotebook checks if the document is saved in the same folder as last time. If the folder has changed, the links are updated. -- \ *Evaluate whole Notebook* – All the cells present in the Notebook can +- \ *Evaluate whole Notebook* - All the cells present in the Notebook can be evaluated in one step by pressing the red color evalall button in the toolbar. The cells are evaluated in the same order as they are in the Notebook.However the latexcells cannot be evaluated by this feature. -- \ *Evaluate several cells* – Several inputcells can be evaluated at +- \ *Evaluate several cells* - Several inputcells can be evaluated at the same time by selecting them in the treeview and then pressing the key combination Shift+Enter or Shift+Return. The cells are evaluated in the same order as they have been selected. If a groupcell is selected all inputcells in that groupcell are evaluated, in the order they are located in the groupcell. -- \ *Moving and Reordering cells in a Notebook* – It is possible to shift cells +- \ *Moving and Reordering cells in a Notebook* - It is possible to shift cells to a new position and change the hierarchical order of the document.This can be done by clicking the cell and press the Up and Down arrow button in the tool bar to move either Up or Down. The cells are moved one cell @@ -790,7 +790,7 @@ Additional Features shifted in the same order as they are selected.This is especially very useful when shifting a group cell. -- *Command completion* – Inputcells have command completion support, +- *Command completion* - Inputcells have command completion support, which checks if the user is typing a command (or any keyword defined in the file commands.xml) and finish the command. If the user types the first two or three letters in a command, the @@ -807,19 +807,19 @@ Additional Features several of these fields and by pressing the key combination Ctrl+Tab, the next field will be selected inside the command. > Active Command completion: Ctrl+Space / Shift+Tab > Next command: - Ctrl+Space / Shift+Tab > Next field in command: Ctrl+Tab’ + Ctrl+Space / Shift+Tab > Next field in command: Ctrl+Tab' -- *Generated plot* – When plotting a simulation result, OMC uses the +- *Generated plot* - When plotting a simulation result, OMC uses the program Ptplot to create a plot. From Ptplot OMNotebook gets an image of the plot and automatically adds that image to the output part of an inputcell. Like all other images in a document, the plot is saved in the document file when the document is saved. -- *Stylesheet* –OMNotebook follows the style settings defined in +- *Stylesheet* -OMNotebook follows the style settings defined in stylesheet.xml and the correct style is applied to a cell when the cell is created. -- *Automatic Chapter Numbering* – OMNotebook automatically numbers +- *Automatic Chapter Numbering* - OMNotebook automatically numbers different chapter, subchapter, section and other styles. The user can specify which styles should have chapter numbers and which level the style should have. This is done in the stylesheet.xml @@ -827,11 +827,11 @@ Additional Features the chapter level. Level 0 or no tag at all, means that the style should not have any chapter numbering. -- *Scrollarea* – Scrolling through a document can be done by using the +- *Scrollarea* - Scrolling through a document can be done by using the mouse wheel. A document can also be scrolled by moving the cell cursor up or down. -- *Syntax highlighter* – The syntax highlighter runs in a separated +- *Syntax highlighter* - The syntax highlighter runs in a separated thread which speeds up the loading of large document that contains many Modelica code cells. The syntax highlighter only highlights when letters are added, not when they are removed. The @@ -840,7 +840,7 @@ Additional Features background color of keywords, whether or not the keywords should be bold or/and italic can be defined. -- *Change indicator* – A star (\*) will appear behind the filename in +- *Change indicator* - A star (\*) will appear behind the filename in the title of notebook window if the document has been changed and needs saving. When the user closes a document that has some unsaved change, OMNotebook asks the user if he/she wants to save @@ -848,7 +848,7 @@ Additional Features before, the save-as dialog appears so that a filename can be choosen for the new document. -- *Update menus* – All menus are constantly updated so that only menu +- *Update menus* - All menus are constantly updated so that only menu items that are linked to actions that can be performed on the currently selected cell is enabled. All other menu items will be disabled. When a textcell is selected the Format menu is updated @@ -865,18 +865,18 @@ References Eric Allen, Robert Cartwright, Brian Stoler. DrJava: A lightweight pedagogic environment for Java. In Proceedings of the 33rd ACM Technical Symposium on Computer Science Education (SIGCSE 2002) (Northern Kentucky -– The Southern Side of Cincinnati, USA, February 27 – March 3, 2002). +- The Southern Side of Cincinnati, USA, February 27 - March 3, 2002). Anders Fernström, Ingemar Axelsson, Peter Fritzson, Anders Sandholm, -Adrian Pop. OMNotebook – Interactive WYSIWYG Book Software for Teaching +Adrian Pop. OMNotebook - Interactive WYSIWYG Book Software for Teaching Programming. In Proc. of the Workshop on Developing Computer Science -Education – How Can It Be Done?. Linköping University, Dept. Computer & +Education - How Can It Be Done?. Linköping University, Dept. Computer & Inf. Science, Linköping, Sweden, March 10, 2006. Eva-Lena Lengquist-Sandelin, Susanna Monemar, Peter Fritzson, and Peter -Bunus. DrModelica – A Web-Based Teaching Environment for Modelica. In +Bunus. DrModelica - A Web-Based Teaching Environment for Modelica. In Proceedings of the 44th Scandinavian Conference on Simulation and -Modeling (SIMS’2003), available at www.scan-sims.org. Västerås, Sweden. +Modeling (SIMS'2003), available at www.scan-sims.org. Västerås, Sweden. September 18-19, 2003. .. |WYSIWYG| replace:: :abbr:`WYSIWYG (What-You-See-Is-What-You-Get)` diff --git a/doc/UsersGuide/source/ompython.rst b/doc/UsersGuide/source/ompython.rst index 884f98d59cd..3e8a5639431 100644 --- a/doc/UsersGuide/source/ompython.rst +++ b/doc/UsersGuide/source/ompython.rst @@ -3,17 +3,17 @@ OpenModelica Python Interface and PySimulator This chapter describes the OpenModelica Python integration facilities. -- OMPython – the OpenModelica Python scripting interface, see :ref:`ompython`. +- OMPython - the OpenModelica Python scripting interface, see :ref:`ompython`. - EnhancedOMPython - Enhanced OMPython scripting interface, see :ref:`enhancedompython`. -- PySimulator – a Python package that provides simulation and post +- PySimulator - a Python package that provides simulation and post processing/analysis tools integrated with OpenModelica, see :ref:`pysimulator`. .. _ompython: -OMPython – OpenModelica Python Interface +OMPython - OpenModelica Python Interface ---------------------------------------- -OMPython – OpenModelica Python API is a free, open source, highly +OMPython - OpenModelica Python API is a free, open source, highly portable Python based interactive session handler for Modelica scripting. It provides the modeler with components for creating a complete Modelica modeling, compilation and simulation environment based @@ -138,7 +138,7 @@ Implementation Client Implementation ^^^^^^^^^^^^^^^^^^^^^ -The OpenModelica Python API Interface – OMPython, attempts to mimic the +The OpenModelica Python API Interface - OMPython, attempts to mimic the OMShell's style of operations. OMPython is designed to, diff --git a/doc/UsersGuide/source/omsimulator.rst b/doc/UsersGuide/source/omsimulator.rst index 302fcf172fb..fa3ee2fc613 100644 --- a/doc/UsersGuide/source/omsimulator.rst +++ b/doc/UsersGuide/source/omsimulator.rst @@ -1,3 +1,5 @@ +.. _omsimulator-documentation: + OMSimulator ~~~~~~~~~~~ diff --git a/doc/UsersGuide/source/optimization.rst b/doc/UsersGuide/source/optimization.rst index 574203461b9..ec0bb10892f 100644 --- a/doc/UsersGuide/source/optimization.rst +++ b/doc/UsersGuide/source/optimization.rst @@ -5,15 +5,14 @@ Optimization with OpenModelica The following facilities for model-based optimization are provided with OpenModelica: -- :ref:`builtin-dynamic-optimization` using - dynamic optimization is the recommended way of - performing dynamic optimization with OpenModelica. +- :ref:`builtin-dynamic-optimization` using dynamic optimization is the recommended way + of performing dynamic optimization with OpenModelica. -- :ref:`dynamic-optimization-casadi`. Use this if you want to employ - the CasADi tool for dynamic optimization. +- :ref:`dynamic-optimization-casadi`. Use this if you want to employ the CasADi tool for + dynamic optimization. -- Classical :ref:`parameter-sweep-optimization-using-omoptim`. Use - this if you have a static optimization problem. +- Classical :ref:`parameter-sweep-optimization-using-omoptim`. Use this if you have a + static optimization problem. .. include:: OM_DOWithAnnotations.rst @@ -21,7 +20,7 @@ OpenModelica: Built-in Dynamic Optimization using Optimica language extensions **************************************************************** -*Note: this is a very short preliminary decription which soon will be +*Note: this is a very short preliminary description which soon will be considerably improved.* OpenModelica provides builtin dynamic optimization of models by using @@ -34,9 +33,11 @@ optimization language extension called Optimica (currently partially supported) for the optimization part of the problem. This is used to solve the underlying dynamic optimization model formulation using collocation methods, using a single execution instead of multiple -simulations as in the parameter-sweep optimization described in section :ref:`parameter-sweep-optimization-using-omoptim`. +simulations as in the parameter-sweep optimization described in section +:ref:`parameter-sweep-optimization-using-omoptim`. -For more detailed information regarding background and methods, see :cite:`openmodelica.org:bernhard:modelica:2012,openmodelica.org:Ruge:modelica:2014` +For more detailed information regarding background and methods, see +:cite:`openmodelica.org:bernhard:modelica:2012,openmodelica.org:Ruge:modelica:2014` =========================== Compiling the Modelica code @@ -104,12 +105,12 @@ command line terminals similar to the options described below: The control and state trajectories of the optimization results: .. omc-gnuplot :: nmpc-input - :caption: Optimization results for Batch Reactor model – input variables. + :caption: Optimization results for Batch Reactor model - input variables. u .. omc-gnuplot :: nmpc-states - :caption: Optimization results for Batch Reactor model – state variables. + :caption: Optimization results for Batch Reactor model - state variables. x1 x2 @@ -210,7 +211,7 @@ optimized and the optimization specification. list(BatchReactor) -One we have formulated the undelying optimal control problems, we can +One we have formulated the underlying optimal control problems, we can export the XML by using OMShell, OMNotebook, MDT, OMEdit or command line terminals which are described in Section :ref:`xml-import-to-casadi`. @@ -319,7 +320,7 @@ For all intended parameters, please note that: - The corresponding variable is **constant** during all simulations. The OMOptim optimization in version 0.9 only concerns static - parameters’ optimization *i.e.* values found for these parameters + parameters' optimization *i.e.* values found for these parameters will be constant during all simulation time. - The corresponding variable should play an **input** role in the model @@ -345,7 +346,7 @@ Objectives ========== As parameters, objectives are picked up from model variables. -Objectives’ values are considered by the optimizer at the *final time*. +Objectives' values are considered by the optimizer at the *final time*. Set problem in OMOptim ^^^^^^^^^^^^^^^^^^^^^^ @@ -451,7 +452,7 @@ button of *Optimization objectives* table. For each objective, you must: - Set minimum and maximum values it can take. If a configuration does - not respect these values, this configuration won’t be considered. + not respect these values, this configuration won't be considered. You also can set minimum and maximum equals to “-“ : it will then - Define whether objective should be minimized or maximized. @@ -466,14 +467,14 @@ and configure optimization algorithm. To do this, click on *Optimization* tab. Here, you can select optimization algorithm you want to use. In version -0.9, OMOptim offers three different genetic algorithms. Let’s for +0.9, OMOptim offers three different genetic algorithms. Let's for example choose SPEA2Adapt which is an auto-adaptative genetic algorithm. By clicking on *parameters*\ … button, a dialog is opened allowing defining parameters. These are: - *Population size*: this is the number of configurations kept after a - generation. If it is set to 50, your final result can’t contain + generation. If it is set to 50, your final result can't contain more than 50 different points. - *Off spring rate*: this is the number of children per adult obtained @@ -504,7 +505,7 @@ defining parameters. These are: It is used only if you start optimization from previously obtained configurations (using *Use start file* option). Setting it to yes (1) will, in most of cases, lead to a spread research - of optimized configurations, forgetting parameters’ variations’ + of optimized configurations, forgetting parameters' variations' reduction obtained in previous optimization. **Use start file** @@ -552,7 +553,7 @@ Obtaining all Variable Values During optimization, the values of optimized variables and objectives are memorized. The others are not. To get these last, you must recomputed corresponding points. To achieve this, select one or several -points in point’s list region and click on *recompute*. +points in point's list region and click on *recompute*. For each point, it will simulate model setting input parameters to point corresponding values. All values of this point (including those which diff --git a/doc/UsersGuide/source/parametersensitivity.rst b/doc/UsersGuide/source/parametersensitivity.rst index 0386deab35f..48594c25df7 100644 --- a/doc/UsersGuide/source/parametersensitivity.rst +++ b/doc/UsersGuide/source/parametersensitivity.rst @@ -143,7 +143,7 @@ and preys in a closed ecosystem. der(pred_pop) = pred_pop*(delta*prey_pop-gamma); end LotkaVolterra; -Let’s say we need to investigate the influence of model parameters on the predator population +Let's say we need to investigate the influence of model parameters on the predator population at 40 units of time. We assume a +/-5% uncertainty on model parameters. We can use OMSens to study the sensitivity model to each parameter, one at a time. @@ -228,7 +228,7 @@ but this time select **Multi-parameter Sweep**. Multi-parameter sweep results. - At time 40 the parameters perturbations with a higher predator population are all blue, - but it’s not clear which one. We need something more precise. + but it's not clear which one. We need something more precise. .. figure :: media/omsens-multi-sweep-plot.png diff --git a/doc/UsersGuide/source/pdemodelica.rst b/doc/UsersGuide/source/pdemodelica.rst index aa51f77b8e4..c0472f31c74 100644 --- a/doc/UsersGuide/source/pdemodelica.rst +++ b/doc/UsersGuide/source/pdemodelica.rst @@ -31,7 +31,7 @@ Let us introduce new PDEModelica1 language elements by an advection equation exa The domain ``omega`` represents the geometrical domain where the PDE holds. The domain is defined using the built-in record ``DomainLineSegment1D``. This record contains among -others ``L`` – the length of the domain, ``N`` – the number of grid points, ``x`` – +others ``L`` - the length of the domain, ``N`` - the number of grid points, ``x`` - the coordinate variable and the regions ``left``, ``right`` and ``interior``, representing the left and right boundaries and the interior of the domain. diff --git a/doc/UsersGuide/source/porting.rst b/doc/UsersGuide/source/porting.rst index da1acb8afb1..c7f3b8131c4 100644 --- a/doc/UsersGuide/source/porting.rst +++ b/doc/UsersGuide/source/porting.rst @@ -1,5 +1,5 @@ Porting Modelica libraries to OpenModelica -=========== +========================================== One of the goals of OpenModelica is to provide a full, no-compromise implementation of the latest version of the @@ -27,7 +27,7 @@ non-standard constructs are used. For your convenience, here you can find a list of commonly reported issues. Mapping of the library on the file system -------- +----------------------------------------- Packages can be mapped onto individual *.mo* files or onto hierarchical directory structures on the file system, according to the rules set forth in @@ -53,7 +53,8 @@ package, should be named exactly as the package (e.g. *Modelica*), possibly followed by a space and by the version number (e.g. *Modelica 3.2.3*). Modifiers for arrays -------- +-------------------- + According to the rules set forth in `Section 7.2.5 `_ of the language specification, when instantiating arrays of components, modifier values should be arrays of the same size of the component array, unless the *each* @@ -80,7 +81,8 @@ In most cases, the problem is solved by simply adding the *each* keyword where appropriate. Access to conditional components -------- +-------------------------------- + According to `Section 4.4.5 `_ of the language specification, "A component declared with a condition-attribute can only be modified and/or used in connections". When dealing, e.g., with @@ -137,7 +139,8 @@ when the corresponding conditional components are also not activated is irrelevant, according to the language specification. Access to classes defined in partial packages -------- +--------------------------------------------- + Consider the following example package .. code-block:: modelica @@ -202,7 +205,8 @@ in the simulation model. Equality operator in algorithms -------- +------------------------------- + The following code is illegal, because it uses the equality '=' operator, which is reserved for equations, instead of the assignment operator ':=' inside an algorithm: @@ -236,10 +240,11 @@ Also note that binding *equations* with '=' sign are instead required for default values of function inputs. Public non-input non-output variables in functions ------- +-------------------------------------------------- + According to `Section 12.2 `_ of the language specification, only input and output formal parameters are -allowed in the function’s public variable section. Hence, the following function +allowed in the function's public variable section. Hence, the following function declaration is not valid: .. code-block:: modelica @@ -268,7 +273,8 @@ and should be fixed by putting the variable *z* in the protected section: end f; Subscripting of expressions ------- +--------------------------- + There is a proposal of allowing expression subscripting, e.g. .. code-block:: modelica @@ -287,7 +293,8 @@ included in the current Modelica specification 3.5, nor even in the current work draft of 3.6, so it is not currently supported by OpenModelica. Incomplete specification of initial conditions ------- +---------------------------------------------- + The simulation of Modelica models of dynamical systems requires the tool to determine a consistent initial solution for the simulation to start. To do so, the system equations are augmented by adding one initial condition for each @@ -379,7 +386,8 @@ recommend to amend the source code of the model by adding suitable extra initial conditions, until that warning message no longer appears. Modelica_LinearSystems2 Library ------- +------------------------------- + The Modelica_LinearSystem2 library was originally developed in Dymola with a plan of eventually making it part of the Modelica Standard Library (thus the underscore in the library name). The library is based on several diff --git a/doc/UsersGuide/source/scripting_api.rst b/doc/UsersGuide/source/scripting_api.rst index 61ba33fb30f..c96e4d50241 100644 --- a/doc/UsersGuide/source/scripting_api.rst +++ b/doc/UsersGuide/source/scripting_api.rst @@ -16,14 +16,14 @@ formal parameters to the functions by the following notation: - String typed argument, e.g. "hello", "myfile.mo". -- TypeName – class, package or function name, e.g. MyClass, +- TypeName - class, package or function name, e.g. MyClass, Modelica.Math. -- VariableName – variable name, e.g. ``v1``, ``v2``, ``vars1[2].x``, etc. +- VariableName - variable name, e.g. ``v1``, ``v2``, ``vars1[2].x``, etc. - Integer or Real typed argument, e.g. 35, 3.14, xintvariable. -- options – optional parameters with named formal parameter passing. +- options - optional parameters with named formal parameter passing. OpenModelica Scripting Commands ############################### diff --git a/testsuite/.gitignore b/testsuite/.gitignore index fd494d04912..595b693beb1 100644 --- a/testsuite/.gitignore +++ b/testsuite/.gitignore @@ -1,7 +1,9 @@ -*.o -*.so *_info.json +*.bin *.fail_log +*.log +*.o +*.so /failed.* difftool/lex.yy.c openmodelica/bootstrapping/CodegenC.* diff --git a/testsuite/omsimulator/cmakeFMU.mos b/testsuite/omsimulator/cmakeFMU.mos index 90d31106c81..0ca5d3f28e5 100644 --- a/testsuite/omsimulator/cmakeFMU.mos +++ b/testsuite/omsimulator/cmakeFMU.mos @@ -4,7 +4,6 @@ // teardown_command: rm -rf DualMassOscillator.System1.fmu DualMassOscillator.System1_FMU* DualMassOscillator_System1_systemCall.log loadFile("DualMassOscillator.mo"); getErrorString(); -setCommandLineOptions("--fmuCMakeBuild=true --fmuRuntimeDepends=none"); getErrorString(); buildModelFMU(DualMassOscillator.System1, platforms={"dynamic"}); getErrorString(); system(getInstallationDirectoryPath() + "/bin/OMSimulator DualMassOscillator.System1.fmu", "DualMassOscillator_System1_systemCall.log"); @@ -16,8 +15,6 @@ readFile("DualMassOscillator_System1_systemCall.log"); // Notification: Automatically loaded package Complex 3.2.2 due to uses annotation from Modelica. // Notification: Automatically loaded package ModelicaServices 3.2.2 due to uses annotation from Modelica. // " -// true -// "" // "DualMassOscillator.System1.fmu" // "" // 0 diff --git a/testsuite/openmodelica/fmi/CoSimulation/2.0/ExportCvodeFmu_cmake.mos b/testsuite/openmodelica/fmi/CoSimulation/2.0/ExportCvodeFmu_cmake.mos index 0d4bf833132..ee2f2714cd4 100644 --- a/testsuite/openmodelica/fmi/CoSimulation/2.0/ExportCvodeFmu_cmake.mos +++ b/testsuite/openmodelica/fmi/CoSimulation/2.0/ExportCvodeFmu_cmake.mos @@ -12,7 +12,7 @@ loadString("model Pendulum extends Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum; end Pendulum;"); getErrorString(); -setCommandLineOptions("--fmiFlags=s:cvode --fmuCMakeBuild=true --fmuRuntimeDepends=none"); getErrorString(); +setCommandLineOptions("--fmiFlags=s:cvode"); getErrorString(); buildModelFMU(Pendulum, version = "2.0", fmuType="cs", platforms={"dynamic"}); getErrorString(); // Check _flags.json for simulation flags diff --git a/testsuite/openmodelica/fmi/CoSimulation/2.0/RecompileSourceCodeFMU.mos b/testsuite/openmodelica/fmi/CoSimulation/2.0/RecompileSourceCodeFMU.mos index 8c08985a53b..f6884fd9496 100644 --- a/testsuite/openmodelica/fmi/CoSimulation/2.0/RecompileSourceCodeFMU.mos +++ b/testsuite/openmodelica/fmi/CoSimulation/2.0/RecompileSourceCodeFMU.mos @@ -21,7 +21,7 @@ package Test end Test; "); getErrorString(); -setCommandLineOptions("--fmuCMakeBuild=true --fmiFlags=s:cvode --fmuRuntimeDepends=none"); getErrorString(); +setCommandLineOptions("--fmiFlags=s:cvode"); getErrorString(); buildModelFMU(Test.SinSource, version="2.0", fmuType ="cs", platforms={"static"}); getErrorString(); // Check if CMake can re-compile a static library diff --git a/testsuite/special/FmuExportCrossCompile/.gitignore b/testsuite/special/FmuExportCrossCompile/.gitignore index 2e931bcb501..f65a1947035 100644 --- a/testsuite/special/FmuExportCrossCompile/.gitignore +++ b/testsuite/special/FmuExportCrossCompile/.gitignore @@ -1,4 +1,3 @@ - *.c *.csv *.fmu diff --git a/testsuite/special/FmuExportCrossCompile/CMakeCrossCompile.mos b/testsuite/special/FmuExportCrossCompile/CMakeCrossCompile.mos index 3d3eda8242a..113299da2f6 100644 --- a/testsuite/special/FmuExportCrossCompile/CMakeCrossCompile.mos +++ b/testsuite/special/FmuExportCrossCompile/CMakeCrossCompile.mos @@ -12,7 +12,8 @@ system("rm -rf CMakeCrossCompile && mkdir CMakeCrossCompile", "CMakeCrossCompile cd("CMakeCrossCompile"); // Set CMake FMU without any filters -if not setCommandLineOptions("--fmuCMakeBuild=true --fmuRuntimeDepends=none --fmiFilter=none") then +// Disable CMake features, because version in multiarch/crossbuild is too old. +if not setCommandLineOptions("--fmiFilter=none --fmuCMakeBuild=true --fmuRuntimeDepends=none") then print(getErrorString()); exit(1); end if; diff --git a/testsuite/special/FmuExportCrossCompile/Makefile b/testsuite/special/FmuExportCrossCompile/Makefile index a3cdac4a763..7b4b00dcc40 100644 --- a/testsuite/special/FmuExportCrossCompile/Makefile +++ b/testsuite/special/FmuExportCrossCompile/Makefile @@ -50,5 +50,6 @@ fmu-check: ./fmu-run.sh WaterTank_TestSingleWaterTank $(OMC) check-files.mos clean: - rm -rf *.json *.xml *.html *.fmu* *.c *.makefile *.log *.o *.libs *.h *.mat *.csv Test_FMUs - rm -rf CMakeCrossCompile/ + rm -f *.json *.xml *.html *.fmu* *.c *.makefile *.log *.o *.opt *.libs *.h *.mat *.csv + rm -f BouncingBall FmuExportCrossCompile RoomHeating_OM_RH WaterTank_Control WaterTank_TestSingleWaterTank + rm -rf CMakeCrossCompile/ Test_FMUs/