This module destined to calculation of derivatives using numerical methods
Project description
Derivative Library
This code is a library for calculating derived functions.
Installation
To install the library, use pip:
pip install derivative_mode
Usage
To use the library, import the Derivative
class from the library:
from derivative_mode import Derivative
Then you can create an instance of the Derivative
class by passing the function you want to differentiate as an argument:
python def func(x):
return x**2
derivative = Derivative(func)
Methods
tailor_app
Calculates the derivative of the function at the point x0
using the Taylor method.
Usage example:
result = derivative.tailor_app(2)
polinom_app
Calculates the derivative of the function at the point x0
using the polynomial method.
Usage example:
result = derivative.polinom_app(2)
second_derivative
Calculates the second derivative of the function at the point x0
.
Usage example:
result = derivative.second_derivative(2)
threepoint_pattern(x0, second_deriv=False)
Calculates the first or second derivative of a function at the point x0
using the three-point method.
Usage example:
result = derivative.threepoint_pattern(2, second_deriv=True)
Exception handling
If the function was set using a grid, the methods tailor_app
, polinom_app
and threepoint_pattern
will throw an exception. If an error occurred while using the function, the methods will also throw an exception.
License
This library is available under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file derivative_mode-0.5.tar.gz
.
File metadata
- Download URL: derivative_mode-0.5.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3df4eca05f2f7ced00a02a799107663370321f100c5d15427201de7d2eddab6a |
|
MD5 | 75f3204e9ae4dfbef7946732f9296e55 |
|
BLAKE2b-256 | 597164d326ee26bec4a07d10fe4137d0a1af590d2954607842c4bde8bc615cc4 |
File details
Details for the file derivative_mode-0.5-py3-none-any.whl
.
File metadata
- Download URL: derivative_mode-0.5-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f349c860e2c5737fc9c3a1867eb9c0b27ef713dcac4bd0e0ef8ff83ad171b24f |
|
MD5 | e945f9791b361ad0cdc75423e40f11f4 |
|
BLAKE2b-256 | 6ab59c6b3c5cfc85a9b4bd603d601a47b019be983fa76285a636107da027148d |