def __init__(self, xf, actvect=[], include_spring=True, \ beamparams=None): k = xf[-1]#default should be 45.0 c_beam = xf[-4] if beamparams is None: beamparams = calc_beam_props() beamparams['mu'] = beamparams['mu']*xf[-3] system_w_beam.__init__(self, beamparams, c=c_beam) self.clamp_spring = TorsionalSpringDamper({'k':k,'c':0}, \ maxsize=ms) self.spring = TorsionalSpringDamper({'k':xf[0],'c':xf[1]}, \ maxsize=ms,symname='Usp', \ symlabel='sp', \ unknownparams=['k','c']) if actvect:#an empty actvect means the actuator is unknown self.avs = AngularVelocitySource({'K':actvect[0], \ 'tau':actvect[1]}, \ maxsize=ms, \ symname='Uact', \ symlabel='act') ind=2 else: self.avs = AngularVelocitySource({'K':xf[2],'tau':xf[3]}, \ maxsize=ms, \ symname='Uact', \ symlabel='act', \ unknownparams=['K','tau']) ind=4 #self.accel_tip = accel_mass()#a rigid mass at the tip of the beam #end_ind = self.accel_tip end_ind = self.beam bodeout1={'input':'v', 'output':'atip', 'type':'abs', \ 'ind':end_ind, 'post':'accel', 'dof':0, \ 'gain':xf[-2],'gainknown':False} if include_spring: b2_ind = self.spring my_list = [self.avs, self.spring, self.clamp_spring, \ self.beam]#, self.accel_tip] else: b2_ind = self.avs my_list = [self.avs, self.beam, self.accel_tip] bodeout2={'input':'v', 'output':'th', 'type':'abs', \ 'ind':b2_ind, 'post':'', 'dof':1, \ 'gain':180.0/pi*1024.0/360.0} self.bodeout1=bodeout(**bodeout1) self.bodeout2=bodeout(**bodeout2) return TMM.TMMSystem.ClampedFreeTMMSystem.__init__(self, my_list, \ bodeouts=[self.bodeout1, self.bodeout2])
def _create_bode_outs(self): """Note that self.list and self.b2_ind must be defined before self._create_bode_outs is called. self.b2_ind is the index of the element just before the encoder measurement. If the actuator is rigid, self.b2_ind should probably be set to self.avs. If there is flexibility in the actuator, self.b2_ind should probaby be set to the torsional spring/damper following the avs.""" self._set_accel_ind() a_gain = self.params.a_gain bodeout1={'input':'v', 'output':'a', 'type':'abs', \ 'ind':self.accel_ind, 'post':'accel', 'dof':0, \ 'gain':a_gain,'gainknown':False} bodeout2={'input':'v', 'output':'theta', 'type':'abs', \ 'ind':self.b2_ind, 'post':'', 'dof':1, \ 'gain':180.0/pi*1024.0/360.0} self.bodeout1=bodeout(**bodeout1) self.bodeout2=bodeout(**bodeout2)
def __init__(self, xf, actvect=[], include_spring=True): t = xf[-1] A = w*t I = 1.0/12*w*t**3 mu = A*rho EI = E*I self.spring = TorsionalSpringDamper({'k':xf[0],'c':xf[1]}, \ maxsize=ms,symname='Usp', \ symlabel='sp', \ unknownparams=['k','c']) self.beam = SLFRBeam(beamparams={'EI':EI, 'L':L, 'mu':mu}) if actvect:#an empty actvect means the actuator is unknown self.avs = AngularVelocitySource({'K':actvect[0], \ 'tau':actvect[1]}, \ maxsize=ms, \ symname='Uact', \ symlabel='act') ind=2 else: self.avs = AngularVelocitySource({'K':xf[2],'tau':xf[3]}, \ maxsize=ms, \ symname='Uact', \ symlabel='act', \ unknownparams=['K','tau']) ind=4 self.accel_tip = accel_mass()#a rigid mass at the tip of the beam bodeout1={'input':'v', 'output':'atip', 'type':'abs', \ 'ind':self.accel_tip, 'post':'accel', 'dof':0, \ 'gain':xf[-2],'gainknown':False} if include_spring: b2_ind = self.spring my_list = [self.avs, self.spring, self.beam, self.accel_tip] else: b2_ind = self.avs my_list = [self.avs, self.beam, self.accel_tip] bodeout2={'input':'v', 'output':'th', 'type':'abs', \ 'ind':b2_ind, 'post':'', 'dof':1, \ 'gain':180.0/pi*1024.0/360.0} self.bodeout1=bodeout(**bodeout1) self.bodeout2=bodeout(**bodeout2) return TMM.TMMSystem.ClampedFreeTMMSystem.__init__(self, my_list, \ bodeouts=[self.bodeout1, self.bodeout2])
def __init__(self, K, tau, a_gain, beamparams=None, c=0.0): system_w_beam.__init__(self, beamparams, c=c) self.avs = AngularVelocitySource({'K':K,'tau':tau}, \ maxsize=ms, \ symname='Uact', \ symlabel='act', \ unknownparams=['K','tau']) bodeout1={'input':'v', 'output':'atip', 'type':'abs', \ 'ind':self.beam, 'post':'accel', 'dof':0, \ 'gain':a_gain,'gainknown':False} bodeout2={'input':'v', 'output':'th', 'type':'abs', \ 'ind':self.avs, 'post':'', 'dof':1, \ 'gain':180.0/pi*1024.0/360.0} self.bodeout1=bodeout(**bodeout1) self.bodeout2=bodeout(**bodeout2) my_list = [self.avs, self.beam] return TMM.TMMSystem.ClampedFreeTMMSystem.__init__(self, my_list, \ bodeouts=[self.bodeout1, self.bodeout2])
def __init__(self, K, tau): self.avs=AngularVelocitySource({'K':K,'tau':tau}, \ maxsize=ms, \ symname='Uact', \ symlabel='act', \ unknownparams=['K','tau']) bodeout1 = {'input':'v', 'output':'th', 'type':'abs', \ 'ind':self.avs, 'post':'', 'dof':1, \ 'gain':180.0/pi*1024.0/360.0} self.bodeout1 = bodeout(**bodeout1) return TMM.TMMSystem.ClampedFreeTMMSystem.__init__(self, [self.avs], bodeouts=[self.bodeout1])