2D MHD modelling of compressible and heated coronal loops obtained via nonlinear separation of variables and compared to TRACE and SoHO observations