CBD.converters.latexify.functions module¶
New and improved LaTeX-generation module.
- class CBD.converters.latexify.functions.Time(value, relative=False)[source]¶
Bases:
objectRepresents the time variable to be used in the equations.
- Parameters
value (numeric) – The value of the time.
relative (bool) – When
True, the time is relative to some time variable. WhenFalse, the time is meant to be an absolute time.
- class CBD.converters.latexify.functions.Eq(lhs, rhs, time=<CBD.converters.latexify.functions.Time object>)[source]¶
Bases:
objectRepresents an equation in the form of \(y = f(x)\) .
- Parameters
- at(time)[source]¶
Some equations have multiple solutions for a specific time. This function will obtain all corresponding equations for solving the current one at time
time.- Parameters
time (Time) – The current time to solve the equation at.
- Returns
A list of new equations, solved at a specific time.
- class CBD.converters.latexify.functions.Fnc(name, time=<CBD.converters.latexify.functions.Time object>, eq_time=<CBD.converters.latexify.functions.Time object>)[source]¶
Bases:
objectRepresentation of a righthandside of an equation. This is an superclass for all specific function types.
- Parameters
name (str) – The name for the function.
- Keyword Arguments
- class CBD.converters.latexify.functions.MultiFnc(name, symbol, time=<CBD.converters.latexify.functions.Time object>, eq_time=<CBD.converters.latexify.functions.Time object>)[source]¶
Bases:
CBD.converters.latexify.functions.FncCollection function for both the adder and the product blocks
- class CBD.converters.latexify.functions.UnaryFnc(name, symbol, time=<CBD.converters.latexify.functions.Time object>, eq_time=<CBD.converters.latexify.functions.Time object>)[source]¶
Bases:
CBD.converters.latexify.functions.FncCollection function for unary input functions
- class CBD.converters.latexify.functions.BinaryFnc(name, symbol, time=<CBD.converters.latexify.functions.Time object>, eq_time=<CBD.converters.latexify.functions.Time object>)[source]¶
Bases:
CBD.converters.latexify.functions.FncCollection function for binary input functions
- class CBD.converters.latexify.functions.ConstantFnc(name, val, time=<CBD.converters.latexify.functions.Time object>, eq_time=<CBD.converters.latexify.functions.Time object>)[source]¶
Bases:
CBD.converters.latexify.functions.FncFunction that represents a constant value
- class CBD.converters.latexify.functions.VarFnc(name, time=<CBD.converters.latexify.functions.Time object>, eq_time=<CBD.converters.latexify.functions.Time object>)[source]¶
Bases:
CBD.converters.latexify.functions.FncFunction that represents a variable name
- class CBD.converters.latexify.functions.DelayFnc(name, time=<CBD.converters.latexify.functions.Time object>, eq_time=<CBD.converters.latexify.functions.Time object>)[source]¶
- class CBD.converters.latexify.functions.DerivatorFnc(name, time=<CBD.converters.latexify.functions.Time object>, eq_time=<CBD.converters.latexify.functions.Time object>)[source]¶
Bases:
CBD.converters.latexify.functions.FncFunction that represents a derivative
- class CBD.converters.latexify.functions.IntegratorFnc(name, time=<CBD.converters.latexify.functions.Time object>, eq_time=<CBD.converters.latexify.functions.Time object>)[source]¶
Bases:
CBD.converters.latexify.functions.FncFunction that represents an integral
- CBD.converters.latexify.functions.BLOCK_MAP = {'AdderBlock': <function <lambda>>, 'AndBlock': <function <lambda>>, 'ConstantBlock': <function <lambda>>, 'DelayBlock': <function <lambda>>, 'DeltaTBlock': <function <lambda>>, 'DerivatorBlock': <function <lambda>>, 'EqualsBlock': <function <lambda>>, 'GenericBlock': <function <lambda>>, 'IntegratorBlock': <function <lambda>>, 'InverterBlock': <function <lambda>>, 'LessThanBlock': <function <lambda>>, 'LessThanOrEqualsBlock': <function <lambda>>, 'ModuloBlock': <function <lambda>>, 'NegatorBlock': <function <lambda>>, 'NotBlock': <function <lambda>>, 'OrBlock': <function <lambda>>, 'PowerBlock': <function <lambda>>, 'ProductBlock': <function <lambda>>, 'RootBlock': <function <lambda>>, 'TimeBlock': <function <lambda>>}¶
The mapping for all known blocks in CBDs. If you created your own block with its own representation, you need to set it in the
type_formatsof theCBD.converters.latexify.CBD2Latexclass.