Skip to main content

Comprehensive Natural Sciences Library - Physics & Chemistry

Project description

NaturoPhysX - Comprehensive Natural Sciences Library

Python 3.8+ License: MIT Code style: black

NaturoPhysX ist eine umfassende, professionelle Python-Bibliothek für Physik und Chemie. Sie deckt alle wichtigen Bereiche der Naturwissenschaften ab und bietet über 200+ Funktionen für präzise wissenschaftliche Berechnungen.

🎯 Features

🔬 Physik (Physics)

  • Klassische Mechanik: Kinematik, Dynamik, Rotation, Gravitation (50+ Funktionen)
  • Optik: Geometrische und Wellenoptik, Photonen (30+ Funktionen)
  • Elektromagnetismus: Maxwell-Gleichungen, Schaltkreise, Felder (25+ Funktionen)
  • Thermodynamik: Wärmeleitung, Zustandsgleichungen, Entropy (30+ Funktionen)
  • Strömungsmechanik: Bernoulli, Stokes-Widerstand, Reynoldszahl (25+ Funktionen)
  • Akustik: Schallwellen, Doppler-Effekt, Resonanz (20+ Funktionen)
  • Quantenmechanik: Schrödinger-Gleichung, Wasserstoffatom, Unschärfe (30+ Funktionen)
  • Relativitätstheorie: Lorentz-Transformationen, Schwarzschild-Metrik (35+ Funktionen)
  • Astronomie: Orbitalmecanik, Kepler-Gesetze, N-Körper-Problem (25+ Funktionen)

⚛️ Chemie (Chemistry)

  • Periodensystem: Atomare Eigenschaften, Elektronegativität, Molare Masse (14+ Elemente)
  • Molekulare Eigenschaften: Bindungsanalyse, Bindungsenergien
  • Stöchiometrie: Molare Berechnungen, Verdünnungen, Prozentkomposition
  • Säure-Base-Gleichgewicht: pH/pOH, Lambert-Yasselbalch, Puffersysteme
  • Organische Chemie: Funktionelle Gruppen, Ungesättigungsgrad
  • Reaktionskinetik: Arrhenius-Gleichung, Halbwertzeiten, Geschwindigkeitsgesetze
  • Thermochemie: Enthalpie, Gibbs-Energie, Spontaneität (spontaneity assessment)
  • Redoxchemie: Oxidationszustände, Zellpotential (Nernst-Gleichung)
  • Molekulare Simulationen: Lennard-Jones-Potential, MD-Basics

⚡ Installation

PyPI (Empfohlen)

pip install naturophysx

Von Quelle

git clone https://github.com/yourgithub/naturophysx.git
cd naturophysx
pip install -e .

Mit Entwicklungs-Tools

pip install naturophysx[dev]

Für Jupyter/Plotting

pip install naturophysx[jupyter]

🚀 Quick Start

Physik-Beispiel: Klassische Mechanik

from naturophysx import mechanics, constants

# Berechne Geschwindigkeit nach 5 Sekunden
# v = v0 + at, wobei v0=10 m/s, a=2 m/s², t=5 s
velocity = mechanics.kinematics.final_velocity(v0=10, a=2, t=5)
print(f"Endgeschwindigkeit: {velocity} m/s")  # Output: 20 m/s

# Berechne Wurfweite für Projektilbewegung
range_m = mechanics.kinematics.projectile_range(v0=50, theta_deg=45)
print(f"Wurfweite: {range_m:.2f} m")

# Gravitationskraft zwischen zwei Massen
F_gravity = mechanics.gravitation.gravitational_force(
    m1=1e24, m2=1e23, r=1e8
)
print(f"Gravitationskraft: {F_gravity:.2e} N")

Chemie-Beispiel: Stöchiometrie & Säure-Base

from naturophysx.chemistry import periodic_table, stoich, acid_base

# Berechne molare Masse von Wasser (H2O)
h_mass = periodic_table.get_molar_mass("H")
o_mass = periodic_table.get_molar_mass("O")
h2o_mass = 2*h_mass + o_mass
print(f"Molare Masse H2O: {h2o_mass:.2f} g/mol")  # 18.02 g/mol

# Berechne Molarity
moles = 0.5
volume_L = 2.0
molarity = stoich.molarity_calculation(moles, volume_L)
print(f"Molarity: {molarity} mol/L")  # 0.25 mol/L

