def double_well(Phi, dPhi, mPhi, Curve, i): # Double-well potential function SmallMask = (mPhi <= 1) & (mPhi >= 0) LargeMask = (mPhi > 1) P = SmallMask * np.sin(2 * np.pi * mPhi) / \ (2 * np.pi) + LargeMask * (mPhi - 1) dP = ((P != 0) * P + (P == 0)) / ((mPhi != 0) * mPhi + (mPhi == 0)) Well = np.gradient(dP * dPhi[0] - dPhi[0])[0] + \ np.gradient(dP * dPhi[1] - dPhi[1])[1] + 4 * htk_utls.del2(Phi) return Well
def single_well(Phi, Curve): # Single-well potential function return 4 * htk_utls.del2(Phi)-Curve