Exemplo n.º 1
0
    def simulate(self, xpivot=0.0, vpivot=0.0, t1=1.5, dt=0.01):
        # reset
        self.system.q [:] = 0.0
        self.system.qd[:] = 0.0

        # initial conditions
        self.system.q [self.pivot.istrain[0]] = xpivot # initial elevation
        self.system.qd[self.pivot.istrain[0]] = vpivot # initial elevation spd
        self.system.qd[self.axis .istrain[0]] = self.spin # initial rotation speed

        # simulate
        self.t = np.arange(0, t1, dt)
        self.y = solve_system(self.system, self.t, outputs='vels')
Exemplo n.º 2
0
    def simulate(self, xpivot=0.0, vpivot=0.0, t1=1.5, dt=0.01):
        # reset
        self.system.q[:] = 0.0
        self.system.qd[:] = 0.0

        # initial conditions
        self.system.q[self.pivot.istrain[0]] = xpivot  # initial elevation
        self.system.qd[self.pivot.istrain[0]] = vpivot  # initial elevation spd
        self.system.qd[
            self.axis.istrain[0]] = self.spin  # initial rotation speed

        # simulate
        self.t = np.arange(0, t1, dt)
        self.y = solve_system(self.system, self.t, outputs='vels')
Exemplo n.º 3
0
def sim_both(q0=None, qd0=None):
    if q0 is None: q0 = np.zeros_like(w)
    if qd0 is None: qd0 = np.zeros_like(w)

    t = np.arange(0, 2, 0.005)
    ylin = linsys.integrate(t, q0, qd0)
    system.q[:] = 0.0
    system.qd[:] = 0.0
    system.q[system.iFreeDOF] = q0
    system.qd[system.iFreeDOF] = qd0
    y = solve_system(system, t)

    ylin = ylin[:, :len(q0)]
    ax = plt.figure().add_subplot(111)
    ax.set_color_cycle(['r', 'g', 'b', 'c'])
    ax.plot(t, ylin, ':', t, y, '--')
    plt.legend(('Mode 1', 'Mode 2', 'Mode 3', 'Mode 4'))
    return t, y, ylin
Exemplo n.º 4
0
def test1():
    # Initial conditions
    system.qd[bearing.istrain[0]] = -10 * pi/180

    # Prescribed DOFs
    #system.prescribe(foundation.istrain, 0.0)
    system.prescribe(tower.istrain, 0.0)
    system.prescribe(bearing.istrain, 0.0)
    system.prescribe(b1.istrain, 0.0)
    system.prescribe(b2.istrain, 0.0)
    system.prescribe(b3.istrain, 0.0)

    # Solve
    dt = 0.05
    t = np.arange(0, 40, dt)
    y = solve_system(system, t)

    return t,y
Exemplo n.º 5
0
def sim_both(q0=None, qd0=None):
    if q0  is None: q0  = np.zeros_like(w)
    if qd0 is None: qd0 = np.zeros_like(w)
    
    t = np.arange(0, 2, 0.005)
    ylin = linsys.integrate(t, q0, qd0)
    system.q [:] = 0.0
    system.qd[:] = 0.0
    system.q [system.iFreeDOF] = q0
    system.qd[system.iFreeDOF] = qd0
    y = solve_system(system,t)

    ylin = ylin[:,:len(q0)]
    ax = plt.figure().add_subplot(111)
    ax.set_color_cycle(['r','g','b','c'])
    ax.plot(t,ylin,':',t,y,'--')
    plt.legend(('Mode 1','Mode 2','Mode 3','Mode 4'))
    return t,y,ylin
Exemplo n.º 6
0
def simulate(system, t1, dt=0.05):
    t = np.arange(0, t1, dt)
    y = solve_system(system, t)
    return t, y
Exemplo n.º 7
0
def simulate(system, t1, dt=0.05):
    t = np.arange(0, t1, dt)
    y = solve_system(system, t)
    return t,y