Program for switch simulation