System.prepare#
- System.prepare(quick=False, incremental=False, models=None, nomp=False, ncpu=1)[source]#
Generate numerical functions from symbolically defined models.
All procedures in this function must be independent of test case.
- Parameters
- quickbool, optional
True to skip pretty-print generation to reduce code generation time.
- incrementalbool, optional
True to generate only for modified models, incrementally.
- modelslist, OrderedDict, None
List or OrderedList of models to prepare
- nompbool
True to disable multiprocessing
Warning
Generated lambda functions will be serialized to file, but pretty prints (SymPy objects) can only exist in the System instance on which prepare is called.
Notes
Option
incremental
compares the md5 checksum of all var and service strings, and only regenerate for updated models.Examples
If one needs to print out LaTeX-formatted equations in a Jupyter Notebook, one need to generate such equations with
import andes sys = andes.prepare()
Alternatively, one can explicitly create a System and generate the code
import andes sys = andes.System() sys.prepare()