Example #1
0
import pickle
from numpy import pi, sqrt
import matplotlib.pyplot as plt
import bicycleparameters as bp
from dtk import bicycle

try:
    # this file should be deleted if you want to force the simulation
    f = open('../../../data/extensions/gyrobikedata.p', 'r')
except IOError:
    try:
        f = open('GyroBike.py', 'r')
    except IOError:
        from altk import alparse
        alparse.alparse('GyroBike', 'GyroBike', code='Python')
    else:
        f.close()
        del f

    from GyroBike import GyroBike

    # create the Whipple model (with my parameters)
    gyroNonLinear = GyroBike()

    # load the benchmark parameters
    pathToData='/media/Data/Documents/School/UC Davis/Bicycle Mechanics/BicycleParameters/data/'
    gyro = bp.Bicycle('Gyro', pathToData, forceRawCalc=True)
    gyro.add_rider('Child', reCalc=True)
    benchmarkPar = bp.io.remove_uncertainties(gyro.parameters['Benchmark'])
    # convert to my parameter set
Example #2
0
#!/usr/bin/env python

# dependencies
import numpy as np
import bicycleparameters as bp
from dtk import bicycle

# local dependencies
try:
    f = open('Whipple.py', 'r')
except IOError:
    from altk import alparse
    alparse.alparse('Whipple', 'Whipple', code='Python')
else:
    f.close()
    del f

from Whipple import LinearWhipple

# create the Whipple model (with my parameters)
whip = LinearWhipple()

# load the benchmark parameters
pathToData = '/media/Data/Documents/School/UC Davis/Bicycle Mechanics/BicycleParameters/data/'
benchmark = bp.Bicycle('Benchmark', pathToData)
benchmarkPar = bp.io.remove_uncertainties(benchmark.parameters['Benchmark'])
# convert to my parameter set
moorePar = bicycle.benchmark_to_moore(benchmarkPar, oldMassCenter=False)
whip.set_parameters(moorePar)

# set the initial conditions to match Meijaard2007
#!/usr/bin/env python

import numpy as np
import bicycleparameters as bp
from dtk import bicycle

try:
    f = open('GyroBike.py', 'r')
except IOError:
    from altk import alparse
    alparse.alparse('GyroBike', 'GyroBike', code='Python')
else:
    f.close()
    del f

from GyroBike import LinearGyroBike

# create the linear gyrobike model
gyrobike = LinearGyroBike()

# create the gyro bike
pathToData = '/media/Data/Documents/School/UC Davis/Bicycle Mechanics/BicycleParameters/data/'
gyro = bp.Bicycle('Gyro', pathToData, forceRawCalc=True)

# set the model parameters
benchmarkPar = bp.io.remove_uncertainties(gyro.parameters['Benchmark'])
moorePar = bicycle.benchmark_to_moore(benchmarkPar)
moorePar['mg'] = benchmarkPar['mD']
moorePar['ig11'] = benchmarkPar['IDxx']
moorePar['ig22'] = benchmarkPar['IDyy']
gyrobike.set_parameters(moorePar)
# This file computes the derivatives of the coordinates and speeds for a single
# state provided by Table 1 in BasuMandall2007 with my model and compares the
# results.

# dependencies
import numpy as np
import bicycleparameters as bp
from dtk import bicycle

# local dependencies
try:
    f = open('Whipple.py', 'r')
except IOError:
    from altk import alparse
    alparse.alparse('Whipple', 'Whipple', code='Python')
else:
    f.close()
    del f

from Whipple import Whipple

# create the Whipple model object
whip = Whipple()

# load the benchmark parameters
pathToData='/media/Data/Documents/School/UC Davis/Bicycle Mechanics/BicycleParameters/data/'
benchmark = bp.Bicycle('Benchmark', pathToData)
benchmarkPar = bp.io.remove_uncertainties(benchmark.parameters['Benchmark'])

# convert to my parameter set
Example #5
0
#!/usr/bin/env python

import numpy as np
import bicycleparameters as bp
from dtk import bicycle

try:
    f = open('RiderLean.py', 'r')
except IOError:
    from altk import alparse
    alparse.alparse('RiderLean', 'RiderLean', code='Python')
else:
    f.close()
    del f

from RiderLean import LinearRiderLean

# create the linear bike model
bike = LinearRiderLean()

# load the benchmark parameters
pathToData='/media/Data/Documents/School/UC Davis/Bicycle Mechanics/BicycleParameters/data/'
bikeWithLegs = bp.Bicycle('Browserlegs', pathToData)
#bikeWithLegs = bp.Bicycle('Lukelegs', pathToData)
benchmarkPar = bp.io.remove_uncertainties(bikeWithLegs.parameters['Benchmark'])

# convert to my parameter set
moorePar = bicycle.benchmark_to_moore(benchmarkPar, oldMassCenter=False)
pitchAngle = bicycle.pitch_from_roll_and_steer(0., 0., moorePar['rf'], moorePar['rr'],
        moorePar['d1'], moorePar['d2'], moorePar['d3'])