This project calculates a bullet's dynamics regarding to aerodynamic, gravitational and inertial a parameters with numerical approach. The program does not include any high level maths libraries(for linear and numeric calculations) and makes all calculations itself. The aim of the project is to calculate bullet's path in the air and physical properties such as force and velocity relations according to time parameter.
In engineering problems, sometimes anayltical solutions are not possible or they are hard to reach. Numerical methods are mathematical solutions for physical problems by using approximaitons and error check. This is my first complex python project in Numerical methods. In this project, the maximum tolerable error percantage is |ε| < 0.1%
This project contains several approachs for numerical solutions. In this part, mathematical operations are explained. Program explanations for methods are given in the next part.
Gauss Elimination is a solution method for linear problem systems. It forms a triangular equation system by eliminating variables and then using back-substitution to find unkowns.
For more information: https://www.efunda.com/math/num_linearalgebra/num_linearalgebra.cfm?search_string=gauss%20elimination#Gaussian
Least - squares parabola method is used to perform curve fitting. This method uses gauss elimination to fit the given data into a 2nd degree polynomial (parabola).
For more information: https://www.efunda.com/math/leastsquares/lstsqr2dcurve.cfm
The forward Euler method is an iterative method which starts at an initial point and walks the solution forward using the iteration. It is used to calculate bullet's orbit.
For more information: https://www.efunda.com/math/num_ode/num_ode.cfm#Euler
There are 4 files in the project. main.py is to run the code and the others are explained below.
curve_fit.py file manipulates the data for oncoming calculations and it makes the data useful by using gauss elimination and curve fitting.
calculate() function takes the data as parameter and return the necessary values for least-square parabola methods.
gauss_elimination() method takes 2 matrixes (a, b) and gives the solution set (x) as output. ( [A] x = B format)
curve_fitting() takes the data and calculates the coefficients for new parabola by using the functions above.
euler_forward.py is the file that calculates the mechanics all mechanical properties of the object.
calculate_density() calculates the air density according to room conditions (humidity, pressure etc.)
plot_graph.py is used for final values and calculations, results and plotting of the graphs by using the functions in euler_forward.py