Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mantielero committed Dec 18, 2023
1 parent 3b4c46d commit 830655a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions examples/bouncingBall/bouncingBall.log
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[INFO][FMUCHK] Will process FMU bouncingBall.fmu
[VERBOSE][FMILIB] Allocating FMIL context
[VERBOSE][FMILIB] Detecting FMI standard version
[VERBOSE][FMIZIP] Unpacking FMU into /tmp/fmucktmp5yJtGN
[VERBOSE][FMIZIP] Unpacking FMU into /tmp/fmucktmpQGEY5h
[VERBOSE][FMIXML] Parsing XML to detect FMI standard version
[VERBOSE][FMIXML] XML specifies FMI 2.0
[INFO][FMILIB] XML specifies FMI standard version 2.0
Expand Down Expand Up @@ -44,7 +44,7 @@
[INFO][FMUCHK] Printing output file header
[INFO][FMUCHK] Model identifier for CoSimulation: bouncingBall
[INFO][FMILIB] Loading 'linux64' binary with 'default' platform types
[VERBOSE][FMICAPI] Loaded FMU binary from /tmp/fmucktmp5yJtGN/binaries/linux64/bouncingBall.so
[VERBOSE][FMICAPI] Loaded FMU binary from /tmp/fmucktmpQGEY5h/binaries/linux64/bouncingBall.so
[VERBOSE][FMICAPI] Loading functions for the co-simulation interface
[VERBOSE][FMILIB] Successfully loaded all the interface functions
[INFO][FMUCHK] Version returned from CS FMU: 2.0
Expand Down Expand Up @@ -301,7 +301,7 @@
[VERBOSE][FMILIB] Releasing allocated library resources
[VERBOSE][FMILIB] Releasing FMU CAPI interface
[VERBOSE][FMICAPI] Successfully unloaded FMU binary
[VERBOSE][JMPRT] Removing /tmp/fmucktmp5yJtGN
[VERBOSE][JMPRT] Removing /tmp/fmucktmpQGEY5h
FMU check summary:
FMU reported:
0 warning(s) and error(s)
Expand Down
6 changes: 3 additions & 3 deletions examples/bouncingBall/bouncingBall.nim
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ model(bb):
if comp.state == modelInitializationMode:
# set first time event
comp["der(v)"] = comp["g"] * (-1.0)
comp.isPositive["z=0"] = comp["h"] > 0
comp.isPositive["z>0"] = comp["h"] > 0

proc getReal*(comp: FmuRef;
key:string):float =
Expand All @@ -101,8 +101,8 @@ model(bb):
prevV = comp["v"].valueR
comp.isNewEventIteration = false

comp.isPositive["z=0"] = comp["h"] > 0 # positive while h>0
if comp.isPositive["z=0"] == false: # What to do when h <= 0
comp.isPositive["z>0"] = comp["h"] > 0 # positive while h>0
if comp.isPositive["z>0"] == false: # What to do when h <= 0
var tempV:float = -comp["e"].valueR * prevV
if comp["v"].valueR != tempV:
comp["h"] = 0.0
Expand Down

0 comments on commit 830655a

Please sign in to comment.