translator

Module:

Translates structures to Bender’s language.

class translator.Translator

Translates expressions to forms usable in Bender.

>>> Translator.translate(Dx(vx))
 'v->vx[DX]'
classmethod remove_xyt(expr)
>>> Translator.remove_xyt('vx(x, y, t)')
 'vx'
classmethod translate(envelope, joint, expr, bc=False)

Translates expression expr to a form in C.

>>> Translator.translate(Dx(vx), 'v', '->')
 'v->vx[DX]'
classmethod translate_derivatives(expr)
>>> Translator.translate_derivatives('D(vx, x)')
 'vx[DX]'
classmethod translate_variables(expr)

Translates variables in expr to a form usable in Bender.

>>> Translator.translate_variables('vx + vy')
 'v->vx + v->vy'

Previous topic

utils

This Page