# Berechne pH einer schwachen Säure
Ka = 1.8e-5  # Essigsäure
pH = acid_base.pH_weak_acid(Ka, acid_concentration=0.1)
print(f"pH: {pH:.2f}")  # ≈ 2.87

Chemie-Beispiel: Reaktionskinetik

from naturophysx.chemistry import kinetics

# Berechne Arrhenius Geschwindigkeitskonstante
# k = A * exp(-Ea / RT)
A = 1e13  # Präexponentieller Faktor [1/s]
Ea = 50000  # Aktivierungsenergie [J/mol]
T = 300  # Temperatur [K]
k = kinetics.rate_constant_arrhenius(A, Ea, T)
print(f"Geschwindigkeitskonstante: {k:.2e} s⁻¹")

# Halbwertzeit für Reaktion 1. Ordnung
half_life = kinetics.first_order_half_life(k)
print(f"Halbwertzeit: {half_life:.2e} s")

Physik-Beispiel: Quantenmechanik

from naturophysx.quantum import quantum_mechanics
from naturophysx import constants

# Wasserstoff Energieniveaus
n = 2
E2 = quantum_mechanics.hydrogen_energy_level(n)
print(f"E2 = {E2:.2e} J = {E2 / constants.E * 1e-19:.2f} eV")

# De-Broglie Wellenlänge
mass = constants.M_E
velocity = 1e6  # m/s
wavelength = quantum_mechanics.de_broglie_wavelength(mass, velocity)
print(f"De-Broglie Wellenlänge: {wavelength:.2e} m")

📚 Module Übersicht

Physik-Module

Modul Funktionen Highlights
mechanics 50+ Kinematics, Dynamics, Energy, Momentum, Rotation, Gravitation
optics 30+ Ray optics, Wave optics, Diffraction, Interference
electromagnetism 25+ Maxwell, Circuits, Electromagnetic Fields
thermodynamics 30+ Ideal Gas Law, Heat Transfer, Entropy, Phase Transitions
fluids 25+ Bernoulli, Stokes Drag, Reynolds Number, Turbulence
acoustics 20+ Sound Waves, Doppler Effect, Resonance
quantum 30+ Schrödinger, Hydrogen Atom, Uncertainty, Photons
relativity 35+ Lorentz, Time Dilation, Schwarzschild, Cosmology
astronomy 25+ Kepler's Laws, Orbital Mechanics, N-Body

Chemie-Module

Klasse/Modul Funktionen Beispiele
PeriodicTable 4 get_molar_mass(), get_atomic_number(), get_electronegativity()
Molecule 3 Molarmassenberechnung, Elektronenzählung
BondAnalysis 3 Elektronegativitätsdifferenz, Bindungstypen, Bindungsenergien
Stoichiometry 7 Mol↔Gramm, Molarity, Dilution, Prozentkomposition
AcidBaseEquilibrium 6 pH/pOH, Schwache Säuren, Puffer (Henderson-Hasselbalch)
OrganicMolecules 3 Ungesättigungsgrad, Verbrennungswärme
ReactionKinetics 6 Arrhenius, Halbwertzeiten, Konzentrationsgesetze
Thermochemistry 6 Enthalpie, Entropie, Gibbs-Energie, Spontaneität
RedoxChemistry 4 Oxidationszustände, Zellpotential, Nernst-Gleichung
MolecularSimulation 4 Lennard-Jones, VdW-Volumen, MD-Basics

🧮 Physikalische Konstanten

Alle Konstanten sind CODATA 2018 oder aus scipy.constants:

from naturophysx import (
    C,            # Lichtgeschwindigkeit: 299792458 m/s
    H,            # Planck-Konstante: 6.62607015e-34 J·s
    HBAR,         # Reduzierte Planck-Konstante
    K_B,          # Boltzmann-Konstante: 1.380649e-23 J/K
    N_A,          # Avogadro-Zahl: 6.02214076e23 mol⁻¹
    R,            # Universelle Gaskonstante: 8.314462618 J/(mol·K)
    G,            # Gravitationskonstante: 6.67430e-11 m³/(kg·s²)
    E,            # Elementarladung: 1.602176634e-19 C
    EPSILON_0,    # Permittivität des Vakuums
    MU_0,         # Permeabilität des Vakuums
    M_E,          # Elektronenmasse
    M_P,          # Protonenmasse
    SIGMA,        # Stefan-Boltzmann-Konstante
)

📝 Dokumentation

Alle Funktionen haben Google-Style Docstrings:

