Finish report

This commit is contained in:
Ceres 2025-10-21 10:41:11 +01:00
parent b5b7b31a87
commit 972cddcd0e
Signed by: ceres-sees-all
GPG key ID: 9814758436430045
16 changed files with 86 additions and 15 deletions

View file

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Before After
Before After

BIN
Exercise 1/Images/10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
Exercise 1/Images/11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
Exercise 1/Images/12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
Exercise 1/Images/13.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
Exercise 1/Images/14.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View file

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 129 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 129 KiB

Before After
Before After

BIN
Exercise 1/Images/4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

BIN
Exercise 1/Images/5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
Exercise 1/Images/6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

BIN
Exercise 1/Images/7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
Exercise 1/Images/8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
Exercise 1/Images/9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

View file

@ -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<velocityFactor<1.41, stable elliptical orbits were produced, as shown in figures \ref{fig:MoonSmallElliptical} and \ref{fig:MoonBigElliptical}.
\begin{figure}
\includegraphics[width=1\linewidth]{Images/8.png}
\caption{Elliptical orbit with a velocity of 0.4*v}
\label{fig:MoonSmallElliptical}
\end{figure}
\begin{figure}
\includegraphics[width=1\linewidth]{Images/9.png}
\caption{Elliptical orbit with a velocity of 1.3*v}
\label{fig:MoonBigElliptical}
\end{figure}
For velocities less than 0.1*v, the simulation began to fail, producing what was effectively noise. At velocities greater than 1.41*v, the moon appears to escape the orbit of the earth, as shown in figure \ref{fig:MoonEscape}. These trajectories continued with increasing t\_max, to the point where simulation took a very long time, suggesting that they are not simply very large orbits.
\begin{figure}
\includegraphics[width=1\linewidth]{Images/10.png}
\caption{Moon escaping the earths orbit}
\label{fig:MoonEscape}
\end{figure}
This can be compared with what we would expect using the escape velocity equation, which is given by
\begin{equation}
v_e=\sqrt{\frac{2GM}{r}}
\label{eq:Escape}
\end{equation}
As we find the velocity for a circular orbit by balancing centripetal and gravitational force, we use the equation
\begin{equation}
v=\sqrt{\frac{GM}{R}}
\label{eq:Velocity}
\end{equation}
We can see that the difference between equation \ref{eq:Escape} and equation \ref{eq:Velocity} is simply a factor of $\sqrt 2$, or 1.414, so our model holds well with what we would expect.
\subsection{Lunar Probe}
For standard starting values for section 2, we again see the moon in a stable circular orbit around the earth, and the probe forms a stable orbit around the moon as well, as shown in figure \ref{fig:ProbeCircular}
\begin{figure}
\includegraphics[width=1\linewidth]{Images/11.png}
\caption{Circular orbit of moon and probe}
\label{fig:ProbeCircular}
\end{figure}
When altering the initial velocity of the moon, for small changes we again see stable elliptical orbits. With increases above 1.41*v, causing the moon to escape the earth, the probe continues to orbit the moon in a stable manner, as shown in figure \ref{fig:ProbeBigEscape}
\begin{figure}
\includegraphics[width=1\linewidth]{Images/12.png}
\caption{Moon and probe escaping the earth}
\label{fig:ProbeBigEscape}
\end{figure}
When we decrease the starting velocity of the moon, it continues in a stable orbit, however when reaching the periapsis of the moons orbit, the probe is accelerated enough to escape the orbit of both the moon and the earth, as shown in figure \ref{fig:ProbeSmallEscape}
\begin{figure}
\includegraphics[width=1\linewidth]{Images/13.png}
\caption{Probe escaping the moon}
\label{fig:ProbeSmallEscape}
\end{figure}
The point at which the probe escapes the moon can be increased by changing the direction of the probes orbit around the moon, simply by setting vpy0 = vm-vpm, rather than vm+vpm. Now, when the probe escapes the orbit of the moon, it is still gravitationally bound to the earth and enters an erratic orbit around it, shown in figure \ref{fig:ProbeEarth}
\begin{figure}
\includegraphics[width=1\linewidth]{Images/14.png}
\caption{Probe escaping the moon and entering an orbit around the earth}
\label{fig:ProbeEarth}
\end{figure}
\section{Conclusion}
Overall, the model produced mostly accurate results when given starting values somewhat close to realistic values, however began to lose clarity at extreme values, especially with low starting velocities. This could likely be improved by decreasing the tolerance of the model, however this would lead to larger calculation times. The model agreed with the value for the escape velocity of the moon, showing a good accuracy when provided with somewhat realistic data. Other improvements to the model could include adding a third dimension, as well as modelling the effects of the rotation of each of the objects, as these tidal forces do affect the path of the moons orbit in real life.
\end{document}