Save a simplified ModelingToolkit problem as text

Bart_van_de_Lint
Wed, 16 Apr 2025 13:23:01 +0000
Modelling & Simulations

Because structural_simplify is slow, I want to write the simplified system to a file, from where I can load it later. Using serialize("sys.bin", sys) works, but this causes problems when switching between julia versions, and with undefined variables when creating getter functions… Is there a way to write and load the simplified system as text in a human-readable format?

I guess it should be possible to write unknowns(sys), equations(sys) etc... to a file in the correct format, so that you can create a model from it again. Maybe someone has done this before?

7 posts - 3 participants

Read full topic