Esempio n. 1
0
    damping_rod_on_plate, damping_1, damping_2, moment
]

fr, frstar = kane.kanes_equations(loads, [Plate, rod])

Mass = kane.mass_matrix_full
f = kane.forcing_full

sys = System(kane)
sys.constants = {
    m: mass_of_rod,
    M: mass_of_plate,
    g: 9.81,
    H: workspace_width,
    a: plate_width,
    b: plate_height,
    c: cable_c,
    c_rod: rod_c,
    k_rod: rod_k,
    Izz: inertia_of_plate,
    Izz_rod: inertia_of_rod,
}
sys.initial_conditions = {x: x_init, y: y_init, beta: beta_init, e: -rod_init}
sys.specifieds = {
    L1: lambda x, t: s_curve(t, L1_init_s, L1_end_s, RiseTime, StartTime),
    L2: lambda x, t: s_curve(t, L2_init_s, L2_end_s, RiseTime, StartTime)
}
sys.times = np.linspace(0.0, Simulation_Time, 1000)
sys.generate_ode_function(generator='cython')

y = sys.integrate()
Esempio n. 2
0
sys.constants = {
    I[0]: 1.0,
    I[1]: 1.0,
    I[2]: 1.0,
    I[3]: 1.0,
    I[4]: 1.0,
    I[5]: 1.0,
    L[0]: 0.3,
    L[1]: 0.0,
    L[2]: 0.5,
    L[3]: 0.3,
    L[4]: 0.0,
    L[5]: 0.5,
    L[6]: 0.3,
    L[7]: 0.0,
    L[8]: 0.6,
    L[9]: 0.3,
    L[10]: 0.0,
    L[11]: 0.6,
    L[12]: 0.3,
    L[13]: 0.02,
    L[14]: 0.5,
    L[15]: 0.3,
    L[16]: 0.02,
    L[17]: 0.5,
    L[18]: 0.3,
    L[19]: 0.02,
    L[20]: 0.6,
    L[21]: 0.3,
    L[22]: 0.02,
    L[23]: 0.6,
    L[24]: 0.01,
    L[25]: 0.03,
    L[26]: 0.02,
    L[27]: 0.01,
    L[28]: 0.03,
    L[29]: 0.02,
    L[30]: 0.01,
    L[31]: 0.03,
    L[32]: 0.02,
    L[33]: 0.01,
    L[34]: 0.03,
    L[35]: 0.02,
    L[36]: 0.01,
    L[37]: 0.04,
    L[38]: 0.02,
    L[39]: 0.01,
    L[40]: 0.04,
    L[41]: 0.02,
    L[42]: 0.01,
    L[43]: 0.04,
    L[44]: 0.02,
    L[45]: 0.01,
    L[46]: 0.04,
    L[47]: 0.02,
    Lgr: 0.01,
    Lsp: 0.04,
    g: 9.81,
    k[0]: 100.0,
    k[1]: 100.0,
    k[2]: 100.0,
    k[3]: 50.0,
    k[4]: 10.0,
    k[5]: 50.0,
    ma: 0.2,
    mb: 1.0
}
Esempio n. 3
0
# create a Kane object with respect to the Newtonian reference frame
kane = me.KanesMethod(N,
                      q_ind=(theta, phi),
                      u_ind=(omega, alpha),
                      kd_eqs=kinDiffs)

# calculate Kane's equations
fr, frstar = kane.kanes_equations(loads, bodies)

sys = System(kane)

sys.constants = {
    lB: 0.2,  # m
    h: 0.1,  # m
    w: 0.2,  # m
    mA: 0.01,  # kg
    mB: 0.1,  # kg
    g: 9.81,  # m/s**2
}

sys.initial_conditions = {
    theta: np.deg2rad(90.0),
    phi: np.deg2rad(0.5),
    omega: 0,
    alpha: 0
}

sys.times = np.linspace(0, 10, 500)