from naturophysx.quantum import quantum_mechanics

help(quantum_mechanics.hydrogen_energy_level)
# Output:
#     Calculate hydrogen atom energy level
#
#     Energy of nth level: E_n = -13.6 eV / n²
#
#     Args:
#         n (int): Principal quantum number (1, 2, 3, ...)
#
#     Returns:
#         float: Energy in Joules
#
#     Raises:
#         ValueError: If n < 1
#
#     Example:
#         >>> E1 = hydrogen_energy_level(1)
#         >>> print(f"{E1:.2e} J")

🧪 Tests ausführen

# Alle Tests
pytest tests/

# Mit Coverage
pytest --cov=naturophysx tests/

# Nur Chemistry-Tests
pytest tests/test_chemistry.py -v

# Nur Physics-Tests
pytest tests/test_cosmosphysx.py -v

📊 Beispiele

Siehe examples/ für vollständige Demonstrationen:

  • quantum_examples.py - Quantenmechanik Berechnungen
  • chemistry_examples.py - Chemische Berechnungen & Reaktionen
  • mechanics_examples.py - Projektile, Orbits, Kollisionen
  • thermodynamics_examples.py - Wärmeleitung, Phasenübergänge

🛠️ Entwicklung

Setup

git clone https://github.com/yourgithub/naturophysx.git
cd naturophysx
pip install -e ".[dev]"

Code Style

black naturophysx/ tests/
pylint naturophysx/

Type Checking

mypy naturophysx/ --ignore-missing-imports

Dokumentation bauen

cd docs/
sphinx-build -b html . _build/

📖 Weitere Ressourcen

🤝 Beitragen

Wir freuen uns über Beiträge! Bitte:

  1. Fork das Repository
  2. Erstelle einen Feature Branch (git checkout -b feature/AmazingFeature)
  3. Committe deine Änderungen (git commit -m 'Add AmazingFeature')
  4. Push zum Branch (git push origin feature/AmazingFeature)
  5. Öffne einen Pull Request

📄 Lizenz

Dieses Projekt ist unter der MIT-Lizenz lizenziert - siehe LICENSE für Details.

⭐ Zitationen

Falls du NaturoPhysX in einer wissenschaftlichen Publikation verwendest, zitiere bitte:

@software{naturophysx2024,
  author = {Your Team},
  title = {NaturoPhysX: Comprehensive Natural Sciences Library},
  year = {2024},
  url = {https://github.com/yourgithub/naturophysx}
}

🎓 Für Studieren & Lerner

NaturoPhysX ist ideal für:

  • 🏫 Gymnasien & Universitäten (Physik/Chemie Vorlesungen)
  • 📖 Selbststudium & Hausaufgaben
  • 🧬 Forschungsprojekte
  • 👨‍💻 Numerische Simulationen
  • 📊 Datenanalyse

⚠️ Wichtig

  • Genauigkeit: Alle Funktionen verwenden SI-Einheiten wenn nicht anders angegeben
  • Fehlerbehandlung: Ausnahmen werden für ungültige Eingaben geworfen
  • Performance: Optimiert für genaue Berechnungen, nicht für extreme Performance
  • Validierung: Getestete Formeln gegen wissenschaftliche Referenzen

📧 Support

Bei Fragen oder Problemen:


Made with ❤️ für die Science Community 🚀

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

naturophysx-2.0.0.tar.gz (47.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

naturophysx-2.0.0-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file naturophysx-2.0.0.tar.gz.

File metadata

  • Download URL: naturophysx-2.0.0.tar.gz
  • Upload date:
  • Size: 47.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for naturophysx-2.0.0.tar.gz
Algorithm Hash digest
SHA256 8b9b5dbd58ac9b8861d24be718390b59a73d9c0a2c2acb79fb40bdda2f4b486f
MD5 a988c3f183ba76d4800be00665b38fe9
BLAKE2b-256 137aa4293ec8036a4cd59b84dc4e1d480387520d0ad77f43e4c9234124e94030

See more details on using hashes here.

File details

Details for the file naturophysx-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: naturophysx-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 44.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for naturophysx-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6a218bc8ffac7f48dd680f0645e22a985eda4b56bdb423585f1d6434fa27046
MD5 468a4a909f1a60fdc8ed223bbd5d678e
BLAKE2b-256 2971d7b52070c6d5df89c469a9127cd5d7baff73eb1520fafb8cf6efd8490b30

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page