\documentstyle[11pt]{article}
\title{Homework 1} \author{Jeremy Morris \& Haimanot Kassa} \date{\today}

\begin{document}
\maketitle

\bf Exercise 1\rm: The trajectory of the point O (R,0,0), in cartesian coordinates is 
\[\left(\begin{array}{c}R \cos{\theta}\\R \sin{\theta}\\0\end{array} \right) \]
Where \(\theta = (2\pi t)/s\).

\bf Exercise 2\rm:
\input{code}

\bf Exercise 3\rm: Suppose we have a function that takes longitude/lattitude information and converts it to radians, degree2radian().  Then to convert a position as given in (6) from the Term Project Handout, we do the following:
\begin{quote}
\(\alpha\) = degree2radian(lattitude)\\
\(\beta\) = degree2radian(longitude)\\
\(H = h + R\)\\
\\
\(x = H\cos{\alpha}\cos{\beta}\;\\
y = H\cos{\alpha}\sin{\beta}\;\\
z = H\sin{\alpha}\;\)
\end{quote}

\bf Exercise 4\rm: To convert a position with general time, we multiply the vector \(\vec{v} = \{x,y,z\}\) (from Ex. 3) with the matrix:
\[A = \left( \begin{array}{rrr} 
	\cos{\theta} & -\sin{\theta} & 0 \\
	\sin{\theta} &  \cos{\theta} & 0 \\
	0            &  0            & 1 \end{array} \right) \]\\
Where \(\theta = (2\pi t)/s\).  The matrix/vector product \(A\vec{v}\) is our final position in cartesian coordinates.

\bf Exercise 5\rm: The following process converts cartesian coordinates into longitude/lattitude coordinates:
\begin{quote}
\(\alpha = \arcsin{\frac{z}{H}}\)\\
\(\beta = \arccos{\frac{x}{H\cos{\beta}}}\)\\
\(H = \sqrt{x^{2} + y^{2} + z^{2}}\)\\
lattitude = radian2degree(\(\alpha\))\\
longitude = radian2degree(\(\beta\))\\
\end{quote}

\bf Exercise 6\rm: To define the previous formula for general time, we need to dial the coordinates back for the given value of \(t\).  We do this by using the following matrix:
\[A = \left( \begin{array}{ccc} 
	\cos{\theta}  & \sin{\theta} & 0 \\
	-\sin{\theta} & \cos{\theta} & 0 \\
	0             & 0            & 1 \end{array} \right) \]\\
Where \(\theta = (2\pi t)/s\).  Then with the matrix \(A\), and our position vector \(\vec{v} = (x,y,z)\), we do the following:
\begin{quote}
\(\vec{v} = A\vec{v}\)\\
\(\alpha = \arcsin{\frac{z}{H}}\)\\
\(\beta = \arccos{\frac{x}{H\cos{\beta}}}\)\\
\(H = \sqrt{x^{2} + y^{2} + z^{2}}\)\\
lattitude = radian2degree(\(\alpha\))\\
longitude = radian2degree(\(\beta\))\\
\end{quote}

\bf Exercise 7\rm: The parametric equation for the orbit of B12 as a function of time is:
 \[\left( \begin{array}{c}
	-1.79523\times10^{6} \cos{((2\pi t)/s)} + 4.47717E\times10^{6} \sin{((2\pi t)/s)} \\
        -1.79523\times10^{6} \sin{((2\pi t)/s)} - 4.47717\times10^{6} \cos{((2\pi t)/s)} \\
         4.15859\times10^{6} \end{array} \right) \]

\bf Exercise 8\rm: If we have a point \(\vec{x}\), on earth, and a point \(\vec{s}\), representing a satellite, we can tell if the satellite is visible from earth if the angle between the vector \(\vec{c} = \vec{x} - \vec{s}\) and the plane perpendicular to \(\vec{x}\) is in the interval \([0,\pi]\).  This means we need to find the angle \(\alpha\) that lies between the vectors \(\vec{c}\) and \(\vec{x}\).  Then we need to solve the equation \[\frac{\sin{\alpha}}{\|\vec{x}\|} = \frac{\sin{\psi}}{\|\vec{c}\|}\] for \(\alpha\), where \[\psi = \arccos{\frac{(x,y)}{\|\vec{x}\| \|\vec{s}\|}} \]

