Stability analysis of an insulationless HTS pancake coil under the magnitude of external magnetic field