function yprime = fhwy3_rev(t,y)

global 	HME  FEOM OMC FEMR MRC HDETT HAT

% define rate equation(s)

HD = y(2) / HDETT;			% Highway deteriorating (lane-mi/yr)
HA = y(1) / HAT;			% Highway aging (lane-mi/yr)
HOM = HME * (FEOM / OMC);	% Highway with ordinary maintenance (lane-mi/yr)
HMR = HME * (FEMR / MRC);	% Highway with maint replacement (lane-mi/yr)

% Define the rate equations (3 rate variables representing PSH, PDFH and PDTH)
%
% PSH - Physically sufficient highways
% PDFH - Physically defficient highways
% PDTH - Physically deteriorated highways

yprime(1) = HOM + HMR - HA;		% Rate of change of PSH (la-mi/yr)
yprime(2) = HA - HD - HOM ;		% Rate of change of PDFH (la-mi/yr)
yprime(3) = HD - HMR;		    % Rate of change of PDTH (la-mi/yr)

yprime=yprime';					% column vector format
