Question: Using matlab please give the code for this assignment: Major Assignment 2 Due Friday, November 1 5 by 1 1 : 5 9 pm The

Using matlab please give the code for this assignment:
Major Assignment 2
Due Friday, November 15 by 11:59 pm
The purpose of this major assignment is to consolidate your knowledge of the material on systems of
linear equations and MATLAB functions covered up to this point.
You should submit one Matlab file following this naming format: major2_ID#.m
(e.g., major2_123456789.m)
Problem
Traffic incident duration is a measure of the time required to detect, respond, and clear an incident from
the road. Examples of these incidents include collisions, broken vehicles, fallen trees, among others. As
demonstrated in the breakdown above, the incident duration can be calculated as the sum of its time
components (denoted T1, T2, and T3).
The following system of equations relates the time components (measured in seconds) of the incident
duration to three major factors that have a strong impact:
1=0.015+4.733.81
2=0.0930.810.77
3=0.0380.56+17.55
Where V is the traffic volume in vehicles per hour (vph), S is the average vehicle speed on the road in
km/h, and L is the number of lanes blocked by the incident.
Task 1
If the time components of a recently recorded incident were measured as T1=197.76 s, T2=179.42 s, and
T3=97.36 s, what are the corresponding factors (volume, speed, and lanes blocked) at the time of the
incident? To answer this, write a multi-line function that uses the Gauss Elimination method to solve the
system of equations and retrieve the values of the three factors. [Use variable names of A = matrix of
coefficients, B = vector of equation values, XGauss = solution vector].
Page 2 of 2
Task 2
Solve the system of equations from Task 1 using a built-in MATLAB command to find XMat, and check
(using an IF statement) if the answer matches your Gauss Elimination solution. Your check should
conclude that the Gauss Elimination solution is accurate only if the error summation of all three calculated
factors does not exceed a tolerance of 0.1%.
Task 3
Assuming that the system of equations has been tested for a finite range of values of the three factors (V,
S, and L), what are all the possible incident durations that can be calculated with this system?
Factor Unit Range Step size Total scenarios
Volume (V) vph 500-350010031
Speed (S) km/h 10-100519
Lanes blocked (L)-1-414
The table above lists the range, step size, and the subsequent number of possible scenarios for each of
the three factors. Using nested loops, create a vector called durations of all the possible values of
incident duration. Include a check that verifies if any of T1, T2, or T3 are negative, and changes the negative
value to zero. Then find the minimum and maximum incident durations (in minutes) of the developed
vector.
Task 4
Print to the command window only the following with the blanks filled automatically from your coded
solution:
Using Gauss Elimination, the time components of the reported incident indicate that the
traffic volume was _____ vph, the average speed was _____ km/h, and _____number of
lanes were blocked.
Validation using MATLABs built-in functions revealed that the Gauss Elimination method
was (accurate/inaccurate).
In total, there were _____ possible scenarios of incident duration that could be solved
using the system of equations, with a minimum of _____ min and a maximum of _____

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!