숙제 02

For the problems below, you need to write programs using C language. Turn in your own source programs written independently (by email) together with reports.

1.

The Planck function (measured per unit wavelength) from a blackbody with temperature $T$ is given by

(1)
\begin{align} B_\lambda (T) = {{2hc^2 / \lambda^5 } \over {e^{hc/ \lambda k T} -1 }}, \end{align}

where $h = 6.626 \times 10^{-34}\ \mathrm{J\ s}, \quad k = 1.381 \times 10^{-23}\ \mathrm{J\ K^{-1}},$ and $c = 2.998 \times 10^8\ m\ s^{-1}$. All of your answers should be accurate to at least four digits.

  • (a) Derive Wien's displacement law by solving $d B_\lambda / d \lambda = 0$.
  • (b) For a blackbody with $T = 10^4\ \mathrm{K}$, find two wavelengths correspodning to $B_\lambda = 10^6\ \mathrm{J\ s^{-1}\ m^{-3}}$.

2.

A planet is orbiting around the Sun in a Kepler orbit with semi-major axis $a$, semi-minor axis $b$, and eccentricity $e = \sqrt{1 - b^2 / a^2}$. The location of the planet in the $(x, y)$ plane is given by

(2)
\begin{align} x = a \cos E, \end{align}
(3)
\begin{align} y = b \sin E, \end{align}

with the eccentric anomaly $E$ defined as

(4)
\begin{align} E \equiv 2 \pi t / P + e \sin E, \end{align}

where $t$ and $P$ denote the time elapsed from the perihelion and the orbital period of the planet, respectively.

  • (a) The Earth has $P = 365.25635$ days, $a = 1.496 \times 10^6\ \mathrm{km}$, and $e = 0.0167$. Compute $E, x, y$ for $t = 182$ days and $t = 273$ days, using the (i) bisection, (ii) Newton, and (iii) xed-iteration methods. The fractional error in $E$ at the end of your computation (from one iteration to the next) should be less than $10^{-10}$. How many iterations does your method need, i.e, how quickly does it converge?
  • (b) Repeat the cauculations by assuming that the eccentricity of the Earth is changed

to $e = 0.99999$, while everything else remains unchanged.

3.

The error function is defined as

(5)
\begin{align} \operatorname{erf}(x) = {{2} \over {\sqrt{\pi}}} \int_0^x e^{-z^2} dz. \end{align}

Evaluate $\operatorname{erf}(2)$ to an accuracy of $\epsilon = 10^{-6}$ using both the composite trapezoidal rule and the composite Simpson's rule. Compare the number of function evaluations required in each case.