Have a look at UserExpressions, for instance:
Here, you can substitute self.T with your function, which has to be evaluated at x[0],x[1],x[2]