\bf Exercise 9\rm: If the equation for the orbit of a satellite is \(\vec{x_{s}}(t)\) then we can take the equation \(t_{s}^{(k+1)} = t_{v} - \|\vec{x_{v}} - \vec{x_{s}}(t_{s}^{(k)})\| / c\), where \(t_{s}^{0} = t_{v}\).  Then we iterate until \(t_{s}\) converges.

\bf Exercise 10\rm: If we have four satellites, \(s,t,u,v\), then we have four equations whose solution is the position of the vehicle in cartesian coordinates:
\[ \begin{array}{l}
	\|\vec{s} - \vec{x}\| - c(t - t_{s}) = 0 \\
	\|\vec{t} - \vec{x}\| - c(t - t_{t}) = 0 \\
	\|\vec{u} - \vec{x}\| - c(t - t_{u}) = 0 \\
	\|\vec{v} - \vec{x}\| - c(t - t_{v}) = 0 \\
\end{array} \]

\bf Exercise 11\rm: For satellites \(s_{i}\) with associated times \(t_{s_{i}}\), where \(i = 1,2,\ldots,m\) and \(m\) is the number of satellites, we get the following least squares formula:
	\[\sum_{i = 1}^{m} (\|\vec{s_{i}} - \vec{x}\| - c(t - t_{s_{i}}))^{2} = min\]

\bf Exercise 12\rm: To find the ground track of the satellite, we take the equation that describes the orbit of a satellite, and project it onto earth by removing the value \(h\) that represents the height of the satellite.  Then we get:
\[ \left( \begin{array}{c}
		R \cos{2\pi t / p} \\
		R v_{2} \sin{2\pi t / p} \\
		R v_{3} \sin{2\pi t / p} \end{array} \right) \]
We then, convert \(\vec{x_{E}}\) into lattitude and longitude coordinates.  It is quite significant that the ground track of the satellite repeats at the same time every day.

\bf Exercise 13\rm: To solve the system \(F(\vec{x}) = 0\) given \(\vec{x}^{(0)}\), we do the following:\\
For \(k = 0,1,\ldots\)until satisfied, solve
\[\begin{array}{l}
J(\vec{x}^{(k)}) \vec{s}^{(k)} = -F(\vec{x}^{(k)}) \\
\vec{x}^{(k+1)} = \vec{x}^{(k)} + \vec{s}^{(k)}
\end{array}\]
Where:
\[J(\vec{x})_{ij} = F'(\vec{x}) = \left[\frac{\partial f_{i}}{\partial x_{j}}\right]\]

\bf Exercise 14\rm: If the equations for each given satellite are \(f_{i}(\vec{x},t) = \|\vec{s{i}} - \vec{x}\| - c(t - t_{s_{i}})\), for \(i = 1,2,\ldots m\) then, we need to minimize the least squares equation: \[F(\vec{x},t) = \sum_{i = 1}^{m} (\|\vec{s_{i}} - \vec{x}\| - c(t - t_{s_{i}}))^{2}\] So we use Newton's method to solve \(\bigtriangledown F = 0\).  Then the Jacobian matrix of \(J(\bigtriangledown F) = A^{T}A\) where \[A_{ij} = \left[\frac{\partial f_{i}}{\partial x_{j}}\right]\] Then Newton's method proceeds just as in exercise 13.

\bf Exercise 15\rm: As mentioned in the Term Project handout, there will be many solutions to a system of equations with four equations and four unknowns.  In three dimensions, the four spheres surrounding the satellites, will intersect in an infinite number of points.  In principle, this means that our system has an infinite number of solutions, and we would not be able to solve for our position.  However, we are always given an initial guess, and can always throw away unreasonable scenarios, such as proximity to earth.  It is possible that given data from four satellites, there will be no solution.  This would mean that the satellites are so far apart that the spheres surrounding them do not intersect anywhere.  Judging from the information we have, this is highly unlikely.  In any case, for this project, we should always be able to find the solution we are looking for because we have a good idea of where the solution will be located.

\bf Exercise 16\rm: The problem is that the three equations we have from the satellites will not be linearly independent.

\bf Exercise 17\rm: Meg appears to be wrong again.  We can look at an example.  The coordinates for the longitude of B12 are \(111^{\circ}\) 50' 58.0'' West.  If we used a negative sign for the degrees, our function that converts this to radians would go \(111\) degrees West, then come 50' and 58'' East.  This obviously would produce the wrong number of radians and throw the whole program off.

\end{document}
