Skip to main content

Tooling to generate toy MDOF dynamics data for arbitrary linear and nonlinear systems in python

Project description

Toybox

test-on-commit codecov

Tooling to generate toy MDOF dynamics data for arbitrary physical linear and nonlinear systems in python.

Feel free to raise any issues of make suggestions.

Quickstart guide

import toybox as tb

# Initialise a linear symetric sytem
system = tb.symetric(dofs=2, m=1, c=20, k=1e5)

# Define a nonlinearity
def quadratic_cubic_stiffness_2dof_single(_, t, y, ydot):
    return np.dot(y**2, np.array([5e7, 0])) + np.dot(y**3, np.array([1e9, 0]))

# Attach the nonlinearity
system.N = quadratic_cubic_stiffness_2dof_single

#Define some excitations for the system
system.excitation = [tb.forcings.white_gaussian(0, 1), None]

# Simulate
n_points = 1e3
fs = 1/500
normalised_data = system.simulate((n_points, fs),  normalise=True)

# Denormalise later if required
data = sytem.denormalise()

data is a python dict with time series as follows:

Variable Description Dictionary key
t Time points 'ts'
Xd(t) Forcing at location d 'x{d}'
Yd(t) Displacement at location d 'y{d}'
Y'd(t) Velocity at location d 'ydot{d}'

Customisation

Arbitrary systems

toybox.system Allows the specification of arbitrary M, C and K matrices.

Arbitrary forcing

Set your_system.excitation to a per degree-of-freedom iterable. Entries can include either:

  • Premade excitations (such as white_gaussian or sinusoidal)
  • Timeseries (with shape (n_points, ndofs))
  • None for unforced degrees of freedom.

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

MDOF-toybox-0.2.2.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

MDOF_toybox-0.2.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file MDOF-toybox-0.2.2.tar.gz.

File metadata

  • Download URL: MDOF-toybox-0.2.2.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for MDOF-toybox-0.2.2.tar.gz
Algorithm Hash digest
SHA256 2d67d3fa50fd5bdb5ebdfb42df0de27a2303bc721d7254899ca8ae2dd2be5ba6
MD5 6929b2a94cff40b38c9ab819f35cce45
BLAKE2b-256 21286cb30af1f8de0a0541d095d24ae02e4d90496af4f1a851f85c404c849e97

See more details on using hashes here.

Provenance

File details

Details for the file MDOF_toybox-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: MDOF_toybox-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for MDOF_toybox-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4f281e4c997b9a4bdaa1850a1299753f525fb076c4ea7f5a718f7e3734bfd8db
MD5 79a7f8a87942b95a8a5bda43853c5236
BLAKE2b-256 52eb2496858b295b0eb1e654f62ca16e8d2fff61d9ef5b69c161093fe229b2b0

See more details on using hashes here.

Provenance

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