lorenz-attractor

Python code to visualize Lorenz Attractors

https://github.com/josesolisrosales/lorenz-attractor

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.6%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Python code to visualize Lorenz Attractors

Basic Info
  • Host: GitHub
  • Owner: josesolisrosales
  • Language: Python
  • Default Branch: main
  • Size: 55.7 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 2 years ago · Last pushed 12 months ago
Metadata Files
Readme Citation

README.md

Lorenz Attractor Professional Suite

PyPI version Python versions License Build Status codecov

A comprehensive, professional-grade simulation and visualization toolkit for the Lorenz attractor and related chaotic dynamical systems. This project transforms a basic college simulation into a production-quality scientific computing package.

🌟 Features

Core Simulation Engine

  • Advanced Numerical Integration: Multiple methods including Euler, RK4, adaptive RK, and Dormand-Prince 5(4)
  • High-Performance Computing: Numba-compiled critical functions for optimal performance
  • Parameter Management: Type-safe parameter handling with validation
  • True Random Initial Conditions: Integration with system entropy for reproducible randomness

Visualization & Graphics

  • Real-time 3D Visualization: OpenGL, ModernGL, and Pygame backends
  • Professional Plotting: Publication-quality matplotlib and interactive Plotly visualizations
  • Multiple View Modes: 3D trajectories, 2D projections, phase space analysis
  • Video Export: High-quality MP4 and GIF animation export with customizable quality settings

Advanced Analysis

  • Parameter Sweeps: Automated exploration of parameter space
  • Bifurcation Analysis: Comprehensive bifurcation diagram generation
  • Lyapunov Exponents: Accurate calculation of system stability measures
  • Poincaré Sections: Phase space cross-sections for detailed analysis
  • Sensitivity Analysis: Butterfly effect demonstration and quantification

Data Management

  • Multiple Export Formats: CSV, JSON, HDF5, NumPy, MATLAB, and Pickle
  • Comprehensive Data Packages: Bundled exports with metadata and documentation
  • Simulation Metadata: Detailed tracking of simulation parameters and performance

User Interfaces

  • Command Line Interface: Full-featured CLI with comprehensive options
  • Web Application: Interactive Dash-based web interface for exploration
  • Python API: Clean, documented API for programmatic use

🚀 Quick Start

Installation

```bash

Install from PyPI

pip install lorenz-attractor ```

Development Installation

```bash

Clone the repository

git clone https://github.com/josesolisrosales/lorenz-attractor.git cd lorenz-attractor

Install in development mode

pip install -e . ```

Basic Usage

```python from lorenzattractor import LorenzSystem, Simulator, LorenzPlotter from lorenzattractor.core.parameters import InitialConditions, SimulationConfig

Create and run simulation

system = LorenzSystem() simulator = Simulator(system)

initialconditions = InitialConditions(x=1.0, y=1.0, z=1.0) config = SimulationConfig(dt=0.01, numsteps=10000)

result = simulator.simulate(initial_conditions, config)

Visualize results

plotter = LorenzPlotter(style='dark') fig = plotter.plot3dtrajectory(result) ```

Command Line Interface

```bash

Basic simulation

lorenz-attractor simulate --sigma 10 --rho 28 --beta 2.667

Parameter sweep

lorenz-attractor sweep --parameter rho --range 20 30 --steps 100

Real-time visualization

lorenz-attractor realtime --method pygame

Launch web interface

lorenz-web --host 0.0.0.0 --port 8050 ```

Web Interface

```bash

Launch interactive web application

lorenz-web --host 0.0.0.0 --port 8050 ```

Then open http://localhost:8050 in your browser.

📊 Examples

Parameter Sensitivity Analysis

```python

Demonstrate butterfly effect

baseic = InitialConditions(x=1.0, y=1.0, z=1.0) perturbedic = InitialConditions(x=1.0 + 1e-10, y=1.0, z=1.0)

results = simulator.simulatemultiple([baseic, perturbed_ic], config)

Results show exponential divergence characteristic of chaos

```

Bifurcation Analysis

```python

Analyze system behavior across parameter range

bifurcationdata = simulator.bifurcationanalysis( 'rho', (0.5, 50), numpoints=200, initialconditions=base_ic, config=config )

plotter = LorenzPlotter() fig = plotter.plotbifurcationdiagram(bifurcation_data) ```

Video Export

```python

Create high-quality animation

videoexporter = VideoExporter(fps=60, dpi=200) videoexporter.exporttrajectoryanimation( result, "lorenzevolution.mp4", quality='ultra', traillength=1000 ) ```

