An analytical method for the thermal layout optimisation of multilayer structure solid-state devices