dymolasdf

Dymola converting output files to sdf - doesn't work for large files?


After simulation is finished Dymola runs dsres2sdf.exe to convert the results to sdf-format (if that option is enabled in the simulation setup output tab).

Usually this runs smoothly but sometimes it generates a sdf file that is very small (800 Byte) and empty. Starting the dsres2sdf.exe manually from command line generates the same empty file.

I suspect that happens if the *.mat-File is very large (>1 GB)

Anybody has any clue how to get a proper sdf-File?


Solution

  • The SDF Editor and the SDF libraries for Python and MATLAB can read Dymola result files (*.mat) transparently (as if they were SDFs) and allow you to save them as *.sdf.

    For example with Python:

    import sdf
    
    # load the Dymola result file
    data = sdf.load('DoublePendulum.mat')
    
    # re-save as SDF
    sdf.save('DoublePendulum.sdf', data)