x = sys.integrate()
Esempio n. 4
0
Mass = kane.mass_matrix_full
f = kane.forcing_full

plate_width = 4.0
plate_height = 2.0
mass_of_plate = 10.0
rod_length = 3.0
mass_of_rod = 2.0
inertia_of_plate = (plate_width**2 + plate_height**2) * (mass_of_plate/12.0)

sys = System(kane)
sys.constants = {
                 M:12.0,
                 g:9.81,
                 F1:Lengths_and_Moments(inital_x, inital_y)[0],
                 F2:Lengths_and_Moments(inital_x, inital_y)[1],
                 H:20.0,
                 a:4.0,
                 b:2.0,
                 Izz:inertia_of_plate,
                 }
sys.initial_conditions = {x:inital_x, y:inital_y, beta:0}
sys.times = np.linspace(0.0, 20.0, 1000)

y = sys.integrate()

sim_time = np.linspace(0.0, 20.0, 1000)
fig = plt.figure(figsize=(18, 4))

# fig = plt.figure(0)
fig.add_subplot(141)
plt.plot(sim_time, y[:,0], label='Unshaped')
Esempio n. 5
0
    l23[1]: 0.01,
    l23[2]: 0.01,
    l34[0]: 0.01,
    l34[1]: 0.01,
    l34[2]: 0.01,
    l45: 0.01,
    l56: 0.02,
    m1: 0.01,
    m2: 0.05,
    m3: 0.1,
    m4: 0.01,
    m5: 0.01  #, m6: 0.02
}

sys = System(KM)
sys.constants = consts
sys.times = np.linspace(0, 100.0, 1000000)
yi1 = consts[l01[1]] - consts[l10[1]]
yi2 = yi1 + consts[l12[1]] - consts[l21[1]]
x6 = consts[l45] + consts[l56]
sys.initial_conditions = {
    q[0]: 0.0,
    q[1]: 0.0,
    q[2]: 0.0,
    q[3]: 0.0,
    q[4]: 0.0,
    q[5]: 0.0,
    q[6]: 0.0,
    q[7]: yi1,
    q[8]: 0.0,
    q[9]: 0.0,
Esempio n. 6
0
true_x_pre = []
true_z_pre = []
true_e_pre = []
true_theta_pre = []
true_phi_pre = []
for i in range(10000):
    sys.constants = {
        M: plate_mass,
        m: rod_mass,
        g: 9.81,
        H: workspace_width,
        a: plate_width,
        b: plate_height,
        kr: rod_spring,
        cr: rod_damper,
        k: cable_k,
        c: cable_c,
        Ip: plate_inertia,
        Ir: rod_inertia,
        L1: Length1_values[i],
        L2: Length2_values[i],
        e_offset: e_offset_scalar,
        k_C: spring_on_frame_C
    }
    sys.initial_conditions = {
        x: x_values_heat_np[i],
        z: z_values_heat_np[i],
        theta: theta_values_heat_np[i, 0],
        e: e_equil,
        phi: theta_values_heat_np[i, 0]
    }
Esempio n. 7
0
bodies = (rod, plate)
loads = (rod_gravity, plate_gravity)

# create a Kane object with respect to the Newtonian reference frame
kane = me.KanesMethod(N, q_ind=(theta, phi), u_ind=(omega, alpha),
                      kd_eqs=kinDiffs)

# calculate Kane's equations
fr, frstar = kane.kanes_equations(loads, bodies)

sys = System(kane)

sys.constants = {lB: 0.2, # m
                 h: 0.1, # m
                 w: 0.2, # m
                 mA: 0.01, # kg
                 mB: 0.1, # kg
                 g: 9.81, # m/s**2
                 }

sys.initial_conditions = {theta: np.deg2rad(90.0),
                          phi: np.deg2rad(0.5),
                          omega: 0,
                          alpha: 0}

sys.times = np.linspace(0, 10, 500)

x = sys.integrate()


plt.plot(sys.times, x)