27  Problem set 2

Note

For feedback, hand in by Friday Week 4.

The intention of this problem set is to practice concepts from Chapter 5 (asymptotic approximations of algebraic equations) to Chapter 7 (Euler’s method and numerical solutions of differential equations). These techniques form some of the most powerful techniques at your disposal in applied maths.

27.1 Getting started with Noteable

Use your Moodle course page to access the Noteable Python interface by clicking on the appropriate link in the course materials. Follow the instructions on the Moodle page to add the Git repository to your directory.

  1. Navigate to the welcome screen for MA30287 and follow the instructions in Welcome.ipynb and FirstTimeSetup.ipynb in order to create your own local directory at /MA30287_workspace/

  2. Navigate to the workspace folder. Click New -> Notebook. If asked, select the kernel Python 3 (ipykernel).

  3. In the first line of input, select, in toolbar Code -> Markdown. This allows you to annotate your notebook with Markdown-style text input.

    In the first line of input, type # Problem set 2. Then either type Shift + Enter or press the play button which will execute the line(s) of input. Your markdown text should render as a nicely formatted entry.

  4. Rename the file to something appropriate, like ps02_scripts. You can do this by right-clicking the filename in the file manager and selecting Rename.

    Proceed to the next question.

27.2 Testing the solutions of a cubic

\(\nextSection\)

In this question, you will develop the numerical solutions for the roots of the cubic equation: \[ \epsilon x^3 - x + 1 = 0, \qquad \epsilon > 0 \]

Type the following code into your Jupyter notebook. This code uses a command, which you will learn in a later week, called fsolve, in order to solve nonlinear equations. When writing the below code, you may want to separate the import commands into their own input field in the notebook.

import numpy as np
from scipy.optimize import fsolve

ep = 0.1        # epsilon value
xguess = 1.1    # Initial guess of root

f = lambda x: ep*x**3 - x + 1
xsol = fsolve(f, xguess)
print("Solved root at x = ", xsol)
Solved root at x =  [1.15346731]

27.3 Analysis of singular cubic equation

\(\nextSection\)

Consider the cubic equation \[ \epsilon x^3 - x + 1 = 0, \] with \(\epsilon \ll 1\) and \(\epsilon > 0\).

  1. Develop the first three terms of an asymptotic expansion about the root by setting \[ x = x_0 + \epsilon x_1 + \epsilon^2 x_2 + \ldots \]

  2. Fill out the following table.

    \(\epsilon\) \(x_{\text{exact}}\) \(x_{\text{exact}} - x_0\)
    0.1
    0.08
    0.06
    0.04
    0.02

    Use your code in Section 27.2 to input numerical approximations to the above entries.

    Create a graph by hand of the data (it does not have to be extremely accurate), as plotted in the \((\epsilon, x_{\text{exact}} - x_0)\)-plane. Fit a line to this graph and estimate the gradient. Is this consistent with what you derived above?

  3. By rescaling \(x\) appropriately in terms of \(\epsilon\), derive the first three terms of the asymptotic approximations of the remaining roots.

27.4 A damped projectile problem

\(\nextSection\)

In Chapter 6 you performed the asymptotic analysis for a projectile. The small parameter was \(\epsilon\) and represented \(v_0^2/(gR_E)\) (a parameter that includes the initial velocity, \(v_0\), gravity \(g\), and the radius of the Earth, \(R_E\).

If air resistance is included, then the non-dimensional toy model is instead \[\begin{equation} \begin{gathered} \frac{\mathrm{d}^2 y}{\mathrm{d}t^2} = - \frac{1}{(1 + \epsilon y)^2} - \frac{\alpha}{(1 + \epsilon y)} \frac{\mathrm{d}y}{\mathrm{d}t}, \\ y(0) = 0, \\ y'(0) = 1. \end{gathered} \end{equation}\] where \(\alpha \geq 0\) is the parameter that controls air resistance.

  1. Begin by assuming that \(\alpha\) is a fixed number and consider the limit where \(\epsilon \ll 1\). Find a one-term asymptotic expansion of the solution for small \(\epsilon\).

  2. (Challenging) Is the effect of the air resistance to increase or decrease the flight time? Justify based on your analytical solution.

27.5 ODE solvers and Euler’s method

\(\nextSection\)

Return to the setup of the above question.

  1. Modify the script shown in Section 6.2 in order to solve the initial-value problem from the previous question at a prescribed value of \(\epsilon\) and \(\alpha\).

  2. Using a pocket calculator (or your phone calculator) apply Euler’s method with \(\Delta t = 0.2\), \(\epsilon = 0.2\), and \(\alpha = 1\) to determine the position of the projectile at \(t = 0.6\).

  3. Compare your hand calculation with the result from the Python output, as well as with your asymptotic approximations.