Translation¶
Translation into CasADi
FastSmoothBuildings.UsersGuide.Translation, class (source)
Extends FastSmoothBuildings.Icons.Information.
rumoca translates a model of the library into a CasADi function
dx/dt = f(t, x, u, p), the inputs u being the top-level inputs
of the model (weather, gains, controls). From Python, with the package fastsmoothbuildings:
import rumoca import fastsmoothbuildings session = rumoca.Session(roots=[str(fastsmoothbuildings.LIBRARY)]) model = session.loads(source, model="MyBuilding.building").to_casadi()
The library keeps to what rumoca translates, and a model built from it has to as well:
- the sizes of arrays and the subscripts are evaluated from literal parameters only, not from a sum, a function or the default of a record: the records of the constructions carry their counts and node indices written out;
- the model is an explicit ODE: no algebraic loop that rumoca would have to solve, no event;
- every function is smooth (see Smoothing), and conditions on parameters only are evaluated before the translation;
- equations carry no description strings;
- a table given to dayTable is a parameter, not a literal matrix in the call, and at the top level of a model the call is an equation, not the binding of a declaration: rumoca 0.10.3 expands the loop of the function into extra equations otherwise (the zones and the ideal systems of the library call it this way).
rumoca 0.10.3 from the commit 33c21141 of its main branch exports connected models to CasADi; the
release 0.10.2 on PyPI does not.