dualnum-0.2.1
توضیحات
Python bindings for num-dual: Generalized (hyper) dual numbers for the calculation of exact (partial) derivatives
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | dualnum-0.2.1 |
| نام | dualnum |
| نسخه کتابخانه | 0.2.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Gernot Bauer <bauer@itt.uni-stuttgart.de>, Philipp Rehner <rehner@itt.uni-stuttgart.de> |
| ایمیل نویسنده | Gernot Bauer <bauer@itt.uni-stuttgart.de>, Philipp Rehner <rehner@itt.uni-stuttgart.de> |
| آدرس صفحه اصلی | https://github.com/itt-ustutt/dualnum |
| آدرس اینترنتی | https://pypi.org/project/dualnum/ |
| مجوز | MIT OR Apache-2.0 |
# dualnum
[](https://itt-ustutt.github.io/dualnum/)
[](https://badge.fury.io/py/dualnum)
Python bindings for the `num-dual` rust crate.
## Installation
```
pip install dualnum
```
## Installation from source
To install from source, you need to have the rust compiler installed.
```
pip install git+https://github.com/itt-ustutt/dualnum
```
## Sphinx documentation
To build the documentation with sphinx:
```
maturin develop --release
cd docs
make html
make doctest
firefox _build/html/index.html
```
## Usage
### Compute first and second derivative of a scalar valued function.
```python
from dualnum import derive2
import numpy as np
def f(x):
return np.exp(x) / np.sqrt(np.sin(x)**3 + np.cos(x)**3)
x = derive2(1.5)
result = f(x)
print('f(x) = {}'.format(result.value))
print('df/dx = {}'.format(result.first_derivative))
print('d2f/dx2 = {}'.format(result.second_derivative))
```
نحوه نصب
نصب پکیج whl dualnum-0.2.1:
pip install dualnum-0.2.1.whl
نصب پکیج tar.gz dualnum-0.2.1:
pip install dualnum-0.2.1.tar.gz