Influence of dipolar defects on switching behavior in ferroelectrics