Mathematical modelling of semiconductor devices and circuits