Toybox
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)) Nonefor unforced degrees of freedom.
Metadata
Release files for MDOF-toybox 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| MDOF-toybox-0.2.2.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| MDOF_toybox-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.7 kB
Release files / MDOF-toybox-0.2.2.tar.gz
| Download URL | MDOF-toybox-0.2.2.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d67d3fa50fd5bdb5ebdfb42df0de27a2303bc721d7254899ca8ae2dd2be5ba6
|
|
BLAKE2b-256 checksum How to use checksums |
21286cb30af1f8de0a0541d095d24ae02e4d90496af4f1a851f85c404c849e97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / MDOF_toybox-0.2.2-py3-none-any.whl
| Download URL | MDOF_toybox-0.2.2-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4f281e4c997b9a4bdaa1850a1299753f525fb076c4ea7f5a718f7e3734bfd8db
|
|
BLAKE2b-256 checksum How to use checksums |
52eb2496858b295b0eb1e654f62ca16e8d2fff61d9ef5b69c161093fe229b2b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|