    function dy=drivfun(s,y,ipram)
%   ODE file for Pendant, drivfun.m
%   y=[ang,z,x]
    global B
    if y(3)<1.e-4 
        dy(1)=2/B(ipram)-y(2)-1/B(ipram);
    else
        dy(1)=2/B(ipram)-y(2)-sin(y(1))/abs(y(3));
    end
    dy(2)=sin(y(1));
    dy(3)=cos(y(1));
    dy=dy';
