function T = torquefun(t,x)

theta = x(2);
dtheta = x(3);

% No external torque
T = 0;

% % Or, oscillating torque
% freq = 2;
% T = 1e-2*square(freq*t*2*pi);

% % Or, torque that imitates contact of a stiff surface
% thetacontact = 2*2*pi;
% Ksurface = 0.05;
% T = max(0,Ksurface*(theta-thetacontact));

% % Or, model of bearing friction due to radial load
% Frad = 20;          % radial load in Newtons
% mu = 0.02;          % bearing coefficient of friction
% rbear = 0.006;      % radius of bearing contact surface
% %T = sign(dtheta) * mu * Frad * rbear;
% T = atan(100*dtheta) * mu * Frad * rbear;

