Skip to main content

Numerical analysis, simulation and data fitting in STEM

Project description

stemre

A Python library for numerical analysis, simulation and data fitting in Science, Technology, Engineering and Mathematics (STEM).

Installation

Use the package manager pip to install the Stemre library.

pip install stemre

Usage

The library is imported into a Python session by running the following import statement.

import stemre as stm

Examples

We will give a few examples that will demonstrate the use of the Stemre library. Before that, the following libraries need to be installed.

import numpy as np
import sympy as sym
import pandas as pd
import matplotlib.pyplot as plt

Differentiation of parametric equations

t = sym.symbols('t')
x = t ** 3 - 3 * t ** 2
y = t ** 4 - 8 * t ** 2
result = stm.par_diff(f = x, g = y, 
                      dependent_variable = t, n = 3)
stm.disp(x = x, y = y, dfdx = result)

Richardson extrapolation

pd.set_option('display.precision', 14)
f = lambda x: x ** 2 * np.exp(x)
x, n, h = 2.5, 5, 0.001
_, df, dx = stm.richardson(f, x, n, h)
stm.disp(Table = df, Result = dx)

Gauss-Legendre quadrature integration

f = lambda x: 13 * (x - x ** 2) * np.exp(-3 * x/2)
a, b, n = 0, 4, 15
result = stm.gauss_legendre(f, a, b, n)
stm.disp(Result = result)

Initial value problems

ode_function = 'y - t^2 + 1'
exact_solution = '(t+1)^2 - 1/2 * exp(t)'
table, figure = stm.ivps(ode_equations = [ode_function, exact_solution],
                         time_span = [0, 3],
                         initial_y = 0.5,
                         steps_stepsize = ['h', 0.12],
                         ivp_method = 'rk4', 
                         show_iterations = None, 
                         decimal_points = 12)
display(table, figure)

Support

For any support on any of the functions in this library, send us an email at: stemresearchs@gmail.com. We are willing to offer the necessary support where we possibly can.

Roadmap

Future releases aim to make Stemre a full-featured numerical analysis, simulation and data fitting library for learning in STEM (Science, Technology, Engineering and Mathematics).

Contributing

To make Stemre a successful library while keeping the code easy. We welcome any valuable contributions towards the development and improvement of this library.

For major changes to the library, please open an issue with us first to discuss what you would like to change and we will be more than willing to make the changes.

Authors and acknowledgement

We are grateful to the incredible support from our developers at Stem Research.

License

MIT

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

stemre-0.0.17.tar.gz (28.4 kB view hashes)

Uploaded Source

Built Distribution

stemre-0.0.17-py3-none-any.whl (38.6 kB view hashes)

Uploaded Python 3

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