A transportation engineering study requires that you determine the number of cars that pass through an intersection traveling during morning rush hour. You stand at the side of the road and count the number of cars that pass every 4 minutes at several times as tabulated below. Use the best numerical method to determine (a) the total number of cars that pass between 7:30 and 9:15, and (b) the rate of cars going through the intersection per minute.
Step 11 of 3
Since the time is given in hours, we need to convert rate of passing cars from (1/4 min) to (1/hour), and we do that by multiplying the second row of the given table by 60/4, or 15. Also, notice that the first row needs to be rewritten, for example: 7:30 is 7.5 hours and 7:45 needs to be written as 7.75, and so on. Hence, the data becomes as follows:
t=[7.5 7.75 8 8.25 8.75 9.25]; Nt=[18 23 14 24 20 9]*15;
Next, we apply Simpson's 1/3 for the first two segments from to , and Simpson's 3/8 rule for the last three segments from to , as shown in the MATLAB code below.
clear; clc; close all; t=[7.5 7.75 8 8.25 8.75 9.25]; Nt=[18 23 14 24 20 9]15; m = length(t); n=3;%For the 1/3 rule n1=(Nt(1)+Nt(n)); n2=0; n3=0; for i=2:n-1 if rem(i,2)==0%checking if i is even n2=n2+4Nt(i); else n3=n3+2Nt(i); end end N1=(t(n)-t(1))(n1+n2+n3)/(3*(n-1));
%-Next, is the application of the 3/8 rule-% N2=(t(m)-t(n))(Nt(n)+3Nt(n+1)+3*Nt(m-1)+Nt(m))/8; N=N1+N2; fprintf('The total number of cars is %0.3f\n',N);
The total number of cars is 518.281
Recommended textbook solutions
Suppose that production of 1 unit of agriculture requires 1/3 unit of agriculture, 1/3 unit of manufacturing, and 1/3 unit of transportation. To produce 1 unit of manufacturing requires 1/2 unit of agriculture, 1/4 unit of manufacturing, and 1/4 unit of transportation. To produce 1 unit of transportation requires 0 units of agriculture, 1/4 unit of manufacturing, and 3/4 unit of transportation. Find the ratio of the three commodities in the closed model.
At a local university, each engineering major requires a different number of credits for graduation. For example, recently the requirements were as follows:
Prompt the user to select an engineering program from a menu. Use a switch/case structure to send the minimum number of credits required for graduation back to the command window.
An economy is based on two sectors, transportation and manufacturing. Production of a dollar's worth of transportation requires an input of $0.10 from each sector and production of a dollar's worth of manufacturing requires an input of$0.40 from each sector. Find the output for each sector that is needed to satisfy a final demand of $5 billion for transportation and$20 billion for manufacturing.