Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Selecting the solver in CS FMU

Selecting the solver in CS FMU

By now, there should be two available solvers for CS, Euler and CVODE.

How can i select the solver I want to use?

I just found the tracs which confimes that CVODE is available, but in the user-guides, this possibility is (as far as i have seen) not available.

I am using the newest nightly build of OMEdit and FMpy for the transfer to python.

Best regards,

Henrik

Re: Selecting the solver in CS FMU

Re: Selecting the solver in CS FMU

Thanks!

After setting this flag

Code:

OpenModelica.Scripting.loadFile("grid.mo"); getErrorString();

OpenModelica.Scripting.loadFile("network_ctrl_lim2.mo"); getErrorString();
setCommandLineOptions("-d=newInst"); getErrorString();
setCommandLineOptions("-d=initialization"); getErrorString();
//setCommandLineOptions("--simCodeTarget=Cpp"); getErrorString();
setCommandLineOptions("-d=-disableDirectionalDerivatives"); getErrorString();
setCommandLineOptions("--fmiFlags=s:cvode"); getErrorString();
OpenModelica.Scripting.translateModelFMU(network_ctrl_lim2, version="2.0", fmuType = "cs"); getErrorString();

I receive following error message while trying to execute the file:

Code:

Traceback (most recent call last):

  File "C:\Users\hbode\Miniconda3\envs\omgtest\lib\site-packages\fmpy\fmi1.py", line 142, in __init__
    self.dll = cdll.LoadLibrary(libraryPath)
  File "C:\Users\hbode\Miniconda3\envs\omgtest\lib\ctypes\__init__.py", line 442, in LoadLibrary
    return self._dlltype(name)
  File "C:\Users\hbode\Miniconda3\envs\omgtest\lib\ctypes\__init__.py", line 364, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] Das angegebene Modul wurde nicht gefunden

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/hbode/PycharmProjects/omg/examples/test_pll.py", line 89, in <module>
    simulate_custom_input()
  File "C:/Users/hbode/PycharmProjects/omg/examples/test_pll.py", line 34, in simulate_custom_input
    instanceName='instance1')
  File "C:\Users\hbode\Miniconda3\envs\omgtest\lib\site-packages\fmpy\fmi2.py", line 509, in __init__
    super(FMU2Slave, self).__init__(**kwargs)
  File "C:\Users\hbode\Miniconda3\envs\omgtest\lib\site-packages\fmpy\fmi2.py", line 85, in __init__
    super(_FMU2, self).__init__(**kwargs)
  File "C:\Users\hbode\Miniconda3\envs\omgtest\lib\site-packages\fmpy\fmi1.py", line 144, in __init__
    raise Exception("Failed to load shared library %s. %s" % (libraryPath, e))
Exception: Failed to load shared library C:\Users\hbode\AppData\Local\Temp\tmpzlcvhz9b\binaries\win64\network_ctrl_lim2.dll. [WinError 126] Das angegebene Modul wurde nicht gefunden

The german Error messages (Winerror126) mean: "This module could not be found".

Except this flag, everything is the same. Anyone an idea, why this happens, and how to solve it? :-)

There are 0 guests and 0 other users also viewing this topic
You are here: