% Script to calculate the area under the runoff function 
% Programmer: T. Trani

global k1 k2 k3 k4 

% Calls function runoff

% areaUnderRunoff is the runoff volume (cubic meters per second) 
% generated by the shopping mall  into the ponding area 
% t is the time (in seconds) after the thunderstorm starts

k1 = 50;          % multiplicative parameter of the function
k2 = 2;              % additive parameter of the function
k3 = 1500;          % parameter of sinusoidal term
k4 = 800;          % parameter of exponential term

tLast = 4500;       % final time to do the calculation (seconds)

% Estimate the area under runoff function

areaUnderRunoff = quad('function_Runoff_rev',0,tLast);

disp(['Area under the Curve is   ',num2str(areaUnderRunoff)])

