%  Highway maintenance model

global CC RGPVM C ATV

% Define constants of the problem

CC = 500000;  		% Construction Cost ($/lane-mile)
RGPVM = .10;		% Revenue generated per vehicle mile ($/veh-mile)
C = 20;				% Constant (lane-mi/YR)
ATV = 1000000;		% Annual traffic volume (veh/YR-lane)

% Define Initial Conditions of the Problem

HWYN = 200;			% HWYN is the initial number of highways (lane-mile)	
to = 0.0;			% to is the initial time to solve this equation
tf = 20;			% tf is the final time
tol = 0.01;			% tol is the tolerance error for ode23 procedure
tspan = [to tf];	% solution  span time 

% Invoke the ordinary differential equation solver

[t,HWY] = ode23('fhwy',tspan,HWYN);

% Plot the results of the numerical integration procedure

plot(t,HWY,'b')
xlabel('Time (years)')
ylabel('Highways (Lane-Miles)')
grid
