PHYS 220 — Lab #7

This lab should only take you a single lab period. The assignment is due at the beginning of lecture on Monday, 6 Apr. In this lab you'll construct a bisection method (root finder) and a golden section search (1D optimization), and apply them to various problems. Your solutions should include 2 function code listings and a table of numerical results (including respective tolerances) for each problems.


  1. Construct a MATLAB bisection method function (to find the a root of a function) that has the following inputs/outputs:
  2. In celestial mechanics, Kepler's Equation relates the mean anomaly M to the eccentric anomaly E of an elliptical orbit of eccentricity e as: M = E - e sin(E).
    1. For M = 1 radian and e = 0.206 (Mercury), 0.0167 (Earth). Calculate the eccentric anomalies E for each planet.
    2. Are there values for the eccentric anomaly for which E = M? If so, what are they.
  3. In neutron transport theory the critical length of a fuel rod in a reactor is determined by the roots of this equation: cot(x) = (x² - 1) / (2x). Determine the smallest positive root of this equation.
  4. Construct a MATLAB golden section search function (to find a local minimum of a function) that has the following inputs/outputs (you'll need this for HW #6):
  5. Verify that your function works by finding the relative minimum of y = x³ - 2x² - 4x + 1. (If you can, compare the numerical result with the exact result.)

  6. EXTRA CREDIT The Ideal Gas Law, PV = nRT, works well for low densities since it ignores the size of molecules and assumes perfectly elastic collisions. A second-order approximation is the van der Waals (non-ideal gas) Equation of State, which corrects for finite molecular size and works fairly well even for densities that are not low. It is given by (P + a(n/V)²)(V - nb) = nRT, where a is related to the attractive force between molecules and b is related to the size of each molecule. For P = 3 MPa, T = 300 K and n = 1 mol, find the volume occupied by the two gasses shown below in both the ideal gas and van der Waals approximations.

    Substance
    a
    (J. m3/mole2)
    b
    (m3/mole)
    Nitrogen (N2) 0.1361 3.85x10-5
    Freon (CCl2F2) 1.078 9.98x10-5