This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> R = ReferenceFrame('R') | |
>>> A = R.orientnew('A', rotation) # rotation is just the args need to set a direction cosine matrix with some method | |
>>> B = R.orientnew('B', rotation) | |
# At this point reference frame A know about R, reference frame B knows | |
# about R, but A and B don't know about each other. But each frame has unit | |
# vectors available to work with. | |
>>> v = a * A.x + b * A.y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####Frames | |
Seabottom = SM.ReferenceFrame('Seabottom') | |
Barge_Frame = Seabottom.orientnew('Barge_Frame', 'Body', [phi_barge, theta_barge, psi_barge], 'XYZ') #roll, pitch, yaw: phi, theta, psi | |
"""So in the line above you set the body fixed xyz angles (these | |
are Euler angles) of the barge, but in the line below you set the angular | |
velocity vector as Space fixed rotations. Before you set the angular velocity with explicit generalized speeds you should run this: | |
In [2]: Barge_Frame.ang_vel_in(Seabottom) | |
Out[2]: (sin(psi_barge)*theta_barge' + cos(psi_barge)*cos(theta_barge)*phi_barge')*Barge_Frame.x + (-sin(psi_barge)*cos(theta_barge)*phi_barge' + cos(psi_barge)*theta_barge')*Barge_Frame.y + (sin(theta_barge)*phi_barge' + psi_barge')*Barge_Frame.z |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.optimize import leastsq | |
import pandas | |
import matplotlib.pyplot as plt | |
from dtk.process import butterworth | |
from dtk.systemid import ARX | |
df = pandas.read_csv('RandomSlowSpeed1.txt', delimiter='\t') | |
sample_rate = 100.0 # hz | |
cutoff = 6.0 # hz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# standard library | |
import os | |
import zipfile | |
# external | |
from scipy.io import savemat | |
# local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pendsi; | |
% System identification on a simple pendulum system | |
% The problem was described and solved by shooting in Vyasarayani et al., Multibody Syst Dyn (2011) 26:411424 | |
% Here we use Direct Collocation | |
global problem | |
close all | |
tic | |
% run a simulation to generate data |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian) (format=xelatex 2014.8.6) 6 AUG 2014 09:14 | |
entering extended mode | |
restricted \write18 enabled. | |
%&-line parsing enabled. | |
**sympy-0.7.5-git.tex | |
(./sympy-0.7.5-git.tex | |
LaTeX2e <2011/06/27> | |
Babel <3.9h> and hyphenation patterns for 2 languages loaded. | |
(./sphinxmanual.cls | |
Document Class: sphinxmanual 2009/06/02 Document class (Sphinx manual) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Testing results. | |
Timing the functions. | |
Timing: cython | |
cython time: 0.00288254904747 s | |
Timing: numpy_broadcast | |
numpy_broadcast time: 0.00597401690483 s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(inverted-pendulum-id)moorepants@moorepants-2170p:inverted-pendulum-sys-id(master)$ conda info | |
Current conda install: | |
platform : linux-64 | |
conda version : 3.6.4 | |
conda-build version : 1.3.3 | |
python version : 2.7.8.final.0 | |
requests version : 2.4.1 | |
root environment : /home/moorepants/anaconda (writable) | |
default environment : /home/moorepants/anaconda/envs/inverted-pendulum-id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""This derives the equations of motion for a point mass pendulum on a | |
laterally moving base, i.e. the classic inverted pendulum on a moving cart. | |
iy | |
^ E | |
| o m | |
| l / | | |
| / v g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
moorepants@moorepants-2170p:sympy(0.7.6)$ bin/test | |
================================================================ test process starts ================================================================= | |
executable: /home/moorepants/anaconda/bin/python (2.7.8-final-0) [CPython] | |
architecture: 64-bit | |
cache: yes | |
ground types: python | |
random seed: 57272380 | |
hash randomization: on (PYTHONHASHSEED=362442982) | |
sympy/assumptions/tests/test_assumptions_2.py[5] ..... [OK] |