Ejemplo n.º 1
0
def test_benchmark_to_canonical():
    M, C1, K0, K2 = dtkbicycle.benchmark_matrices()
    par = dtkbicycle.benchmark_parameters()

    bpM, bpC1, bpK0, bpK2 = bicycle.benchmark_par_to_canonical(par)

    nptest.assert_allclose(M, bpM)
    nptest.assert_allclose(C1, bpC1)
    nptest.assert_allclose(K0, bpK0)
    nptest.assert_allclose(K2, bpK2)
Ejemplo n.º 2
0
def test_benchmark_to_canonical():
    M, C1, K0, K2 = dtkbicycle.benchmark_matrices()
    par = dtkbicycle.benchmark_parameters()

    bpM, bpC1, bpK0, bpK2 = bicycle.benchmark_par_to_canonical(par)

    nptest.assert_allclose(M, bpM)
    nptest.assert_allclose(C1, bpC1)
    nptest.assert_allclose(K0, bpK0)
    nptest.assert_allclose(K2, bpK2)
Ejemplo n.º 3
0
    N,
    q_ind=[q1, q2, q4],
    u_ind=[u2, u4, u5],
    kd_eqs=kinematical,
    q_dependent=[q3],
    configuration_constraints=holonomic,
    u_dependent=[u1, u3, u6],
    velocity_constraints=nonholonomic,
)
# reminder: u1--yaw rate, u2--roll rate, u3--pitch rate, u4--steer rate, u5--rear wheel ang. vel., u6--front wheel ang. vel.

# kane.kindiffeq(kinematical)
(fr, frstar) = kane.kanes_equations(forceList, bodyList)
kdd = kane.kindiffdict()

bp = bi.benchmark_parameters()

mp = bi.benchmark_to_moore(bp)

rr = bp["rR"]
lam = bp["lam"]

basu_input = bi.basu_table_one_input()

mo_in = bi.basu_to_moore_input(basu_input, rr, lam)

# not include the l1, l2, mc and ic because of the rider
# which will be added into instrumented bicycle later.
para_dict = {
    l1: mp["l1"],
    l2: mp["l2"],
Ejemplo n.º 4
0
    [q3, q4, q7],  # yaw, roll, steer
    [u4, u6, u7],  # roll rate, rear wheel rate, steer rate
    kd_eqs=kinematical,
    q_dependent=[q5],  # pitch angle
    configuration_constraints=[holonomic],
    u_dependent=[u3, u5, u8],  # yaw rate, pitch rate, front wheel rate
    velocity_constraints=nonholonomic)
fr, frstar = kane.kanes_equations(forces, bodies)

# Validation of non-linear equations

print('Loading numerical input parameters.')

from dtk import bicycle

bp = bicycle.benchmark_parameters()
mp = bicycle.benchmark_to_moore(bp)

# load the input values specified in table one of Basu-Mandal2007
basu_input = bicycle.basu_table_one_input()

# convert the values to my coordinates and speeds
moore_input = bicycle.basu_to_moore_input(basu_input, bp['rR'], bp['lam'])

constant_substitutions = {}
for k, v in mp.items():
    try:
        exec('constant_substitutions[{}] = v'.format(k))
    except NameError:
        pass
dynamic_substitutions = {}
Ejemplo n.º 5
0
                       [q3, q4, q7], # yaw, roll, steer
                       [u4, u6, u7], # roll rate, rear wheel rate, steer rate
                       kd_eqs=kinematical,
                       q_dependent=[q5], # pitch angle
                       configuration_constraints=[holonomic],
                       u_dependent=[u3, u5, u8], # yaw rate, pitch rate, front wheel rate
                       velocity_constraints=nonholonomic)
fr, frstar = kane.kanes_equations(forces, bodies)

# Validation of non-linear equations

print('Loading numerical input parameters.')

from dtk import bicycle

bp = bicycle.benchmark_parameters()
mp = bicycle.benchmark_to_moore(bp)

# load the input values specified in table one of Basu-Mandal2007
basu_input = bicycle.basu_table_one_input()

# convert the values to my coordinates and speeds
moore_input = bicycle.basu_to_moore_input(basu_input, bp['rR'],
        bp['lam'])

constant_substitutions = {}
for k, v in mp.items():
    try:
        exec('constant_substitutions[{}] = v'.format(k))
    except NameError:
        pass