Beispiel #1
0
 def __init__(self,params,maxsize=12,label='',):
     params['k']=atleast_1d(params['k'])
     if not params.has_key('c'):
         params['c']=zeros(shape(params['k']))
     else:
         params['c']=atleast_1d(params['c'])
     TMMElementIHT.__init__(self,'spring with actuator',params,maxsize=maxsize,label=label)
Beispiel #2
0
    def __init__(self, params={}, **kwargs):
        """Initialize the AVSwThetaFB instance.  params should have
        the following keys:

        'ks'   - spring constant (required)
        'c'    - damper coeffiecent (defaults to 0)
        'Ka'   - actuator gain (defaults to 1)
        'Gc'   - proportional feedback gain (defaults to 1)
                 (Gc can be a transfer function modelled as a
                 ratio of polynomials when passed to FORTRAN.)
        'axis' - axis about which the actuator rotates (defaults to 1)
        'tau'  - first order pole of actuator."""
        if not params.has_key("Ka"):
            params["Ka"] = 1
        if not params.has_key("axis"):
            params["axis"] = 1
        if not params.has_key("c"):
            params["c"] = 0
        if not params.has_key("Gc"):
            params["Gc"] = 1
        if shape(params["Ka"]):
            params["Ka"] = params["Ka"][0]
        if params.has_key("tau"):
            if shape(params["tau"]):
                params["tau"] = params["tau"][0]
        TMMElementIHT.__init__(self, "avsthfb", params, **kwargs)
Beispiel #3
0
 def __init__(self, params, Gc_func=Gc_PD, Gp_func=Gp_Jb, \
              symlabel='dccl', symname='Udccl',**kwargs):
     """Create a DC motor instance.  params is a
     dictionary with keys required by Gc_func and Gp_func."""
     TMMElementIHT.__init__(self,74,params,symlabel=symlabel,symname=symname,maxsize=4,**kwargs)
     self.Gc_func = Gc_func
     self.Gp_func = Gp_func
Beispiel #4
0
 def __init__(self, axis, angle, **kwargs):
     elemtype='rot'
     params={'axis':axis, \
             'angle':angle}
     TMMElementIHT.__init__(self, elemtype, params, **kwargs)
     self.axis = axis
     self.angle = angle
     self.rotmat = rotationmat(axis, angle)
Beispiel #5
0
 def __init__(self, params={}, Gth=None, Gact_func=Gact, **kwargs):
     """Initialize an instance of the AVS1_Gth_comp class, used to
     model an Angular Velocity Source with a compensator in the
     theta feedback loop. There is internal compliance in the
     actuator.  params is a dictionary with keys 'K_act', 'p_act1'.
     Gth should be a controls.TransferFunction instance."""
     self.params = params
     self.Gth = Gth
     self.Gact_func = Gact_func
     TMMElementIHT.__init__(self, "avs", params, **kwargs)
Beispiel #6
0
 def __init__(self, params={}, kp=1.0, Gact_func=Gact, **kwargs):
     """Initialize an instance of the AVS1_kp class, used to model
     an Angular Velocity Source under proportional feedback. There
     is internal compliance in the actuator.  params is a
     dictionary with keys 'K_act', 'p_act1'.  kp is the feedback
     gain on the theta feedback loop."""
     self.params = params
     self.kp = kp
     self.Gact_func = Gact_func
     TMMElementIHT.__init__(self, "avs", params, **kwargs)
Beispiel #7
0
 def __init__(self, params={}, Gact_func=Gact, **kwargs):
     """Initialize an instance of the AngularVelocitySource class.
     params is a dictionary with keys 'K', 'tau', and 'axis'.  All
     of these keys are optional.  'K' is the gain and it defaults
     to 1.  'axis' is the axis about which the actuator rotates -
     it defaults to 1.  'tau' is the pole of the first order lag of
     the actuator (i.e. if 'tau' is given and is > 0, the trasnfer
     function of the actuator will be tau/(s*(s+tau))."""
     self.params = params
     self.Gact_func = Gact_func
     TMMElementIHT.__init__(self, "avs", params, **kwargs)
