Mathematical and Numerical Modelling of Heterostructure Semiconductor Devices From Theory to Programming