🏗️ Architecture

The package is organized into modular components:

lorenz_attractor/ ├── core/ # Core simulation engine │ ├── lorenz.py # Lorenz system implementation │ ├── simulator.py # Simulation orchestration │ └── parameters.py # Parameter management ├── integration/ # Numerical integration methods ├── visualization/ # Plotting and real-time graphics ├── export/ # Data and video export ├── analysis/ # Advanced analysis tools ├── web/ # Web interface └── utils/ # Utility functions

🎯 Advanced Features

Performance Optimization

  • Numba JIT compilation for critical loops
  • Parallel simulation execution
  • Memory-efficient data structures
  • Optimized integration algorithms

Scientific Computing

  • IEEE 754 compliant floating-point arithmetic
  • Adaptive step size control
  • Error estimation and monitoring
  • Numerical stability analysis

Extensibility

  • Plugin architecture for custom integrators
  • Configurable visualization backends
  • Extensible export formats
  • Modular analysis components

📈 Performance

Typical performance on modern hardware: - Basic simulation (10k points): ~0.1 seconds - Parameter sweep (100 simulations): ~10 seconds
- Bifurcation analysis (1000 points): ~2 minutes - Video export (1 minute HD): ~30 seconds

🔬 Scientific Applications

This toolkit is suitable for: - Chaos Theory Research: Detailed analysis of chaotic dynamics - Educational Demonstrations: Interactive exploration of nonlinear systems - Numerical Methods Development: Testing integration algorithms - Visualization Research: Advanced scientific visualization techniques

📚 Documentation

🤝 Contributing

Contributions are welcome! Please open an issue or submit a pull request.

📄 License

This project is licensed under the MIT License.

🙏 Acknowledgments

  • Edward Lorenz for discovering the Lorenz attractor
  • Scientific Python Community for the excellent ecosystem
  • NumPy, SciPy, Matplotlib for foundational tools
  • Plotly, Dash for modern web visualization

📞 Citation

If you use this software in academic work, please cite:

bibtex @software{lorenz_attractor_pro, title={Lorenz Attractor Professional Suite}, author={Jose Solis Rosales}, year={2024}, url={https://github.com/josesolisrosales/lorenz-attractor}, version={2.0.0} }


Transform your understanding of chaos with professional-grade simulation tools. 🦋

Owner

  • Name: Jose Solis
  • Login: josesolisrosales
  • Kind: user
  • Company: @draios

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: Lorenz Attractor Simulations
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Jose Solis Rosales
    email: josesolisrosales@linux.com
repository-code: >-
  https://github.com/josesolisrosales/lorenz-attractor/tree/main
license: MIT

GitHub Events

Total
  • Release event: 2
  • Watch event: 3
  • Delete event: 1
  • Issue comment event: 1
  • Push event: 11
  • Pull request review event: 1
  • Pull request review comment event: 2
  • Pull request event: 12
  • Create event: 9
Last Year
  • Release event: 2
  • Watch event: 3
  • Delete event: 1
  • Issue comment event: 1
  • Push event: 11
  • Pull request review event: 1
  • Pull request review comment event: 2
  • Pull request event: 12
  • Create event: 9

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
pypi.org: lorenz-attractor

Professional-grade Lorenz attractor simulation suite

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 8.9%
Average: 29.5%
Dependent repos count: 50.0%
Maintainers (1)
Last synced: 10 months ago

Dependencies

requirements.txt pypi
  • dash >=2.12.0
  • fastapi >=0.100.0
  • matplotlib >=3.6.0
  • moderngl >=5.8.0
  • numba >=0.57.0
  • numpy >=1.24.0
  • opencv-python >=4.8.0
  • pandas >=1.5.0
  • pillow >=9.5.0
  • plotly >=5.15.0
  • pydantic >=2.0.0
  • pygame >=2.5.0
  • pyopengl >=3.1.0
  • requests >=2.31.0
  • scipy >=1.10.0
  • seaborn >=0.12.0
  • uvicorn >=0.23.0
setup.py pypi
  • dash >=2.12.0
  • fastapi >=0.100.0
  • matplotlib >=3.6.0
  • moderngl >=5.8.0
  • numba >=0.57.0
  • numpy >=1.24.0
  • opencv-python >=4.8.0
  • pillow >=9.5.0
  • plotly >=5.15.0
  • pydantic >=2.0.0
  • pygame >=2.5.0
  • pyopengl >=3.1.0
  • requests >=2.31.0
  • scipy >=1.10.0
  • uvicorn >=0.23.0