Skip to main content

Astrophysical Chemical Network Solver

Project description

SIMBA: Solver for Inferring Molecular aBundances in Astrophysical environments

SIMBA is a comprehensive solver for chemical reaction networks in astrophysical environments. It is designed to model and simulate complex chemical processes in various cosmic settings such as the interstellar medium (ISM), molecular clouds, and protoplanetary disks.

Features

  • Initialization of chemical species, reactions, and environmental parameters
  • Efficient solving of stiff ODEs representing chemical reactions
  • Support for various reaction types including:
    • Gas-phase reactions
    • Grain-surface chemistry
    • Photochemistry
  • Integration of self-shielding factors for specific molecules (H2, CO, N2, C)
  • Optimization using Numba JIT compilation for performance-critical functions
  • Comprehensive logging and progress tracking

Installation

You can install SIMBA using pip:

pip install simba_chem

Quick Start

  1. First, create an input file for your simulation:
import simba_chem as simba

# Create default input file
simba.create_input('my_input.dat')

     You will also need to have a correctly formatted chemical network file available. A template can be generated using:

simba.create_network("directory/to/save/network/") 

     Don't forget to specify the path to the chemical network file in your input file!

  1. Modify the input parameters in my_input.py according to your needs

  2. Run your simulation:

# Initialize the network
network = simba.Simba()
network.init_simba('my_input.dat')

# Solve the network
result = network.solve_network()

Dependencies

  • numpy
  • scipy
  • matplotlib
  • numba
  • tqdm
  • pandas

Model Components

SIMBA consists of several key components:

  • Elements: Handling of chemical elements
  • Species: Management of atomic and molecular species
  • Gas: Gas phase parameters and properties
  • Dust: Dust grain properties and interactions
  • Environment: Environmental conditions (UV field, cosmic rays, etc.)
  • Reactions: Chemical reaction network and rates
  • Parameters: System parameters and constants

Example Usage

import simba_chem as simba
import matplotlib.pyplot as plt

# Initialize and run
network = simba.Simba()
network.init_simba('my_input.dat')
result = network.solve_network()

# Plot results
time = result['time']
abundances = result['abundances']
plt.loglog(time, abundances[0,:])  # Plot first species abundance
plt.xlabel('Time (s)')
plt.ylabel('Number Density (cm^-3)')
plt.show()

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Luke Keyte

Contributing

Contributions are welcome! Please feel free to get in touch: l.keyte@qmul.ac.uk

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

simba_chem-1.0.2.tar.gz (455.7 kB view details)

Uploaded Source

Built Distribution

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

simba_chem-1.0.2-py2.py3-none-any.whl (463.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file simba_chem-1.0.2.tar.gz.

File metadata

  • Download URL: simba_chem-1.0.2.tar.gz
  • Upload date:
  • Size: 455.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for simba_chem-1.0.2.tar.gz
Algorithm Hash digest
SHA256 248aefeab12201ee4d547dc0918d900a2d8d869dc3c88e9e6db605d92a73d27d
MD5 de5fdfee59c2b11c622eede05e8f0478
BLAKE2b-256 ee101ade358c99d384a9d400c48115960b7ce1fd14a45337890e3e1439890a99

See more details on using hashes here.

File details

Details for the file simba_chem-1.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: simba_chem-1.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 463.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for simba_chem-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9ea708cae87db5ffee347906320b5c9af490d9866f5b28bced5f275178817a25
MD5 726c0ebd8026a6ae64dbebe4229c23fe
BLAKE2b-256 d02fb1b228f2c96b04e7a6300528d3166cc3fdc711b0faf3e3df8c32b7eaeadf

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