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

# Equação do calor: du/dt = d2u/dt2
pde = PDE(
    eq="duxy/dt = d2uxy/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.0.tar.gz (23.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.0-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pdesolver-0.1.0.tar.gz
  • Upload date:
  • Size: 23.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.0.tar.gz
Algorithm Hash digest
SHA256 d9a8f6b046127792adb3eac53f97f8a169e2da8bfc7d148d62fd6f88ed82f65c
MD5 c1248d724c6f425712c97974750308b3
BLAKE2b-256 401c9f7811e93ded3121789183fac7c0fdb35cdf60e1f79f7052f657993885fe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pdesolver-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.2 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 148314dd310a7184ce7b29f2b10bc020400ba1006e6bf414f7859e8606e11f87
MD5 85c838ac00710600dd647ab0f06984bb
BLAKE2b-256 cdde23d8ee92cb5e923cefa88b13332d5791ece349cc16d2bd3cb0c1732db622

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