1, you could create a tensor easily by using 'as_tensor', like:
K = as_tensor([\
[1.0, 0.0, 0.0],\
[0.0, 2.0, 0.0],\
[0.0, 0.0, 3.0],\
])
2, The third equation is a convection problem, which the standard finite element method is not good at. I suggest you using DG method or SUPG method.