function [f,zc,H]=bball()
    function dx=f(x,d,t)
       m=1;
       b=30;
       k=100000;
       g=9.8;
       dx=[x(2);1/m*(-m*g-d*(b*x(2)+k*x(1)))];
    endfunction

    function z=zc(x,d,t)
        z=x(1);
    endfunction
    
    function [x,d]=H(x,d,t,sig,ind)
        //sig=1 says that zc crosses to a positive value
        //sig=-1 ...
        if sig>0 then
            d=0;
        else
            d=1;
        end
    endfunction
      
endfunction
