matlab
ME 354 Numerical Simulation Homework Assignment #3
Problem 1
The Maclaurin series expansion for 𝑐𝑜𝑠(𝑥) is 𝑐𝑜𝑠(𝑥) = 1 − 𝑥2
2 +
𝑥4
4! −
𝑥6
6! +
𝑥8
8! − ⋯
Starting with the simplest version 𝑐𝑜𝑠(𝑥) = 1, add terms one at a time to estimate 𝑐𝑜𝑠(𝜋 3⁄ ). After each new term is added, compute the true and approximate percent relative errors. Use
your calculator or MATLAB to determine the true value. Add terms until the approximate error
is below 0.5%.
Problem 2
A nice application of integration is to compute the distance z(t) of an object based on its velocity
v(t). Take our bungee jumper as example the velocity is given as 𝑣(𝑡) = √ 𝑔𝑚
𝑐𝑑 tanh(√
𝑔𝑐𝑑
𝑚 𝑡)
Suppose that we had measurements of velocity at a series of discrete unequally spaced times
during free fall. Use the above equation to synthetically generate such information for a 70-kg
jumper with a drag coefficient of 0.275 kg/m. Incorporate some random error by rounding the
velocities to the nearest integer. Then use cumtrapz to determine the distance fallen and compare
the results to the analytical solution 𝑧(𝑡) = 𝑚
𝑐𝑑 ln[cosh (√
𝑔𝑐𝑑
𝑚 𝑡)]. In addition, develop a plot of
the analytical and computed distances along with velocity on the same graph.