A Python library providing basic formulas for rocket engine performance and analysis.
Project description
🚀 rocketformulas
A Python library for basic rocket engine performance formulas.
Example
import rocketformulas as rf
# Example inputs
m_dot = 5
v_e = 2500
p_e = 101325
p_a = 90000
A_e = 0.2
p_c = 3e6
A_t = 0.05
# Compute values
T = rf.thrust(m_dot, v_e, p_e, p_a, A_e)
Isp = rf.specific_impulse(T, m_dot)
mfr = rf.mass_flow_rate(T, v_e, p_e, p_a, A_e)
ve = rf.exhaust_velocity(Isp)
c_star = rf.characteristic_velocity(p_c, A_t, m_dot)
# Print everything
print(f"Thrust: {T:.2f} N")
print(f"Specific Impulse: {Isp:.2f} s")
print(f"Mass Flow Rate: {mfr:.2f} kg/s")
print(f"Exhaust Velocity: {ve:.2f} m/s")
print(f"Characteristic Velocity: {c_star:.2f} m/s")
## Example
```python
import numpy as np
import matplotlib.pyplot as plt
import rocketformulas as rf
# Define parameters
m_dot = 5 # kg/s
p_e = 101325 # Pa
p_a = 90000 # Pa
A_e = 0.2 # m^2
# Range of exhaust velocities
v_e_values = np.linspace(1500, 3500, 10)
# Calculate thrust for each exhaust velocity
thrust_values = [rf.thrust(m_dot, v, p_e, p_a, A_e) for v in v_e_values]
# --- Plot using Matplotlib ---
plt.figure(figsize=(8, 5))
plt.plot(v_e_values, thrust_values, marker='o', linewidth=2)
# Labels and title
plt.title("Rocket Engine Thrust vs Exhaust Velocity", fontsize=14)
plt.xlabel("Exhaust Velocity (m/s)", fontsize=12)
plt.ylabel("Thrust (N)", fontsize=12)
plt.grid(True)
# Show the plot
plt.show()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rocketformulas-1.0.0.tar.gz
(4.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rocketformulas-1.0.0.tar.gz.
File metadata
- Download URL: rocketformulas-1.0.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec4ca8435cb2a2599749f4fafdc039c2ea5870f452f1a0e3f60f15b172ed3866
|
|
| MD5 |
7e38964c12e92cdf5547a465972e178b
|
|
| BLAKE2b-256 |
ba7041bf7d6d53ea95e6d72d9d8a76a72d11bd7755106efedb89678088945cd0
|
File details
Details for the file rocketformulas-1.0.0-py3-none-any.whl.
File metadata
- Download URL: rocketformulas-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a43ac78722f3d2b5fe2f9d7ca280fab08e5eaff52da48e8d59eb6113cd61a8f
|
|
| MD5 |
14e30bb4f037907ed3ce2ce55d8fb898
|
|
| BLAKE2b-256 |
2bf91d7aa99ca519c1f090d3cbfcecbd84c8e6c3b3e2cb771736d8d5ef10d683
|