Thermal and Electrical Layout Optimisation of Multilayer Structure Solid-State Devices based on the 2-D Fourier series