Overview of the Border Control System
The X, Y, and Z acceleration limits (minimum and maximum) is calculated for each subject or individual by the following MATLAB code.
MATLAB code:
uiimport; % import the .csv file and rename it sub1
A= table2array(sub1);j=1;k=1;l=1;m=1;n=1;o=1;
for i=1:1:(length(A)-1)
if A(i,5)==1
xacc1(i,1) = A(i,2);
yacc1(i,1) = A(i,3);
zacc1(i,1) = A(i,4);
elseif A(i,5)==2
xacc2(j,1) = A(i,2);
yacc2(j,1) = A(i,3);
zacc2(j,1) = A(i,4);
j=j+1;
elseif A(i,5)==3
xacc3(k,1) = A(i,2);
yacc3(k,1) = A(i,3);
zacc3(k,1) = A(i,4);
k=k+1;
elseif A(i,5)==4
xacc4(l,1) = A(i,2);
yacc4(l,1) = A(i,3);
zacc4(l,1) = A(i,4);
l=l+1;
elseif A(i,5)==5
xacc5(m,1) = A(i,2);
yacc5(m,1) = A(i,3);
zacc5(m,1) = A(i,4);
m = m+1;
elseif A(i,5)==6
xacc6(n,1) = A(i,2);
yacc6(n,1) = A(i,3);
zacc6(n,1) = A(i,4);
n = n+1;
elseif A(i,5)==7
xacc7(o,1) = A(i,2);
yacc7(o,1) = A(i,3);
zacc7(o,1) = A(i,4);
o = o+1;
end
end
%%% Activity 1 min and max accelearion in x,y,z direction
act1x = [min(xacc1),max(xacc1)]
act1y = [min(yacc1),max(yacc1)]
act1z = [min(zacc1),max(zacc1)]
%%% Activity 2 min and max accelearion in x,y,z direction
act2x = [min(xacc2),max(xacc2)]
act2y = [min(yacc2),max(yacc2)]
act2z = [min(zacc2),max(zacc2)]
%%% Activity 3 min and max accelearion in x,y,z direction
act3x = [min(xacc3),max(xacc3)]
act3y = [min(yacc3),max(yacc3)]
act3z = [min(zacc3),max(zacc3)]
%%% Activity 4 min and max accelearion in x,y,z direction
act4x = [min(xacc4),max(xacc4)]
act4y = [min(yacc4),max(yacc4)]
act4z = [min(zacc4),max(zacc4)]
%%% Activity 5 min and max accelearion in x,y,z direction
act5x = [min(xacc5),max(xacc5)]
act5y = [min(yacc5),max(yacc5)]
act5z = [min(zacc5),max(zacc5)]
%%% Activity 4 min and max accelearion in x,y,z direction
act6x = [min(xacc6),max(xacc6)]
act6y = [min(yacc6),max(yacc6)]
act6z = [min(zacc6),max(zacc6)]
%%% Activity 7 min and max accelearion in x,y,z direction
act7x = [min(xacc7),max(xacc7)]
act7y = [min(yacc7),max(yacc7)]
act7z = [min(zacc7),max(zacc7)]
Output:
act1x =
1455 2356
act1y =
1697 2569
act1z =
1644 2739
act2x =
1786 2011
act2y =
2244 2631
act2z =
1915 2266
act3x =
1697 2054
act3y =
2243 2713
act3z =
1902 2263
act4x =
1704 2110
act4y =
2179 2678
act4z =
1878 2248
act5x =
1656 2143
act5y =
2110 2677
act5z =
1862 2377
act6x =
1703 2133
act6y =
2167 2648
act6z =
1851 2326
act7x =
1624 2096
act7y =
2271 2632
act7z =
1830 2358
Now, for subject 1 it is seen that the minimum and maximum of the acceleration in X, Y and Z direction for the 7 activities overlaps with each other and hence the activities cannot be separated by the accelerometer reading. Similarly, for other subjects or individuals also the conclusion holds true and hence a generalized model cannot be formed from the subjects.
Comparing Taxi and Uber Usage
Your firm is investigating the impact of ride sharing services such as Uber on transport. In particular, they wish to see if the geographic distribution of ride sharing users is the same as taxi users, or if different regions have a preference for different services.
You have been provided with one week’s data for New York City, split into three files:
- csv
- csv
- uber-raw-data-sep14_reduced.csv
Using this data, cluster the data based on pickup location (use 20 clusters) and investigate:
- Is the overall distribution of users the same between taxi and uber users?
- Do any differences become more or less pronounced at different times of the day? In particular consider the time windows:
- 7am – 9am
- 8pm – midnight.
You should draw on the unit content regarding clustering and visualisation to answer this question.
(Provide any code or worksheets you use to justify your response.)
Based on the pickup location 20 clusters are created by means of k-means algorithm of clustering which uses Euclidian Distance metric and the algorithm of k-means++ to define the center of the clusters. Furthermore, in 3 files or spaces of New York city, to visualize the concentration of pickup based on locations 3 histograms are created.
MATLAB code:
uiimport % import the 3 files
A = uberrawdatasep14reduced;
idx = kmeans([A{:,2},A{:,3}],20); % computing k-means clustering
figure
histogram(idx,20) % creating histogram for data-points in each cluster
title(‘Data points in each cluster of A’)
B = yellowtripdata201409reduced;
idx = kmeans([B{:,2},B{:,3}],20);
figure
histogram(idx,20)
title(‘Data points in each cluster of B’)
C = greentripdata201409reduced;
idx = kmeans([C{:,2},C{:,3}],20);
figure
histogram(idx,20)
title(‘Data points in each cluster of C’)
Histograms:
Hence, as the data-points in each clusters are very much different, hence it can be concluded that overall distribution of users of taxi and uber are different in different locations.
Ethical Dilemma
Imagine you are one of the engineers employed by Volkswagen (VW) who were tasked with designing, constructing, and embedding a “defeat device” in many of its diesel engines that are fitted to its cars sold worldwide.
- Briefly summarise and discuss in your own words the main elements of the Engineers Australia Code of Ethics which you will abide by as a Professional Practicing Engineer.
- As this is an ethical dilemma, list a strategy or strategies you would enact as you are uncomfortable and unwilling to adopt directives from your supervisor to develop and implement such a defeat device.
You can draw on the discussion presented in class (see EGH404 Workshop 6) and in your wider reading to help you answer this question.The codes that should be followed as an engineer according to Engineers Australia Code of ethics are Demonstrating integrity, Practicing Competently, Exercising leadership, Promoting sustainability. The integrity demonstration involves acting on the basis of correct information, maintaining trust and honesty, respecting others dignity. Practicing Competently involves developing knowledge and skills continuously, practicing within expertise and representing expertise accordingly, acting on the basis of available knowledge. Now, leadership exercising involves building reputation and trustworthiness, encouraging diversity, effective and honest communication. Promoting sustainability involves engaging responsibly with the community, Engineering practice for maintaining safety and good health of the community, balancing the needs of the present generation with the future generation.
Now, as designing, constructing and embedding the ‘’defeat device’’ in the car will violate the code of maintaining honesty and trustworthiness, promoting sustainability, hence some strategies should be followed such that the above codes are not violated. Hence, the best strategy is to employ the “defeat” device in such a way it do not pass the emission test. Another strategy is to report to the government through actual emission data collected automatically from the car, well after the car passes the emission test.