setResultFile — OpenModelica User's Guide v1.28.0-dev-449-g67217b6ea02 documentation

# setResultFile

Specifies the file where simulation results of an instantiated SSP model will be stored.

> Notes:

>   - The file path can be relative or absolute.

>   - Supported formats depend on the simulator backend (commonly .mat or .csv files).

>   - Must be called before simulate() to ensure proper logging of results.

Syntax:

    setResultFile(file_path)

Parameters:

  - `file_path` (str): Path to the simulation result file.

Example usage:

    from OMSimulator import SSP, CRef, Settings

    Settings.suppressPath = True

    # Load SSP and instantiate model
    model = SSP("SimpleSimulation2.ssp")
    instantiated_model = model.instantiate()

    # Specify the result file
    instantiated_model.setResultFile("SimpleSimulation6_res.mat")