Beispiel #8
0
 def __init__(self,params,**kwargs):
     """Initialize the ForcingElement.  params is a dictionary with
     only one key: 'fv', whose value is a column vector of the
     elements of the augmented column of the transfer matrix.  It
     should have only N elements (the bottom 1 is assumed)."""
     TMMElementIHT.__init__(self,'forcing',params,**kwargs)
     for n, ent  in enumerate(self.params['fv']):
         if ent == 0:
             self.symparams['fv'][n]='0'
     filtfv=[item for item in self.params['fv'] if item]
     if len(filtfv)==1:
         #there is only 1 input and symparams should just have a bunch of zeros and one 1
         self.symparams['fv']=[str(item) for item in self.params['fv']]
Beispiel #9
0
 def __init__(self, params={}, Gth=None, Ga=None, Unc_func=None, Gact_func=Gact, **kwargs):
     """Initialize an instance of the AVS1_Gth_comp_Ga class, used
     to model an Angular Velocity Source with a compensator in the
     theta feedback loop and with accelerometer feedback. There is
     internal compliance in the actuator.  params is a dictionary
     with many keys including 'K_act', 'p_act1'.  Gth and Ga should
     be controls.TransferFunction instances or at least be callable
     functions that return complex numbers for Gth(s) and Ga(s)."""
     self.params = params
     self.Gth = Gth
     self.Gact_func = Gact_func
     self.Ga = Ga
     self.Unc_func = Unc_func
     TMMElementIHT.__init__(self, "avs", params, **kwargs)
Beispiel #10
0
 def __init__(self,params, symlabel='sd', symname='Usd',**kwargs):
     """Create a TorsionalSpringDamper instance.  params is a
     dictionary with keys of 'k' and 'c'.  'k' and 'c' are lists or
     arrays if maxsize > 4.  If maxsize==8, k = [k0,k1].  If
     maxsize==12, k=[k0, k1, k2].  'c' is optional and will be set
     to zeros(shape(k)) if it is omitted.  Otherwise c=c0, [c0],
     [c0,c1], or [c0, c1, c2]."""
     if not params.has_key('k'):
         params['k']=None
     params['k']=atleast_1d(params['k'])
     if not params.has_key('c'):
         params['c']=zeros(shape(params['k']))
     else:
         params['c']=atleast_1d(params['c'])
     TMMElementIHT.__init__(self,'spring',params,symlabel=symlabel,symname=symname,**kwargs)
Beispiel #11
0
 def __init__(self, params={}, **kwargs):
     """Initialize an instance of the AngularVelocitySource class.
     params is a dictionary with keys 'K', 'tau', and 'axis'.  All
     of these keys are optional.  'K' is the gain and it defaults
     to 1.  'axis' is the axis about which the actuator rotates -
     it defaults to 1.  'tau' is the pole of the first order lag of
     the actuator (i.e. if 'tau' is given and is > 0, the trasnfer
     function of the actuator will be tau/(s*(s+tau))."""
     if not params.has_key("K"):
         params["K"] = 1
     if not params.has_key("axis"):
         params["axis"] = 1
     if shape(params["K"]):
         params["K"] = params["K"][0]
     if params.has_key("tau"):
         if shape(params["tau"]):
             params["tau"] = params["tau"][0]
         if params["tau"] <= 0:
             params.pop("tau")
     TMMElementIHT.__init__(self, "avs", params, **kwargs)
Beispiel #12
0
 def __init__(self, params={}, maxsize=12, label=""):
     if not params.has_key("K"):
         params["K"] = 1
     if not params.has_key("axis"):
         params["axis"] = 1
     if not params.has_key("c"):
         params["c"] = 0
     if not params.has_key("Gc"):
         params["Gc"] = 1
     if not params.has_key("Gx"):
         params["Gx"] = 0
     if not params.has_key("Gm"):
         params["Gm"] = 0
     if not params.has_key("Gv"):
         params["Gv"] = 0
     if shape(params["K"]):
         params["K"] = params["K"][0]
     if params.has_key("tau"):
         if shape(params["tau"]):
             params["tau"] = params["tau"][0]
     TMMElementIHT.__init__(self, "avsthfb", params, maxsize=maxsize, label=label)
Beispiel #13
0
 def __init__(self,params,symlabel='K',**kwargs):
     """Create an instance of the Spring2x2 class.  params is a
     dictionary for consistancy with other TMMElement's, but it has
     only one entry: 'k'."""
     TMMElementIHT.__init__(self,'spring',params,maxsize=2,symlabel=symlabel,**kwargs)
Beispiel #14
0
 def __init__(self,params,maxsize=4,label='',):
     TMMElementIHT.__init__(self,'spring to ground',params,maxsize=maxsize,label=label)