def __init__(self, r, l, mass):
        self.r = r
        self.l = l

        # Mode shapes that represent the hinged rigid beam
        x = np.linspace(0, l, 40)
        shapes = np.r_['2,3,0', np.c_[0 * x, x / l, 0 * x], np.c_[0 * x, 0 * x,
                                                                  x / l]]
        rotations = np.r_['2,3,0', np.c_[0 * x, 0 * x + 1 / l, 0 * x],
                          np.c_[0 * x, 0 * x, 0 * x + 1 / l]]
        density = ones_like(x) * mass / l
        freqs = zeros(2)
        self.modes = ModalRepresentation(x, shapes, rotations, density, freqs)

        self.bearing = Hinge('bearing', [0, 0, 1])
        self.disc = RigidConnection('disc', [r, 0, 0])
        self.beam = ModalElement('beam', self.modes)

        self.bearing.add_leaf(self.disc)
        self.disc.add_leaf(self.beam)
        self.system = System(self.bearing)

        #hinge_ip.stiffness = 1e3
        #hinge_oop.stiffness = 1e3

        # Prescribed DOF accelerations
        self.system.prescribe(self.beam.istrain, acc=0.0)  # rigid beam
        self.system.prescribe(self.bearing.istrain,
                              acc=0.0)  # constant rotational speed
    def __init__(self, mode_source_file, root_length=0):
        # Modal element using data from Bladed model
        print "Loading modes from '%s'..." % mode_source_file
        self.modes = ModalRepresentation.from_Bladed(mode_source_file)

        self.bearing = Hinge('bearing', [0,0,1])
        self.offset  = RigidConnection('offset', [root_length, 0, 0])
        self.blade   = ModalElement('blade', self.modes)
        self.bearing.add_leaf(self.offset)
        self.offset.add_leaf(self.blade)
        self.system = System(self.bearing)

        # Prescribed DOF accelerations
        self.system.prescribe(self.bearing.istrain, vel=0.0, acc=0.0) # constant spin speed
