Description
Problem 1:
Based on the source link:
https://coronavirus.jhu.edu/data/new-cases-50-states/new-jersey
(The data is taken from the above link and is only used for the purpose of teaching.)
1. Extract 12 sampling points from Mar 2020 to the present. Type in these data
in your Solution PDF. (Hints: the data would be x : date vs. y : number of
positive cases. You can choose these data by hand, no coding is required.) (20
points)
2. Use Cubic Spline to perform interpolation functions and plot the results. Round
all numbers/coefficients in cubic spline functions to 4 significant digits and show
these functions and the plot in your solution PDF. Do not show intermediate
terms, for example, fractions are required to be further evaluated to decimal
numbers. (You can use the lecture code directly. Note that, if you use ‘spline’
function in Matlab or the like, there would be no credits for this question.) (20
points)
3. Use Trapezoid rule to find the following integral:
Z x11
x0
P(x)dx
where x0 and x11 denote the first and the last data points, respectively. Show
details in your solution PDF. (Hints: We have got 12 points (x, y) from Question
1, so there is no need of P(x)), (20 points)
Problem 2: Theoretical assignment
We first consider the following single degree of freedom (SDOF) problem:
u˙ + λu = 10 cos(t/10)
u0 = 100
(1)
where the exact solution is given by:
u(t) =
u0 −
1000λ
1 + 100λ2
exp
−λt +
100[10λ cos(t/10) + sin(t/10)]
1 + 100λ2
(2)
and the numerical error is defined as:
Error =
Numerical − Exact
Exact
(3)
Define the time step length: h = 0.01, and
1. Use Explicit Euler Forward scheme to get u at t1, t2 and t3 and the associated
errors (20 points)
2. Use RK 4 to solve this problem to get u at t1, t2 and t3 and the associated errors
(20 points)
3. Use Implicit Euler Backward to to get u at t1, t2 and t3 and the associated
errors (20 points)

