The units and dimensions of Derivatives are not handled well, as the units of Derivative(meter, second) should be meter/second), but we get:
from sympy import Derivative, Eq, Function, symbols
from essm.variables import Variable
from essm.equations import Equation
from essm.variables.units import meter, second
from essm.variables.units import derive_unit, derive_baseunit
class v(Variable):
"""Velocity"""
unit = meter / second
class d(Variable):
"""Distance"""
unit = meter
class t(Variable):
"""Time"""
dt = Function(d)(t)
print(Derivative(dt, t))
print(derive_unit(Derivative(dt, t)))
print('Even using the symbols in Derivative does not give meter/second as base units:')
print(Derivative(d,t))
print(derive_baseunit(Derivative(d,t)))
Derivative(d(t), t)
1
Even using the symbols in Derivative does not give meter/second as base units:
Derivative(d, t)
meter
The units and dimensions of Derivatives are not handled well, as the units of
Derivative(meter, second)
should bemeter/second)
, but we get: