https://github.com/notashelf/projectile-simulation
Simulate the trajectory of a projectile while accounting for air resistence.
https://github.com/notashelf/projectile-simulation
Last synced: about 1 year ago
JSON representation
Simulate the trajectory of a projectile while accounting for air resistence.
- Host: GitHub
- URL: https://github.com/notashelf/projectile-simulation
- Owner: NotAShelf
- License: eupl-1.2
- Created: 2023-10-07T19:56:23.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-11T09:03:54.000Z (over 2 years ago)
- Last Synced: 2025-02-17T13:13:22.681Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Projectile Simulation
This project simulates the motion of a projectile with air resistance.
## Installation
1. Clone this repository.
2. Install the required packages using pip:
```shell
pip install -r requirements.txt
```
## Usage
Run the `main.py` script:
```shell
python main.py
```
Or alternatively, with your own parameters:
```shell
python main.py --g 9.8 --C_d 0.02 --v_init 150 --theta 45 --h_init 20 --dt 0.01 --t_end 10
```
### Arguments
- `--g`: The acceleration due to gravity in m/s^2. Default is 9.81.
- `--C_d`: The drag coefficient. Default is 0.01.
- `--v_init`: The initial velocity in m/s. Default is 100.
- `--theta`: The launch angle in degrees. Default is 180.
- `--h_init`: The launch height in meters. Default is 10.
- `--dt`: The time step in seconds. Default is 0.01.
- `--t_end`: The total time of the simulation in seconds. Default is 10.
## Testing
Tests can be invoked by simply running `pytest` in the directory. If you are contributing something new to the program, do make sure
that it is appropriately tested in `test_main.py`.