Matrix reduction tool for creating boundary condition independent dynamic compact thermal models