Skip to main content

Python Library for Asymmetric Interval Numbers

Project description

The asymintervals library introduces a novel and unique approach with Asymmetric Interval Numbers (AINs), combining the simplicity of classical interval numbers with advanced capabilities for modeling uncertainty.

AINs integrate the expected value with the interval, offering a more accurate representation of data uncertainty compared to traditional interval numbers. This library provides a complete toolkit, including basic arithmetic operations. The theoretical foundations of AINs, along with detailed discussions on properties, rigorous mathematical proofs, and theorems on symmetry and asymmetry for both binary and unary operations, are introduced in [1], further enhancing the mathematical framework of AINs. Practical examples illustrate the versatility of AINs in various scientific and technical applications. AINs represent a significant advancement in interval arithmetic, paving the way for further research and applications across diverse fields.

Documentation is avaliable on readthedocs.

Installation

You can download and install asymintervals library using pip:

pip install asymintervals

You can run all tests with following command from the root of the project:

python -m doctest -v asymintervals\asymintervals.py

Example

A simple example demonstrating how to use the library.

# Import the AIN (Asymmetric Interval Number) class from the asymintervals module
from asymintervals import AIN  
import matplotlib.pyplot as plt

# Initialize two AIN instances with specified lower, upper, and expected values
a = AIN(0, 10, 2)  # Interval 'a' with lower=0, upper=10, expected=2
b = AIN(2, 8, 3)   # Interval 'b' with lower=2, upper=8, expected=3

# Perform arithmetic operations between interval 'a' and interval 'b'
c = a + b          # Addition of intervals 'a' and 'b'
d = a * b          # Multiplication of intervals 'a' and 'b'
e = a / b          # Division of interval 'c' by interval 'd'

# Plot the resulting intervals from the arithmetic operations
c.plot()           # Plot interval 'c' resulting from addition
d.plot()           # Plot interval 'd' resulting from multiplication
e.plot()           # Plot interval 'e' resulting from division

# Print the results of the operations for each interval
print(c)           # Output the details of interval 'c'
print(d)           # Output the details of interval 'd'
print(e)           # Output the details of interval 'e'

# Print summaries for each interval to provide key statistics or characteristics
print("Summary for interval 'a':")
a.summary()
print("Summary for interval 'b':")
b.summary()
print("Summary for interval 'c':")
c.summary()
print("Summary for interval 'd':")
d.summary()
print("Summary for interval 'e':")
e.summary()

Reference

If the asymintervals library has contributed to a scientific publication, we kindly request acknowledgment by citing it.

[1] Sałabun, W. (2024). Asymmetric Interval Numbers: a new approach to modeling uncertainty.
    Fuzzy Sets and Systems, (in press).
@article{salabun2024,
   title={Asymmetric Interval Numbers: a new approach to modeling uncertainty},
   author={Sałabun, Wojciech},
   journal={Fuzzy Sets and Systems},
   volume={in press},
   number={in press},
   pages={in press},
   year={2024},
   publisher={Elsevier}
}

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

asymintervals-1.0.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asymintervals-1.0.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file asymintervals-1.0.0.tar.gz.

File metadata

  • Download URL: asymintervals-1.0.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for asymintervals-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c2f05a60ddccd89c2608008c09925d953ccba224be3c61955566db594a8d4e77
MD5 6b2b2c015e9c79fcc06858f95e4da96e
BLAKE2b-256 9eb89f66c1a479a88c1aa92527870c2194368c11c4b85f5cdf98c555446c4f98

See more details on using hashes here.

File details

Details for the file asymintervals-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: asymintervals-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for asymintervals-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8897b0045b7738dbf48c2d218cccbab68b17f30c6e30a211deb5bfd1562c92b9
MD5 24ca6fde9605c26cc4f3f2bdb80cceaf
BLAKE2b-256 f3950d2e9e444dd9250fa250296c53d6abec618899b1739f7499685a918775f7

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