%dog slip process simulation
% y is detemination of whether the dog will slip at current time t
% y = 1 when the dog slips, y = 0, the dog does not slip


       %-------------------%
       function y = DogSlip(t)
           
           if t-floor(t)<0.01  % slip only happens at sharp time tick
               x = rand()*20;
               
               if t > x
                   y = 1;
               else
                   y = 0;     
               end
           else
               y=0;
           end

       %-------------------%