HW 7

due 10/31/2024 before midnight via Learning Suite 25 possible points


These first two problems are based on problems in “Applied Numerical Methods with Python” by Steven Chapra and David Clough, the latter is based on problems in “Principles of Statistics for Engineers and Scientists” by William Navidi.

  1. A mass-spring-damper is a common mechanical system model (e.g., vehicle suspension, a bridge, human body, aircraft landing gear). In class, we considered a case with gravity (e.g., bungee jumper), but we now consider the simpler case without gravity (e.g., horizontal). Newton’s second law results in:

    \[m\frac{dx^2}{dt^2} + b \frac{dx}{dt} + k x = 0\]

    where \(m\) is the mass, \(b\) is the damping coefficient, and \(k\) is the spring constant. Let \(m = 20, k = 20\) and for the damping \(b\) we will try three values: 5, 40, 200. Assume an initial displacement of 1 and an initial velocity of 0. Using a standard ODE solver, plot the results from \(t = 0\) to 15, with all three cases on the same plot.

  2. A simple model of an epidemic is:

    \[\begin{align} \frac{dS}{dt} &= - i S I\\ \frac{dI}{dt} &= i S I - r I\\ \frac{dR}{dt} &= r I\\ \end{align}\]

    where \(S\) = susceptible individuals, \(I\) = infected individuals, \(R\) = recovered individuals, \(i\) = infection rate, \(r\) = recovery rate. A city has 10,000 people all of whom are susceptible.

    (a) If a single infectious individual enters the city at t = 0, compute the progression of the epidemic until the number of infected individuals reaches 10. Use the following parameters: \(i\) = 0.002/7 (the 7 is to convert from infection rate per week to per day) and \(r\) = 0.15. Plot S, I and R as a function of time, all on the same plot.

    (b) Suppose that, after recovery, there is a loss of immunity that causes recovered individuals once again to become susceptible. This reinfection mechanism can be modeled as \(\rho R\), where \(\rho\) is the return rate. To be specific this means you should add \(\rho R\) to the existing \(dS/dt\) term (increasing the number of people who susceptible) and you should subtract \(\rho R\) from the existing \(dR/dt\) term (decreasing by the same amount, the pool of recovered individuals). Repeat the computations/plot in (a) using \(\rho = 0.03\).

  3. A sample of 100 cars driving on the freeway during a morning commute was drawn, and the number of occupants in each car was tabulated as follows:

    Occupants 1 2 3 4 5
    Number of cars 70 15 10 3 2

    a) compute the sample mean

    b) compute the sample standard deviation

    c) compute the median

    d) compute the first and third quartiles (which means 25th percentile and 75th percentile respectively)

    e) what proportion of cars had more than the mean number of occupants?