Phase Transition, Stability, and Depolarization Field in Ferroelectric Thin Films