ANDES 1.5.0 boasts performance improvement as much as 30%.
All generated numerical code can be compiled just-in-time using numba.
Details are as follows:
- Support numba just-in-time compilation of all equation and Jacobian calls.
This option accelerates simulations by up to 30%. The acceleration is visible in medium-scale systems with multiple models.
Such systems involve heavy function calls but rather a moderate load for linear equation solvers.
The speed up is less significant in large-scale systems where solving equations is the major time consumer.
Numba is required and can be installed with ``pip install numba`` or
``conda install numba``.
To turn on numba for ANDES, in the ANDES configuration under ``[System]``,
set ``numba = 1`` and ``numba_cache = 1``.
The just-in-time compilation will compile the code upon the first execution based on the input types.
When the compilation is triggered, ANDES may appear frozen due to the compilation lag.
The option ``numba_cache = 1`` will cache compiled machine code, so that
the compilation lag only occurs once until the next ``andes prep``.
Thanks to the maintainers and contributors of SymPy for the hotfixes for the generated code of `Piecewise`.
asmeurer ThePauliPrinciple and oscarbenjamin.
- Allow ``BackRef`` to populate to models through ``Group``.
When model `A` stores an ``IdxParam`` pointing to a group, if ``BackRef``
with the name `A` are declared in both the group and the model,
both ``BackRef`` will retrieve the backward references from model `A`.
- Allow ``BaseVar`` to accept partial initializations.
If ``BaseVar.v_str_add = True``, the value of `v_str` will be added in place
to variable value.
An example is that the voltage compensator sets part of the input voltage, and
the exciter reads the bus voltage. Exciter has `v.v_str_add = True` so that
when compensators exist, the input voltage will be bus voltage (vbus) plus
(Eterm - vbus).
If no compensator exists, the exciter will use bus voltages and function as expected.
- Added reserved variable names ``__ones`` and ``__zeros`` for ones and
zeros with a length equal to the device number.
``__ones`` and ``__zeros`` are useful for vectorizing ``choicelist``
in ``Piecewise`` functions.