% 	car_visc.m

%	This function, which is called by the program 'car.m', contains the 

%	equation of motion of a car on an incline subjected to viscous friction.

%

% 	Introduce  V_dot, the time derivative of v.

%

function V_dot = car_visc(t,v)

%

%	Declare global parameters (a MATLAB detail).

%

global g alpha b m 

%

%	The mathematical model of the car provides an equation for v_dot.

%

V_dot = g * sin(alpha * pi/180) - (b/m) * v;

%

%	That's all there is to it!