### Install fmusim on Windows Source: https://modelica.github.io/fmusim Use PowerShell to download and execute the installation script for Windows systems. ```powershell powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/modelica/fmusim/refs/heads/main/install.ps1 | iex" ``` -------------------------------- ### Install fmusim on macOS and Linux Source: https://modelica.github.io/fmusim Use the curl command to download and execute the installation script for Unix-based systems. ```bash curl -LsSf https://raw.githubusercontent.com/modelica/fmusim/refs/heads/main/install.sh | sh ``` -------------------------------- ### Set start value and output variable with fmusim simulate --start-value --output-variable Source: https://modelica.github.io/fmusim/tutorial Sets a start value of 1.7 for variable h, sets h as the only output variable, and uses the previous output file as a reference. The --start-value and --output-variable options can be used multiple times. ```shell $ fmusim simulate BouncingBall.fmu --start-value h=1.7 --output-variable h --reference-file BouncingBall_out.csv ``` -------------------------------- ### Build platform binary with fmusim build Source: https://modelica.github.io/fmusim/tutorial Builds the platform binary for a source code FMU. Requires CMake and a supported compiler to be installed. The output shows the build process steps. ```shell $ fmusim build BouncingBall.fmu Creating CMake project Configuring CMake project ... Building CMake project ... Finished ``` -------------------------------- ### Check fmusim version Source: https://modelica.github.io/fmusim/tutorial Prints the installed version of fmusim. Useful when seeking help to determine if a problem is already solved in a newer version. ```shell $ fmusim --version ``` -------------------------------- ### Get FMU information with fmusim info Source: https://modelica.github.io/fmusim/tutorial Run the fmusim info command on a BouncingBall.fmu file to display model information. The output includes FMI version, interface types, supported platforms, continuous states, event indicators, model variables, generation details, and a table of model variables with descriptions. ```bash $ fmusim info BouncingBall.fmu Model Information FMI Version: 3.0 Interface Types: Model Exchange, Co-Simulation Model Name: BouncingBall Platforms: c-code, aarch64-darwin, aarch64-linux, x86-windows, x86_64-darwin, x86_64-linux, x86_64-windows Continuous States: 2 Event Indicators: 1 Model Variables: 8 Generation Date: 2026-07-10T09:46:15.950713+00:00 Generation Tool: Reference FMUs (v0.0.40) Description: This model calculates the trajectory, over time, of a ball dropped from a height of 1 m Model Variables Name | Description -------+---------------------------------------------- time | Simulation time h | Position of the ball der(h) | Derivative of h v | Velocity of the ball der(v) | Derivative of v g | Gravity acting on the ball e | Coefficient of restitution v_min | Velocity below which the ball stops bouncing ``` -------------------------------- ### Show help for fmusim simulate Source: https://modelica.github.io/fmusim/tutorial Displays the help menu for the fmusim simulate subcommand. ```shell $ fmusim help simulate ``` -------------------------------- ### Show fmusim help menu Source: https://modelica.github.io/fmusim/tutorial Displays the help menu for the fmusim command. ```shell $ fmusim help ``` -------------------------------- ### Simulate FMU with Model Exchange and log FMI calls using fmusim simulate --interface-type me Source: https://modelica.github.io/fmusim/tutorial Simulates the FMU using Model Exchange, changes simulation parameters (stop time, output interval), and logs FMI calls. The output shows the FMI function calls and their return values. Run `fmusim simulate --help` for all available options. ```shell $ fmusim simulate BouncingBall.fmu --stop-time 2 --output-interval 0.02 --interface-type me --log-fmi-calls --show-plot --show-events --show-markers [FMI] fmi3InstantiateModelExchange(instanceName="BouncingBall", instantiationToken="{1AE5E10D-9521-4DE3-80B9-D0EAAA7D5AF1}", resourcePath=None, visible=false, loggingOn=false, instanceEnvironment=0x20b3b8f3d70, logMessage=0x7ff7fc08c800) -> 0x20b3b8d2e40 [FMI] fmi3EnterInitializationMode(toleranceDefined=false, tolerance=0, startTime=0, stopTimeDefined=false, stopTime=0) -> fmi3OK [FMI] fmi3ExitInitializationMode() -> fmi3OK [FMI] fmi3UpdateDiscreteStates(discreteStatesNeedUpdate=false, terminateSimulation=false, nominalsOfContinuousStatesChanged=false, valuesOfContinuousStatesChanged=false, nextEventTimeDefined=false, nextEventTime=0) -> fmi3OK [FMI] fmi3EnterContinuousTimeMode() -> fmi3OK [FMI] fmi3GetNumberOfContinuousStates(nContinuousStates=2) -> fmi3OK [FMI] fmi3GetNumberOfEventIndicators(nEventIndicators=1) -> fmi3OK [FMI] fmi3GetContinuousStates(continuousStates=[1.0, 0.0], nContinuousStates=2) -> fmi3OK [FMI] fmi3GetNominalsOfContinuousStates(nominals=[1.0, 1.0], nNominals=2) -> fmi3OK [FMI] fmi3GetFloat64(valueReferences=[1], nValueReferences=1, values=[1.0], nValues=1) -> fmi3OK [FMI] fmi3GetFloat64(valueReferences=[3], nValueReferences=1, values=[0.0], nValues=1) -> fmi3OK [FMI] fmi3SetTime(time=0) -> fmi3OK [FMI] fmi3SetContinuousStates(continuousStates=[1.0, 0.0], nContinuousStates=2) -> fmi3OK [FMI] fmi3GetContinuousStateDerivatives(derivatives=[0.0, -9.81], nDerivatives=2) -> fmi3OK [FMI] fmi3SetTime(time=0.000000000010638260267131509) -> fmi3OK [FMI] fmi3SetContinuousStates(continuousStates=[1.0, -1.043613332205601e-10], nContinuousStates=2) -> fmi3OK [FMI] fmi3GetContinuousStateDerivatives(derivatives=[-1.043613332205601e-10, -9.81], nDerivatives=2) -> fmi3OK ... [FMI] fmi3Termiate() -> fmi3OK [FMI] fmi3FreeInstance() ``` -------------------------------- ### fmusim build Source: https://modelica.github.io/fmusim/reference Builds the platform binary for an FMU with CMake. This subcommand accepts options to configure the CMake build. ```APIDOC ## fmusim build ### Description Build the platform binary for an FMU with CMake. ### Usage `fmusim build [OPTIONS] ` ### Arguments - `` (string) - Required - Path to the FMU file ### Options - `--project-path ` (string) - Path to the generated CMake project directory (default: temporary directory) - `--cmake-generator ` (string) - CMake generator to use (default: platform default) - `--cmake-architecture ` (string) - CMake architecture to use (default: platform default) - `--cmake-options ` (string) - Additional CMake options to pass to the build system - `--debug` (flag) - Create a debug build (default: release build) ``` -------------------------------- ### Simulate FMU and show plot with fmusim simulate --show-plot Source: https://modelica.github.io/fmusim/tutorial Simulates the FMU and opens a plot in a new browser window. ```shell $ fmusim simulate BouncingBall.fmu --show-plot ``` -------------------------------- ### fmusim simulate Source: https://modelica.github.io/fmusim/reference Simulates an FMU. This subcommand accepts various options to control the simulation, such as start/stop times, solver, output, and logging. ```APIDOC ## fmusim simulate ### Description Simulate an FMU. ### Usage `fmusim simulate [OPTIONS] ` ### Arguments - `` (string) - Required - Path to the FMU file ### Options - `--log-fmi-calls` (flag) - Enable logging of FMI function calls - `--log-file ` (string) - File to write the log to (default: stderr) - `--output-interval ` (number) - Interval for sampling the output variables - `--log-time-scale` (flag) - Use logarithmic time scale - `--start-time ` (number) - Start time for the simulation - `--stop-time ` (number) - Stop time for the simulation - `--set-stop-time` (flag) - Set stop time explicitly - `--tolerance ` (number) - Relative tolerance for the simulation - `--set-tolerance` (flag) - Set tolerance explicitly - `--input-file ` (string) - CSV file to read the input from - `--output-file ` (string) - CSV file to store the output - `--intermediate-update` (flag) - Set inputs and get outputs in intermediate update mode - `--show-plot` (flag) - Plot of up to 8 output variables - `--show-markers` (flag) - Show markers in the plot - `--show-events` (flag) - Show events in the plot - `--reference-file ` (string) - CSV file to read the reference output from - `--start-value ` (string) - Set start values for variables (format: variable_name=value) - `--output-variable ` (string) - Record a specific variable - `--early-return-allowed` (flag) - Allow early return - `--event-mode-used` (flag) - Use event mode - `--logging-on` (flag) - Enable FMU looging - `--show-stats` (flag) - Show statisics - `--interface-type ` (enum) - The interface type to use. Possible values: `me` (Model Exchange), `cs` (Co-Simulation) - `--fixed-step-size ` (number) - Step size for fixed step solver (default: output interval) - `--solver ` (enum) - The solver to integrate Model Exchange FMUs. Default value: `cvode`. Possible values: `euler`, `cvode`, `ida` - `--enable-dae` (flag) - Enable DAE mode - `--initial-fmu-state-file ` (string) - File to read the serialized FMU state from - `--final-fmu-state-file ` (string) - File to write the serialized FMU state to ``` -------------------------------- ### Simulate FMU and write CSV output with fmusim simulate --output-file Source: https://modelica.github.io/fmusim/tutorial Simulates the FMU and writes the output to a CSV file. The output file can be used as an input file with the --input-file option. ```shell $ fmusim simulate BouncingBall.fmu --output-file BouncingBall_out.csv ``` ```csv time,h,v 0,1,0 0.01,0.99955855,-0.0981 0.02,0.9981361000000002,-0.1962000000000001 0.03,0.9957326500000004,-0.2943000000000001 0.04,0.9923482000000008,-0.3923999999999997 ... ``` -------------------------------- ### fmusim Source: https://modelica.github.io/fmusim/reference The main command for working with Functional Mock-up Units. It requires a subcommand to perform specific operations. ```APIDOC ## fmusim ### Description Work with Functional Mock-up Units. ### Usage `fmusim ` ### Subcommands - `info` — Display information about an FMU - `list` — List the files contained in an FMU archive - `simulate` — Simulate an FMU - `validate` — Validate an FMU - `build` — Build the platform binary for an FMU with CMake ``` -------------------------------- ### fmusim info Source: https://modelica.github.io/fmusim/reference Displays information about an FMU. This subcommand takes a single argument specifying the path to the FMU file. ```APIDOC ## fmusim info ### Description Display information about an FMU. ### Usage `fmusim info ` ### Arguments - `` (string) - Required - Path to the FMU file ``` -------------------------------- ### Validate an FMU with fmusim validate Source: https://modelica.github.io/fmusim/tutorial Validates an FMU by checking its ZIP archive, model description, and build description. The output shows the validation steps performed. ```shell $ fmusim validate BouncingBall.fmu Validating ZIP archive Validating model description Validating build description ``` -------------------------------- ### fmusim list Source: https://modelica.github.io/fmusim/reference Lists the files contained in an FMU archive. This subcommand takes a single argument specifying the path to the FMU file. ```APIDOC ## fmusim list ### Description List the files contained in an FMU archive. ### Usage `fmusim list ` ### Arguments - `` (string) - Required - Path to the FMU file ``` -------------------------------- ### List FMU contents with fmusim list Source: https://modelica.github.io/fmusim/tutorial Lists the contents of an FMU archive. The output shows the directory structure and files inside BouncingBall.fmu, including binaries for multiple platforms, documentation, and sources. ```shell $ fmusim list BoucingBall.fmu binaries/ documentation/ sources/ modelDescription.xml binaries/aarch64-darwin/ binaries/aarch64-linux/ binaries/x86-windows/ binaries/x86_64-darwin/ binaries/x86_64-linux/ binaries/x86_64-windows/ binaries/aarch64-linux/BouncingBall.so binaries/x86_64-darwin/BouncingBall.dylib binaries/aarch64-darwin/BouncingBall.dylib binaries/x86-windows/BouncingBall.dll binaries/x86_64-linux/BouncingBall.so binaries/x86_64-windows/BouncingBall.dll documentation/result.svg documentation/index.html sources/cosimulation.c sources/config.h sources/buildDescription.xml sources/model.h sources/cosimulation.h sources/fmi3Functions.c sources/model.c ``` -------------------------------- ### fmusim validate Source: https://modelica.github.io/fmusim/reference Validates an FMU. This subcommand takes a single argument specifying the path to the FMU file. ```APIDOC ## fmusim validate ### Description Validate an FMU. ### Usage `fmusim validate ` ### Arguments - `` (string) - Required - Path to the FMU file ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.