Skip to main content

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 pyderivative==1.2

Usage

To use the library, import the Derivative class from the library:

from pyderivative.Derivative import Derivative

Then you can create an instance of the Derivative class by passing the function you want to differentiate as an argument:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyderivative-1.2.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

pyderivative-1.2-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file pyderivative-1.2.tar.gz.

File metadata

  • Download URL: pyderivative-1.2.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

Hashes for pyderivative-1.2.tar.gz
Algorithm Hash digest
SHA256 eaae28da824bac2cf45eefac219dbab247088cb1ad459adf283ae2ce75caa85b
MD5 3d1d86020aa9d07ebeb2d49990e3bd65
BLAKE2b-256 fef5df308f95a367b1fb0ec3ea62a97248e67c39ff9437a4766c677c20992752

See more details on using hashes here.

File details

Details for the file pyderivative-1.2-py3-none-any.whl.

File metadata

  • Download URL: pyderivative-1.2-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

Hashes for pyderivative-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d1b545419d2c242896b73f5d87bbd258d4c3ad75edbdcae61282dc8f21793c23
MD5 133bb32395625b8ef3aefab08f8affec
BLAKE2b-256 20ff03d73ae312c3e33a0aca181bcb164ef97f7b74e8e1f5f44be08811646101

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page