Example. Multivariate expression
syms x z
f(x,z) = x/(1+z^2);
Taking the integral with respect to x
Fx = int(f,x)
Taking the integral with respect to z
Fz = int(f,z)
Example. Definite integral with a bound
syms x
expression = x*log(1+x); F = int(expression,[0 1])
Finding root in MATLAB
Let¡¯s specify the function of interest
fun=@(x) f(x)
fun=@(x) 70-12*x-(1.5*x^2)/2
We then specify an initial point (or guess) x0 = 0; you can also try x0 = -10
To find the root closer to the initial guess, we fzero command
x = fzero(fun,x0)
Problem 3. In this problem, you are asked to analyse real traffic data collected from loop detectors from a freeway in Portland, Oregon in the USA. Volume information is in vehicle per lane per hour. Speed is in mile per hour.
Download the loop detector data file (csv format) from Moodle.
Part 1. (MATLAB)
(a) Plot the time-series graph for volume; x axis being time and y axis being volume.
(b) Plot the time-series graph for speed; x axis being time and y axis being speed.
(c) Plot the time-series graph for occupancy; x axis being time and y axis being
occupancy.
(d) Describe what you observed in the time-series. For example, when does congestion
start, called congestion onset? When does congestion end, called congestion offset? Do we have both morning and afternoon peak congestion? What¡¯s the average speed during congestion vs. average speed during non-congested times of the day?
Part 2. (MATLAB)
(e) Scatter plot the volume-occupancy graph; x axis being occupancy and y axis being volume.
(f) Scatter plot the speed-occupancy graph; x axis being occupancy and y axis being speed.
(g) Scatter plot the speed-volume graph; x axis being volume and y axis being speed.