# PDEPy
[![Supported Python versions](https://img.shields.io/pypi/pyversions/pdepy.svg)](https://pypi.org/project/pdepy/)
[![PyPI version](https://badge.fury.io/py/pdepy.svg)](https://badge.fury.io/py/pdepy)
[![Build Status](https://travis-ci.org/olivertso/pdepy.svg?branch=master)](https://travis-ci.org/olivertso/pdepy)
[![Coverage Status](https://coveralls.io/repos/github/olivertso/pdepy/badge.svg?branch=master)](https://coveralls.io/github/olivertso/pdepy?branch=master)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
A Python 3 library for solving initial and boundary value problems of some linear partial differential equations using finite-difference methods.
- Laplace
- Implicit Central
- Parabolic
- Explicit Central
- Explicit Upwind
- Implicit Central
- Implicit Upwind
- Wave
- Explicit
- Implicit
## Usage
### Installation
```
pip install pdepy
```
### Examples
#### Laplace's Equation
```python
import numpy as np
from pdepy import laplace
xn, xf, yn, yf = 30, 3.0, 40, 4.0
x = np.linspace(0, xf, xn + 1)
y = np.linspace(0, yf, yn + 1)
f = lambda x, y: (x - 1) ** 2 - (y - 2) ** 2
bound_x0 = f(0, y)
bound_xf = f(xf, y)
bound_y0 = f(x, 0)
bound_yf = f(x, yf)
axis = x, y
conds = bound_x0, bound_xf, bound_y0, bound_yf
laplace.solve(axis, conds, method="ic")
```
#### Parabolic Equation
```python
import numpy as np
from pdepy import parabolic
xn, xf, yn, yf = 40, 4.0, 50, 0.5
x = np.linspace(0, xf, xn + 1)
y = np.linspace(0, yf, yn + 1)
init = x ** 2 - 4 * x + 5
bound = 5 * np.exp(-y)
p, q, r, s = 1, 1, -3, 3
axis = x, y
conds = init, bound, bound
params = p, q, r, s
parabolic.solve(axis, params, conds, method="iu")
```
#### Wave Equation
```python
import numpy as np
from pdepy import wave
xn, xf, yn, yf = 40, 1.0, 40, 1.0
x = np.linspace(0, xf, xn + 1)
y = np.linspace(0, yf, yn + 1)
d_init = 1
init = x * (1 - x)
bound = y * (1 - y)
axis = x, y
conds = d_init, init, bound, bound
wave.solve(axis, conds, method="i")
```
## Development
Create virtual environment and install requirements:
```
bin/setup_venv
```
### Other commands
Run command in virtual environment:
```
bin/run <command>
```
Install requirements:
```
bin/install_requirements
```
Format codebase:
```
bin/format
```
Lint codebase:
```
bin/lint
```
Run unit tests:
```
bin/test
```
## Publish
Package and distribute:
```
bin/publish
```
没有合适的资源?快使用搜索试试~ 我知道了~
求解某些线性偏微分方程初值和边值问题的有限.zip
共32个文件
py:12个
txt:2个
in:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 6 浏览量
2023-04-09
13:27:12
上传
评论
收藏 16KB ZIP 举报
温馨提示
求解某些线性偏微分方程初值和边值问题的有限.zip
资源推荐
资源详情
资源评论
收起资源包目录
求解某些线性偏微分方程初值和边值问题的有限.zip (32个子文件)
pdepy-master
.flake8 144B
pdepy
utils.py 475B
__init__.py 0B
wave.py 3KB
parabolic.py 3KB
time.py 383B
laplace.py 2KB
steady.py 403B
cov_report
.gitkeep 0B
.travis.yml 288B
setup.py 1KB
.coveragerc 53B
pytest.ini 139B
LICENSE 1KB
tests
test_laplace.py 960B
test_utils.py 447B
test_wave.py 893B
test_parabolic.py 3KB
bin
setup_venv 133B
install_requirements 181B
publish 101B
lint 159B
format 116B
test 68B
run 77B
requirements.in 27B
requirements-dev.txt 2KB
pyproject.toml 228B
requirements.txt 210B
.gitignore 1KB
requirements-dev.in 123B
README.md 2KB
共 32 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9153
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功