Stability analysis of static solutions in a Josephson junction