Exemplo n.º 3
0
    def __init__(self, mode_source_file, root_length=0):
        # Modal element using data from Bladed model
        print "Loading modes from '%s'..." % mode_source_file
        self.modes = ModalRepresentation.from_Bladed(mode_source_file)

        self.bearing = Hinge('bearing', [0, 0, 1])
        self.offset = RigidConnection('offset', [root_length, 0, 0])
        self.blade = ModalElement('blade', self.modes)
        self.bearing.add_leaf(self.offset)
        self.offset.add_leaf(self.blade)
        self.system = System(self.bearing)

        # Prescribed DOF accelerations
        self.system.prescribe(self.bearing.istrain, vel=0.0,
                              acc=0.0)  # constant spin speed
    def __init__(self, mode_source_file, root_length=0):
        # Modal element using data from Bladed model
        print "Loading modes from '%s'..." % mode_source_file
        self.modes = ModalRepresentation.from_Bladed(mode_source_file)

        Ry = rotmat_y(-pi / 2)
        Rhb1 = rotmat_x(0 * 2 * pi / 3)
        Rhb2 = rotmat_x(1 * 2 * pi / 3)
        Rhb3 = rotmat_x(2 * 2 * pi / 3)

        self.bearing = Hinge('bearing', [1, 0, 0])
        root1 = RigidConnection('root1', root_length * np.dot(Rhb1, [0, 0, 1]),
                                dot(Rhb1, Ry))
        root2 = RigidConnection('root2', root_length * np.dot(Rhb2, [0, 0, 1]),
                                dot(Rhb2, Ry))
        root3 = RigidConnection('root3', root_length * np.dot(Rhb3, [0, 0, 1]),
                                dot(Rhb3, Ry))
        self.blade1 = ModalElement('blade1', self.modes)
        self.blade2 = ModalElement('blade2', self.modes)
        self.blade3 = ModalElement('blade3', self.modes)

        self.bearing.add_leaf(root1)
        self.bearing.add_leaf(root2)
        self.bearing.add_leaf(root3)
        root1.add_leaf(self.blade1)
        root2.add_leaf(self.blade2)
        root3.add_leaf(self.blade3)
        self.system = System(self.bearing)

        # Prescribed DOF accelerations - constant rotor speed
        self.system.prescribe(self.bearing.istrain, vel=0.0, acc=0.0)

        # setup integrator
        self.integ = Integrator(self.system, ('pos', 'vel'))
        self.integ.add_output(dynamics.LoadOutput(self.bearing.iprox))
        for b in (self.blade1, self.blade2, self.blade3):
            self.integ.add_output(dynamics.LoadOutput(b.iprox, local=True))
        for b in (self.blade1, self.blade2, self.blade3):
            self.integ.add_output(
                dynamics.CustomOutput(lambda s: b.station_positions()[-1],
                                      label="{} tip defl".format(b)))
        for b in (self.blade1, self.blade2, self.blade3):
            self.integ.add_output(
                dynamics.CustomOutput(lambda s: dot(b.Rp,
                                                    b.station_positions()[-1]),
                                      label="{} tip pos".format(b)))
    def __init__(self, mode_source_file, root_length=0):
        # Modal element using data from Bladed model
        print "Loading modes from '%s'..." % mode_source_file
        self.modes = ModalRepresentation.from_Bladed(mode_source_file)

        Ry = rotmat_y(-pi/2)
        Rhb1 = rotmat_x(0 * 2*pi/3)
        Rhb2 = rotmat_x(1 * 2*pi/3)
        Rhb3 = rotmat_x(2 * 2*pi/3)

        self.bearing = Hinge('bearing', [1,0,0])
        root1 = RigidConnection('root1', root_length*np.dot(Rhb1,[0,0,1]), dot(Rhb1,Ry))
        root2 = RigidConnection('root2', root_length*np.dot(Rhb2,[0,0,1]), dot(Rhb2,Ry))
        root3 = RigidConnection('root3', root_length*np.dot(Rhb3,[0,0,1]), dot(Rhb3,Ry))
        self.blade1 = ModalElement('blade1', self.modes)
        self.blade2 = ModalElement('blade2', self.modes)
        self.blade3 = ModalElement('blade3', self.modes)
        
        self.bearing.add_leaf(root1)
        self.bearing.add_leaf(root2)
        self.bearing.add_leaf(root3)
        root1.add_leaf(self.blade1)
        root2.add_leaf(self.blade2)
        root3.add_leaf(self.blade3)
        self.system = System(self.bearing)

        # Prescribed DOF accelerations - constant rotor speed
        self.system.prescribe(self.bearing.istrain, vel=0.0, acc=0.0)
        
        # setup integrator
        self.integ = Integrator(self.system, ('pos','vel'))
        self.integ.add_output(dynamics.LoadOutput(self.bearing.iprox))
        for b in (self.blade1, self.blade2, self.blade3):
            self.integ.add_output(dynamics.LoadOutput(b.iprox, local=True))
        for b in (self.blade1, self.blade2, self.blade3):
            self.integ.add_output(dynamics.CustomOutput(
                lambda s: b.station_positions()[-1], label="{} tip defl".format(b)))
        for b in (self.blade1, self.blade2, self.blade3):
            self.integ.add_output(dynamics.CustomOutput(
                lambda s: dot(b.Rp, b.station_positions()[-1]), label="{} tip pos".format(b)))
import matplotlib.gridspec as gridspec

import dynamics
from dynamics import System, ModalElement, Integrator
from linearisation import LinearisedSystem, ModalRepresentation
from loading import BladeLoading
import dynvis

dynamics.gravity = 0

path_damped = '/bladed/temp/parked'
path_undamped = '/bladed/temp/parked_undamped'

# Modal element using data from Bladed model
print "Loading modes from '%s'..." % path_damped
modes = ModalRepresentation.from_Bladed(path_damped+'.$pj')
print "Loading modes from '%s'..." % path_undamped
modes0 = ModalRepresentation.from_Bladed(path_undamped+'.$pj')

# Blade loading
wind_table = np.array([
    [0, 1, 2,  10], # time
    [0, 0, 0,  0 ], # x
    [0, 0, 20, 20], # y
    [0, 0, 0,  0 ], # z
])
loading = BladeLoading(modes.x, wind_table, None)

