gEconpy.classes.time_aware_symbol.TimeAwareSymbol#

class gEconpy.classes.time_aware_symbol.TimeAwareSymbol(name, time_index, **assumptions)#

Subclass of sympy.Symbol with a time index.

A TimeAwareSymbol is identical to a symPy.Symbol in all respects, except that it has a time index property that is used when determining equality and hashability. Two symbols with the same name, assumptions, and time index evaluate to equal.

Examples

from gEconpy.classes.time_aware_symbol import TimeAwareSymbol

x1 = TimeAwareSymbol("x", time_index=1)
x2 = TimeAwareSymbol("x", time_index=2)

print(x1 == x2)  # False, time indexes are different
print(x1 == x2.set_t(1))  # True, time indexes are the same
print(x1.step_forward() == x2)  # True, time indexes are the same

Methods

TimeAwareSymbol.exit_ss()

Set the time index to zero if in the steady state, otherwise do nothing.

TimeAwareSymbol.set_t(t)

Set the time index to a specific value.

TimeAwareSymbol.step_backward()

Decrement the time index by one.

TimeAwareSymbol.step_forward()

Increment the time index by one.

TimeAwareSymbol.to_ss()

Set the time index to steady state.

Attributes

base_name

time_index

default_assumptions

safe_name