Welcome to the Numerical Analysis repository, where we delve into the computational exploration of fundamental equations in astrophysics. This collection of Python code represents a journey into the intricate processes underlying the formation of stars.
The codes provided here are a product of past coursework in Computational Astrophysics during my master's program. While the algorithms and simulations may have originated from earlier periods, they remain relevant and serve as a valuable resource for understanding the complexities involved in the birth of celestial bodies.
This repository stands as a testament to the interdisciplinary nature of computational astrophysics, where the realms of astrophysics, physics, applied mathematics, and computer science converge. The codes presented here have been refined, it was part of my master course's coursework Computational Astrophysics at University of Tubingen
Feel free to explore, experiment, and contribute to the ongoing exploration of fundamental astrophysical phenomena. Your engagement is key to advancing our understanding of the mesmerizing processes that govern the formation of stars.
Happy coding and stargazing!
This Python script explores solutions to Kepler's equation and demonstrates celestial mechanics calculations. It includes implementations of fixed-point iteration and Newton-Raphson methods to solve Kepler's equation, as well as exercises related to celestial bodies' orbital parameters.
The script provides two methods for solving Kepler's equation:
- Fixed-Point Iteration
- Newton-Raphson Method
These methods are applied to calculate the eccentric anomaly, which is crucial in celestial mechanics.
The script explores the orbital parameters of Mercury and Halley's Comet. It calculates the eccentric anomaly, mean anomaly, and the number of iterations required for convergence using both fixed-point iteration and Newton-Raphson methods.
The second exercise involves calculating the mutual distance between Earth and Mars over time. It uses Kepler's equation solutions and celestial mechanics principles.
This repository contains also a numerical solver for the Lane-Emden equation, along with stability analysis tools. The Lane-Emden equation is a differential equation that describes the structure of self-gravitating, spherically symmetric polytropic fluids, such as stars.
The Lane-Emden equation is given by:
where
The numerical solver implemented in this repository utilizes [insert numerical method here, e.g., Runge-Kutta method] to approximate the solution of the Lane-Emden equation. The solver is designed to handle various polytropic indices and initial conditions.
Dahlquist's test assesses the stability of numerical methods for solving ordinary differential equations (ODEs). Developed by Björck and Dahlquist, it analyzes methods using a simple linear test equation:
The stability is determined by examining the behavior of the stability function
Useful for one-step methods like Euler and Runge-Kutta, Dahlquist's test helps choose appropriate methods for solving specific ODEs.
- Ensure you have Python installed on your machine.
- Clone this repository:
git clone https://github.com/QED137/ComputationalAstrophysics
- Navigate to the repository:
cd ComputationalAstrophysics
- Run the script:
python Computational Astrophyiscs -Copy1.ipynb
Feel free to modify the parameters, explore different celestial bodies, and adapt the code for your own experiments.
- NumPy
- Matplotlib
- SciPy (for Fresnel integral)
This project is licensed under the MIT License - see the LICENSE.md file for details.