Skip to main content

A modular 2D wave equation solver using finite difference methods

Project description

2D Wave Equation Solver

A modular, testable implementation of a 2D wave equation solver using finite difference methods.

Features

  • Modular design with separate components for boundary conditions, initial conditions, and solver
  • Support for different boundary conditions (Dirichlet, Neumann)
  • Configurable domain size, resolution, and wave speed
  • Built-in visualization and animation capabilities
  • Comprehensive test suite

Installation

pip install wave-solver-2d

Usage



# Show help
wave-solver --help

# Run with default parameters
wave-solver

# Run with custom parameters
wave-solver --wave-speed 1.5 --domain-size 3.0 --resolution 151 --time 4.0

# Run without animation
wave-solver --no-animation --time 2.0

# Use different color maps
wave-solver --colormap seismic

API

from wave_solver import WaveEquationSolver2D, DirichletBC, InitialCondition
import numpy as np

# Create initial condition
ic = InitialCondition(
    displacement=lambda x, y: np.exp(-((x-1)**2 + (y-1)**2) / 0.1)
)

# Create solver
solver = WaveEquationSolver2D(
    c=1.0, Lx=2.0, Ly=2.0, Nx=101, Ny=101,
    boundary_condition=DirichletBC(),
    initial_condition=ic
)

# Solve for 2 seconds
solver.solve(T=2.0)

Contribute and Contact

feel free to drop a PR!!
reach me at : Celestine1729@proton.me <3

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

wave_solver_2d-0.2.0.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

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

wave_solver_2d-0.2.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file wave_solver_2d-0.2.0.tar.gz.

File metadata

  • Download URL: wave_solver_2d-0.2.0.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.6

File hashes

Hashes for wave_solver_2d-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1066f67b01b473018a06125c8afa4087cd20d8bbb81f7149310c5687008401c8
MD5 358a54ca1e0a02d0566f19777d754ac7
BLAKE2b-256 e824e8cb18b99f800f556c43c472be0c84b91009fd4ebd2875e3b955a485fabd

See more details on using hashes here.

File details

Details for the file wave_solver_2d-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: wave_solver_2d-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.6

File hashes

Hashes for wave_solver_2d-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7ef8ef7a7f422797f6fb1d0428f5944ebc865fb2738ac829d891208685b5705
MD5 aa4317a362639eba15d60333a71122bc
BLAKE2b-256 520a3bb931f488b5a3f9fe9b876b30b3f4b1c75af5c8b4e2450b546c46e7fb23

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