motion of rattle-back
Project description
RattleBack: motion of rattle-back
RattleBack(abch, ABCD, init, t, sigma=0, g=981, **kw):
abch,ABCD = tuples of four real numbers, where
a,b,c = radii of ellipsoid (cm)
h = OG (O = center of ellipsoid, G = center of mass) (cm)
A,B,C = moments of inertia along a,b,c axis (cm^2)
D = product of intertia in a-b plane (cm^2)
init = initial condition of integration (shape (6,))
t = evaluation time (1d array) (sec)
sigma = friction coefficient (cm^2/sec)
g = gravity acceleration (cm/sec^2)
kw = keyword arguments passed to scipy.integrate.odeint
return y = output of odeint (shape(len(t),6)), where
y[:,0:3] = euler angles alpha,beta,gamma
y[:,3:6] = angular velocities omega_i (i=1,2,3)
all variables are measured in CGS units and radians
A,B,C,D,sigma corresponds to those of
Kane & Levinson DIVIDED BY MASS of rattleback
-------------------------------------------------------------
reference: T. R. Kane and D. A. Levinson
"Realistic Mathematical Modeling of the Rattleback"
International Journal of Non-Linear Mechanics 17 (1982) 175
example code:
import numpy as np
import matplotlib.pyplot as plt
from scipy.constants import degree
from RattleBack import RattleBack
abch = (20,3,2,1)
ABCD = (2,16,17,-0.2)
sigma = 1
init = [0.5*degree, 0.5*degree, 0,0,0,-5]
t = np.linspace(0,10,500)
y = RattleBack(abch, ABCD, init, t, sigma)
alpha,beta,gamma = y.T[:3] # Euler angles
delta = np.arccos(np.cos(alpha)*np.cos(beta)) # tilt angle
plt.figure(figsize=(5,5.5))
plt.subplot(211)
plt.plot(t, gamma/degree)
plt.ylabel(r'$\gamma$ / deg')
plt.subplot(212)
plt.plot(t, delta/degree)
plt.ylabel(r'$\delta$ / deg')
plt.xlabel(r'$t$ = time / sec')
plt.tight_layout()
plt.show()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
RattleBack-0.0.2.tar.gz
(3.3 kB
view details)
Built Distribution
File details
Details for the file RattleBack-0.0.2.tar.gz
.
File metadata
- Download URL: RattleBack-0.0.2.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/26.0 requests/2.22.0 requests-toolbelt/0.9.1 urllib3/1.25.2 tqdm/4.47.0 importlib-metadata/3.7.3 keyring/21.2.1 rfc3986/1.4.0 colorama/0.4.3 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea1ffe9e396604aac129d9b77fab9c7794fe2bc11ffbff1b0ecee7a822d209d4 |
|
MD5 | 263fdeb33d82331a325134fe7c1c377e |
|
BLAKE2b-256 | 6c4913af5cb7f94ca9f50f3edd4b17082a70140c51e7b792bb1eb1452b18feac |
File details
Details for the file RattleBack-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: RattleBack-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/26.0 requests/2.22.0 requests-toolbelt/0.9.1 urllib3/1.25.2 tqdm/4.47.0 importlib-metadata/3.7.3 keyring/21.2.1 rfc3986/1.4.0 colorama/0.4.3 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f58696de6b3d8829b6c8c57eeb7a3fcf8304fd21325c5fede58cfc32e0da3111 |
|
MD5 | c5063745a6ee130735be35d0b5d49eb1 |
|
BLAKE2b-256 | a330013edde29ddd6bb05e85633e8d2ef6ec22a06fd2e100ed68e67a076bd9a9 |