Skip to main content

Solver simbólico para equações diferenciais parciais (PDEs) com discretização por diferenças finitas

Project description

pdesolver

Solver simbólico para equações diferenciais parciais (PDEs) usando discretização por diferenças finitas.

Instalação

pip install pdesolver

Para suporte a GPU (CUDA 12):

pip install pdesolver[gpu]

Uso rápido

from pdesolver import PDE, PDES

pde = PDE(
    eq="du/dt = d2u/dx2",
    func="u",
    sp_var=["x"],
    ivar=["t"],
    ivar_boundary=[(0, 1)],
    expr_ic="sin(pi*x)",
    west_bd="Dirichlet", west_func_bd="0",
    east_bd="Dirichlet", east_func_bd="0",
)

sistema = PDES(pdes=[pde], disc_n=[50])
sistema.discretize(method='central')
sistema.solve(method='bdf2', tf=0.1, nt=100)
sistema.visualize(mode='plot1d_all', tf=0.1)

Métodos disponíveis

Discretização espacial

  • method='central' — diferenças centrais (padrão)
  • method='forward' — diferenças progressivas
  • method='backward' — diferenças regressivas

Integração temporal

  • method='bdf2' — BDF-2 implícito (padrão, recomendado)
  • method='CN' — Crank-Nicolson
  • method='RKF' — Runge-Kutta-Fehlberg 4(5) com CUDA (requer cupy)

Condições de contorno

  • Dirichlet — valor prescrito
  • Neumann — fluxo prescrito
  • Robin — combinação linear

Visualização

  • 'plot1d' / 'plot1d_all' — perfis 1D
  • 'heatmap1d' — mapa espaciotemporal 1D
  • 'animation1d' — animação 1D
  • 'heatmap' — mapa de calor 2D
  • 'plot3d' / 'animation3d' — superfície 3D

Salvar e carregar resultados

sistema.save_to_json("resultado.json")

sistema2 = PDES.load_from_json("resultado.json")

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

pdesolver-0.1.1.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

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

pdesolver-0.1.1-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file pdesolver-0.1.1.tar.gz.

File metadata

  • Download URL: pdesolver-0.1.1.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for pdesolver-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8fe684c53a93e1113fbe59d1e78e857b8f0984a0eb8a7c4945ec6c1837bf474c
MD5 bb6f4d1bf5e78a23a68bc19f4bfd3e7f
BLAKE2b-256 ffaf9f17bd3ca9b9f68e075b7fd4f5932b3c01f38b6e8784589485b3fb11a951

See more details on using hashes here.

File details

Details for the file pdesolver-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pdesolver-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 28.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for pdesolver-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea5007c9aeebdec508b310f55501bd33be32d468afaa5a09449cc791b7500369
MD5 922b3edefdb108f055f1a59a338501b4
BLAKE2b-256 ae28d6c6f5d27d829ef79e9cdb82f1be860bdef16dac7a4c6c4fa3a347696d70

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