Skip to content

Commit

Permalink
remark for tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
ThummeTo committed Sep 3, 2024
1 parent a8b1054 commit 947233f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
18 changes: 10 additions & 8 deletions examples/src/inputs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"# Simulate an FMU with inputs\n",
"Tutorial by Tobias Thummerer\n",
"\n",
"🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧\n",
"\n",
"## License"
]
},
Expand Down Expand Up @@ -115,7 +117,7 @@
"outputs": [],
"source": [
"# we use an FMU from the FMIZoo.jl\n",
"fmu = fmiLoad(\"SpringPendulumExtForce1D\", \"Dymola\", \"2022x\"; type=:ME) # load FMU in ME-Mode (\"Model Exchange\")"
"fmu = loadFMU(\"SpringPendulumExtForce1D\", \"Dymola\", \"2022x\"; type=:ME) # load FMU in ME-Mode (\"Model Exchange\")"
]
},
{
Expand All @@ -125,7 +127,7 @@
"source": [
"#### Simulate as Model-Exchange\n",
"\n",
"In the function `fmiSimulate()` the FMU is simulated with an adaptive step size but with fixed save points `tSave`. In addition, the start and end time are specified. Note, that the dynamics of the input variables are not considered by the steps ize control of the solver, so it is highly recommended to limit the solver step size with the keyword argument `dtmax` if the input is more dynamic than the system."
"In the function `simulate()` the FMU is simulated with an adaptive step size but with fixed save points `tSave`. In addition, the start and end time are specified. Note, that the dynamics of the input variables are not considered by the steps ize control of the solver, so it is highly recommended to limit the solver step size with the keyword argument `dtmax` if the input is more dynamic than the system."
]
},
{
Expand All @@ -147,12 +149,12 @@
"end \n",
"\n",
"# simulate while setting inputs\n",
"data_extForce_t = fmiSimulate(fmu, (tStart, tStop); # FMU, start and stop time\n",
" saveat=tSave, # timepoints for the ODE solution to be saved\n",
" inputValueReferences=[\"extForce\"], # the value references that should be set (inputs)\n",
" inputFunction=extForce_t, # the input function to be used\n",
" dtmax=1e-2, # limit max step size to capture inputs\n",
" showProgress=false) # disable progress bar\n",
"data_extForce_t = simulate(fmu, (tStart, tStop); # FMU, start and stop time\n",
" saveat=tSave, # timepoints for the ODE solution to be saved\n",
" inputValueReferences=[\"extForce\"], # the value references that should be set (inputs)\n",
" inputFunction=extForce_t, # the input function to be used\n",
" dtmax=1e-2, # limit max step size to capture inputs\n",
" showProgress=false) # disable progress bar\n",
"plot(data_extForce_t)"
]
},
Expand Down
2 changes: 2 additions & 0 deletions examples/src/manipulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"# Manipulate a function\n",
"Tutorial by Tobias Thummerer, Johannes Stoljar\n",
"\n",
"🚧 This tutorial is under revision and will be replaced by an up-to-date version soon 🚧\n",
"\n",
"## License"
]
},
Expand Down
8 changes: 4 additions & 4 deletions examples/src/parameter_optimization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@
"outputs": [],
"source": [
"# we use an FMU from the FMIZoo.jl\n",
"fmu = fmiLoad(\"SpringPendulum1D\", \"Dymola\", \"2022x\"; type=:ME)\n",
"fmiInfo(fmu)"
"fmu = loadFMU(\"SpringPendulum1D\", \"Dymola\", \"2022x\"; type=:ME)\n",
"info(fmu)"
]
},
{
Expand Down Expand Up @@ -177,10 +177,10 @@
" x0 = [s0, v0]\n",
"\n",
" # simulate with given start stae and parameters\n",
" sol = fmiSimulate(fmu, (tStart, tStop); x0=x0, parameters=paramDict, saveat=tSave)\n",
" sol = simulate(fmu, (tStart, tStop); x0=x0, parameters=paramDict, saveat=tSave)\n",
"\n",
" # get state with index 1 (the position) from the solution\n",
" s_res = fmiGetSolutionState(sol, 1; isIndex=true) \n",
" s_res = getState(sol, 1; isIndex=true) \n",
"\n",
" return s_res\n",
"end\n",
Expand Down

0 comments on commit 947233f

Please sign in to comment.