# Modal element
el = ModalElement('el', modes, loading)
system = System(el)
Exemplo n.º 7
0
from __future__ import division

import numpy as np
from scipy.linalg import eig
import matplotlib.pyplot as plt

import dynamics
from dynamics import System, ModalElement, solve_system
from linearisation import LinearisedSystem, ModalRepresentation
import dynvis

dynamics.gravity = 0

# Modal element using data from Bladed model
print "Loading modes from 'demo_a.prj'..."
modes = ModalRepresentation.from_Bladed('demo_a_simplified.prj')
el = ModalElement('el', modes)
system = System(el)

# Linearise system and find modes - should match with original
print "Linearising..."
linsys = LinearisedSystem(system)
w, v = eig(linsys.K, linsys.M)
order = np.argsort(w)
w = np.sqrt(np.real(w[order]))
f = w / 2 / np.pi
v = v[:, order]

# Check that modes come out matching what went in
assert np.allclose(modes.freqs, w), "Linearised freqs should match"
ventries = np.nonzero(abs(v) > 1e-2)[0]
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec

import dynamics
from dynamics import (System, ModalElement, Hinge,
                      RigidConnection, rotmat_x, rotmat_y, Integrator)
from linearisation import ModalRepresentation
import dynvis

dynamics.gravity = 0

bladedpath = '/bladed/gyro_effects/simpleblade_10rpm_10degs'

# Modal element using data from Bladed model
print "Loading modes from '%s'..." % bladedpath
modes = ModalRepresentation.from_Bladed(bladedpath+'.$pj')

rotorspeed = 10 * np.pi/30 # 10 rpm
overhang = 1 # 1m

# Modal element
yaw = Hinge('yaw', [0,0,1])
overhang = RigidConnection('overhang', [-overhang,0,0])
bearing = Hinge('bearing', [1,0,0],np.dot(rotmat_y(-np.pi/2), rotmat_x(-np.pi/2)))
el = ModalElement('el', modes)
yaw.add_leaf(overhang)
overhang.add_leaf(bearing)
bearing.add_leaf(el)
system = System(yaw)

# Prescribe rotation speed
Exemplo n.º 9
0
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec

import dynamics
from dynamics import (System, ModalElement, Hinge, RigidConnection, rotmat_x,
                      rotmat_y, Integrator)
from linearisation import ModalRepresentation
import dynvis

dynamics.gravity = 0

bladedpath = '/bladed/gyro_effects/simpleblade_10rpm_10degs'

# Modal element using data from Bladed model
print "Loading modes from '%s'..." % bladedpath
modes = ModalRepresentation.from_Bladed(bladedpath + '.$pj')

rotorspeed = 10 * np.pi / 30  # 10 rpm
overhang = 1  # 1m

# Modal element
yaw = Hinge('yaw', [0, 0, 1])
overhang = RigidConnection('overhang', [-overhang, 0, 0])
bearing = Hinge('bearing', [1, 0, 0],
                np.dot(rotmat_y(-np.pi / 2), rotmat_x(-np.pi / 2)))
el = ModalElement('el', modes)
yaw.add_leaf(overhang)
overhang.add_leaf(bearing)
bearing.add_leaf(el)
system = System(yaw)
Exemplo n.º 10
0
from __future__ import division

import numpy as np
from scipy.linalg import eig
import matplotlib.pyplot as plt

import dynamics
from dynamics import System, ModalElement, solve_system
from linearisation import LinearisedSystem, ModalRepresentation
import dynvis

dynamics.gravity = 0

# Modal element using data from Bladed model
print "Loading modes from 'demo_a.prj'..."
modes = ModalRepresentation.from_Bladed('demo_a_simplified.prj')
el = ModalElement('el', modes)
system = System(el)

# Linearise system and find modes - should match with original
print "Linearising..."
linsys = LinearisedSystem(system)
w,v = eig(linsys.K, linsys.M)
order = np.argsort(w)
w = np.sqrt(np.real(w[order]))
f = w/2/np.pi
v = v[:,order]

# Check that modes come out matching what went in
assert np.allclose(modes.freqs, w), "Linearised freqs should match"
ventries = np.nonzero(abs(v)>1e-2)[0]