diff --git a/Exercise 1/1.png b/Exercise 1/Images/1.png similarity index 100% rename from Exercise 1/1.png rename to Exercise 1/Images/1.png diff --git a/Exercise 1/Images/10.png b/Exercise 1/Images/10.png new file mode 100644 index 0000000..4a8a2e5 Binary files /dev/null and b/Exercise 1/Images/10.png differ diff --git a/Exercise 1/Images/11.png b/Exercise 1/Images/11.png new file mode 100644 index 0000000..858797e Binary files /dev/null and b/Exercise 1/Images/11.png differ diff --git a/Exercise 1/Images/12.png b/Exercise 1/Images/12.png new file mode 100644 index 0000000..79176ca Binary files /dev/null and b/Exercise 1/Images/12.png differ diff --git a/Exercise 1/Images/13.png b/Exercise 1/Images/13.png new file mode 100644 index 0000000..1ac9a78 Binary files /dev/null and b/Exercise 1/Images/13.png differ diff --git a/Exercise 1/Images/14.png b/Exercise 1/Images/14.png new file mode 100644 index 0000000..dfcae7b Binary files /dev/null and b/Exercise 1/Images/14.png differ diff --git a/Exercise 1/2.png b/Exercise 1/Images/2.png similarity index 100% rename from Exercise 1/2.png rename to Exercise 1/Images/2.png diff --git a/Exercise 1/3.png b/Exercise 1/Images/3.png similarity index 100% rename from Exercise 1/3.png rename to Exercise 1/Images/3.png diff --git a/Exercise 1/Images/4.png b/Exercise 1/Images/4.png new file mode 100644 index 0000000..6cf2a59 Binary files /dev/null and b/Exercise 1/Images/4.png differ diff --git a/Exercise 1/Images/5.png b/Exercise 1/Images/5.png new file mode 100644 index 0000000..f8b7d96 Binary files /dev/null and b/Exercise 1/Images/5.png differ diff --git a/Exercise 1/Images/6.png b/Exercise 1/Images/6.png new file mode 100644 index 0000000..a72feeb Binary files /dev/null and b/Exercise 1/Images/6.png differ diff --git a/Exercise 1/Images/7.png b/Exercise 1/Images/7.png new file mode 100644 index 0000000..cecee9c Binary files /dev/null and b/Exercise 1/Images/7.png differ diff --git a/Exercise 1/Images/8.png b/Exercise 1/Images/8.png new file mode 100644 index 0000000..fcce460 Binary files /dev/null and b/Exercise 1/Images/8.png differ diff --git a/Exercise 1/Images/9.png b/Exercise 1/Images/9.png new file mode 100644 index 0000000..d7ef17c Binary files /dev/null and b/Exercise 1/Images/9.png differ diff --git a/Exercise 1/main.pdf b/Exercise 1/main.pdf index f40c9b5..22837aa 100644 Binary files a/Exercise 1/main.pdf and b/Exercise 1/main.pdf differ diff --git a/Exercise 1/main.tex b/Exercise 1/main.tex index 26d5996..6c23765 100644 --- a/Exercise 1/main.tex +++ b/Exercise 1/main.tex @@ -102,31 +102,102 @@ where $r_p$ is the position of the probe relative to the earth, and $r_{pm}=r_p- \section{Explanation of Code} \subsection{{Orbit of the Moon}} -\begin{figure} [!h] - \centering - \includegraphics[width=1\linewidth]{1.png} -\end{figure} + +\includegraphics[width=1\linewidth]{Images/1.png} The function for part 1 takes 2 inputs, velocityFactor and orbits. These are scalar multipliers for the initial velocity and max time respectively, which can be altered as desired. The function for the derivatives is then defined, taking an input of time, the initial state, the masses of each object and the gravitaional constant. State is provided as a tuple with 4 objects, and each value in it is then assigned to xm, ym, vx and vy. The equations for the derivative of each of these values, relating to the equations outlined in equation \ref{eq:Moon} are then defined, and are returned in the same order they were initially given. -\begin{figure} [!h] - \centering - \includegraphics[width=1\linewidth]{2.png} -\end{figure} +\includegraphics[width=1\linewidth]{Images/2.png} The initial starting conditions of the system are then defined. $M_e$, $M_m$, $G$ and $r$ are all known and fixed quantities. The standard value for $v$, the initial velocity of the moon, is set by balancing centripetal force with gravitational force to produce a stable, circular orbit, however it can be changed by altering velocityFactor in order to produce an elliptical orbit. t\_max is set to the sidereal period of the moon multiplied by the number of orbits desired. The position and velocity are then split up into $x$ and $y$ values, and the simplest case is taken, with the moon starting on the $x$ axis and moving directly upwards, allowing us to set $y_m$ and $v_{x,m}$ to 0, and $x_m$ and $v_{y.m}$ to $r$ and $v$ respectively. -\begin{figure} [!h] - \centering - \includegraphics[width=1\linewidth]{3.png} -\end{figure} +\includegraphics[width=1\linewidth]{Images/3.png} The solve\_ivp() function is then called to solve the differential equations. The initial conditions are provided as a tuple, in the order defined in the differential equations function. The time range is also provided as a tuple, and the other arguments needed for the differential equations function are provided using args=. Matplotlib is then used to create a plot of the position of the moon at each time defined in t. x and y axes are then added for clarity. \subsection{Lunar Probe} -\begin{figure} [!h] - \includegraphics[width=1\linewidth]{4.png} +\begin{center} +\includegraphics[width=0.85\linewidth]{Images/4.png} +\end{center} +The initial configuration for section 2 is very similar to that of section 1. The function for the section also takes velocityFactor and orbits as inputs, which perform the same function as in section 1. The differential equations function has a similar form to the one in section 1, taking time, state and some constants as input. The differential equations that govern the movement of the moon and their associated state values are the same, but we now have the additional equations seen in equation \ref{eq:Probe}, and the variables required for them. Each differential equation is then returned in the same order they were provided, as in the first part. + +\includegraphics[width=1\linewidth]{Images/5.png} + +We then set the initial conditions for both the moon and probe. The values for the moon are all the same as in section 1. The initial conditions for the probe are found by selecting an appropriate distance for the probe from the moons center, then again balancing centripetal and gravitational forces to find its velocity around the moon. However, as the coordinate system is relative to the earth and not the moon, both the initial position and velocity of the probe relative to the moon must be added to the position and velocity of the moon relative to the earth, in order to get the state of the probe relative to the earth. The tolerances for this part were set lower, as the motion of the probe is more precise than that of the moon, so this was required to achieve a good degree of accuracy. + +\includegraphics[width=1\linewidth]{Images/6.png} + +The results are then calculated using solve\_ivp(). Again this is very similar to the procedure in part 1, only with more variables for the initial state. Matplotlib is again used to plot the position of both the moon and the probe in the same fashion as part 1. + +\section{Results and Discussion} +\subsection{Orbit of the Moon} +When given standard starting conditions, the simulation provided a stable and circular orbit, as expected, shown in figure \ref{fig:MoonCircular}. +\begin{figure} + \includegraphics[width=1\linewidth]{Images/7.png} + \caption{Circular orbit as a result of standard initial conditions} + \label{fig:MoonCircular} \end{figure} -The initial configuration for section 2 is very similar to that of section 1. The function for the section also takes velocityFactor and orbits as inputs, which perform the same function as in section 1. The differential equations function has a similar form to the one in section 1, taking time, state and some constants as input. The differential equations that govern the movement of the moon and their associated + +The simulation kept its shape for a large number of orbits, showing its stability. When the initial velocity was altered but the radius of the orbit was held, we observed a range of effects. For small alterations, approximately in the range of 0.1