Skip to content

Commit

Permalink
Enabling AD when creating OpenModelica FMUs
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeandersson committed Sep 28, 2023
1 parent 5e84e1a commit 3da9437
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/examples/python/modelica_fmu_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
omc = OMCSessionZMQ()
if omc.loadFile('rocket.mo').startswith('false'):
raise Exception('Modelica compilation failed: {}'.format(omc.sendExpression('getErrorString()')))
omc.sendExpression('setDebugFlags("-disableDirectionalDerivatives")')
fmu_file = omc.sendExpression('translateModelFMU(rocket)')
flag = omc.sendExpression('getErrorString()')
if not fmu_file.endswith('.fmu'): raise Exception('FMU generation failed: {}'.format(flag))
Expand Down
1 change: 1 addition & 0 deletions docs/notebooks/fmu_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
" omc = OMCSessionZMQ()\n",
" if omc.loadFile(mofile).startswith('false'):\n",
" raise Exception('Modelica compilation failed: {}'.format(omc.sendExpression('getErrorString()')))\n",
" omc.sendExpression('setDebugFlags(\"-disableDirectionalDerivatives\")')\n",
" fmu_file = omc.sendExpression('translateModelFMU({})'.format('vdp'))\n",
" flag = omc.sendExpression('getErrorString()')\n",
" if not fmu_file.endswith('.fmu'): raise Exception('FMU generation failed: {}'.format(flag))\n",
Expand Down

0 comments on commit 3da9437

Please sign in to comment.