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.4.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.4.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wave_solver_2d-0.4.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.4.0.tar.gz
Algorithm Hash digest
SHA256 252652bc34f7fa346214dbb937ab75c38a38823f5ac43a0e688564d016ebe7c6
MD5 bcccac681e8e42354a3295b5cd888bc6
BLAKE2b-256 2ef196b1efa37380f1d85aedd4cb50995491a57365854afe54503e5af13ce68f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wave_solver_2d-0.4.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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bbebdf62dcf04655e05b6594d55af4e98576298070b39df2824b539be0d70267
MD5 b799b34f390df7a62582c28f46e53d7b
BLAKE2b-256 032283a475ef81ff7025d37c781218ef3d6408c582e4671e90d21a0f147a80b6

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