function [f,zc,H]=bballreset()
    function dx=f(x,d,t)
       m=1;
       b=30;
       k=100000;
       g=9.8;
       dx=[x(2);-g];
    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
            x(2)=-x(2)*0.8;
        end
    endfunction
      
endfunction
