Exemplo n.º 1
0
    def __init__(self):
        ModelData.__init__(self)

        self.mode = NumParam(default='1',
                             info='Mode for applying timeseries. '
                                  '1: exact time, '
                                  '2: interpolated',
                             vrange=(1, 2),
                             )

        self.path = DataParam(mandatory=True, info='Path to timeseries xlsx file')
        self.sheet = DataParam(mandatory=True, info='Sheet name to use')
        self.fields = NumParam(mandatory=True,
                               info='comma-separated field names in timeseries data',
                               iconvert=str_list_iconv,
                               oconvert=str_list_oconv,
                               vtype=np.object,
                               )

        self.tkey = DataParam(default='t', info='Key for timestamps')

        self.model = DataParam(info='Model to link to', mandatory=True)
        self.dev = IdxParam(info='Idx of device to link to', mandatory=True)
        self.dests = NumParam(mandatory=True,
                              info='comma-separated device fields as destinations',
                              iconvert=str_list_iconv,
                              oconvert=str_list_oconv,
                              vtype=np.object,
                              )
Exemplo n.º 2
0
    def __init__(self):
        super().__init__()
        self.Vn = NumParam(
            default=110,
            info="AC voltage rating",
            unit='kV',
            non_zero=True,
            tex_name=r'V_n',
        )
        self.vmax = NumParam(
            default=1.1,
            info="Voltage upper limit",
            tex_name=r'V_{max}',
            unit='p.u.',
        )
        self.vmin = NumParam(
            default=0.9,
            info="Voltage lower limit",
            tex_name=r'V_{min}',
            unit='p.u.',
        )

        self.v0 = NumParam(
            default=1.0,
            info="initial voltage magnitude",
            non_zero=True,
            tex_name=r'V_0',
            unit='p.u.',
        )
        self.a0 = NumParam(
            default=0,
            info="initial voltage phase angle",
            unit='rad',
            tex_name=r'\theta_0',
        )

        self.xcoord = DataParam(
            default=0,
            info='x coordinate (longitude)',
        )
        self.ycoord = DataParam(
            default=0,
            info='y coordinate (latitude)',
        )

        self.area = IdxParam(
            model='Area',
            default=None,
            info="Area code",
        )
        self.zone = IdxParam(
            model='Region',
            default=None,
            info="Zone code",
        )
        self.owner = IdxParam(
            model='Owner',
            default=None,
            info="Owner code",
        )
Exemplo n.º 3
0
    def __init__(self):
        super().__init__()

        self.bus1 = IdxParam(model='Bus', info="idx of from bus")
        self.bus2 = IdxParam(model='Bus', info="idx of to bus")

        self.Sn = NumParam(default=100.0, info="Power rating", non_zero=True, tex_name=r'S_n')
        self.fn = NumParam(default=60.0, info="rated frequency", tex_name=r'f')
        self.Vn1 = NumParam(default=110.0, info="AC voltage rating", non_zero=True, tex_name=r'V_{n1}')
        self.Vn2 = NumParam(default=110.0, info="rated voltage of bus2", non_zero=True, tex_name=r'V_{n2}')

        self.r = NumParam(default=1e-8, info="line resistance", tex_name='r', z=True)
        self.x = NumParam(default=1e-8, info="line reactance", tex_name='x', z=True)
        self.b = NumParam(default=0.0, info="shared shunt susceptance", y=True)
        self.g = NumParam(default=0.0, info="shared shunt conductance", y=True)
        self.b1 = NumParam(default=0.0, info="from-side susceptance", tex_name='b_1')
        self.g1 = NumParam(default=0.0, info="from-side conductance", tex_name='g_1')
        self.b2 = NumParam(default=0.0, info="to-side susceptance", tex_name='b_2')
        self.g2 = NumParam(default=0.0, info="to-side conductance", tex_name='g_2')

        self.trans = NumParam(default=0, info="transformer branch flag")
        self.tap = NumParam(default=1.0, info="transformer branch tap ratio", tex_name='t_{ap}')
        self.phi = NumParam(default=0.0, info="transformer branch phase shift in rad", tex_name=r'\phi')

        self.owner = IdxParam(model='Owner', info="owner code")

        self.xcoord = DataParam(info="x coordinates")
        self.ycoord = DataParam(info="y coordinates")
Exemplo n.º 4
0
    def __init__(self, system, config):
        ModelData.__init__(self, three_params=False)

        self.field = DataParam(info='field name')
        self.comment = DataParam(info='information, comment, or anything')
        self.comment2 = DataParam(info='comment field 2')
        self.comment3 = DataParam(info='comment field 3')
        self.comment4 = DataParam(info='comment field 4')

        Model.__init__(self, system, config)
        self.group = 'Information'
Exemplo n.º 5
0
 def __init__(self):
     """
     DC Node data.
     """
     super().__init__()
     self.Vdcn = NumParam(
         default=100,
         info='DC voltage rating',
         unit='kV',
         non_zero=True,
         tex_name='V_{dcn}',
     )
     self.Idcn = NumParam(
         default=1,
         info='DC current rating',
         unit='kA',
         non_zero=True,
         tex_name='I_{dcn}',
     )
     self.v0 = NumParam(
         default=1.0,
         info="initial voltage magnitude",
         tex_name=r'V_{dc0}',
         unit='p.u.',
     )
     self.xcoord = DataParam(
         default=0,
         info='x coordinate (longitude)',
     )
     self.ycoord = DataParam(
         default=0,
         info='y coordinate (latitude)',
     )
     self.area = IdxParam(
         model='Area',
         default=None,
         info="Area code",
     )
     self.zone = IdxParam(
         model='Region',
         default=None,
         info="Zone code",
     )
     self.owner = IdxParam(
         model='Owner',
         default=None,
         info="Owner code",
     )
Exemplo n.º 6
0
    def __init__(self):
        ModelData.__init__(self)
        self.t = TimerParam(info='switch time for connection status',
                            mandatory=True)

        self.model = DataParam(info='model or group name of the device',
                               mandatory=True)
        self.dev = IdxParam(info='idx of the device to alter', mandatory=True)
        self.src = IdxParam(info='model source field (param or service)',
                            mandatory=True)
        self.attr = IdxParam(info='attribute (e.g., v) of the source field',
                             default='v')

        self.method = NumParam(
            info='alteration method in `+`, `-`, `*`, `/`, `=`',
            mandatory=True,
            vtype=object)
        self.amount = NumParam(
            info='the amount to apply',
            mandatory=True,
        )

        self.rand = NumParam(info='use uniform ramdom sampling', default=0)
        self.lb = NumParam(info='lower bound of random sampling', default=0)
        self.ub = NumParam(info='upper bound of random sampling', default=0)
Exemplo n.º 7
0
    def __init__(self):
        super().__init__()
        self.Sn = NumParam(default=100.0, info="Power rating", non_zero=True, tex_name=r'S_n')
        self.Vn = NumParam(default=110.0, info="AC voltage rating", non_zero=True, tex_name=r'V_n')
        self.subidx = DataParam(info='index for generators on the same bus', export=False)
        self.bus = IdxParam(model='Bus', info="idx of the installed bus")
        self.busr = IdxParam(model='Bus', info="bus idx for remote voltage control")
        self.p0 = NumParam(default=0.0, info="active power set point in system base", tex_name=r'p_0', unit='p.u.')
        self.q0 = NumParam(default=0.0, info="reactive power set point in system base", tex_name=r'q_0',
                           unit='p.u.')

        self.pmax = NumParam(default=999.0, info="maximum active power in system base",
                             tex_name=r'p_{max}', unit='p.u.')
        self.pmin = NumParam(default=-1.0, info="minimum active power in system base",
                             tex_name=r'p_{min}', unit='p.u.')
        self.qmax = NumParam(default=999.0, info="maximim reactive power in system base",
                             tex_name=r'q_{max}', unit='p.u.')
        self.qmin = NumParam(default=-999.0, info="minimum reactive power in system base",
                             tex_name=r'q_{min}', unit='p.u.')

        self.v0 = NumParam(default=1.0, info="voltage set point", tex_name=r'v_0')
        self.vmax = NumParam(default=1.4, info="maximum voltage voltage", tex_name=r'v_{max}')
        self.vmin = NumParam(default=0.6, info="minimum allowed voltage", tex_name=r'v_{min}')
        self.ra = NumParam(default=0.01, info='armature resistance', tex_name='r_a')
        self.xs = NumParam(default=0.3, info='armature reactance', tex_name='x_s')
Exemplo n.º 8
0
 def __init__(self):
     super(TogglerData, self).__init__()
     self.model = DataParam(info='Model or Group of the device to control',
                            mandatory=True)
     self.dev = IdxParam(info='idx of the device to control',
                         mandatory=True)
     self.t = TimerParam(info='switch time for connection status',
                         mandatory=True)
Exemplo n.º 9
0
    def __init__(self, *args, three_params=True, **kwargs):
        self.params = OrderedDict()
        self.num_params = OrderedDict()
        self.idx_params = OrderedDict()
        self.timer_params = OrderedDict()
        self.n = 0
        self.uid = {}

        if not hasattr(self, 'cache'):
            self.cache = ModelCache()
        self.cache.add_callback('dict', self.as_dict)
        self.cache.add_callback('df', lambda: self.as_df())
        self.cache.add_callback('dict_in', lambda: self.as_dict(True))
        self.cache.add_callback('df_in', lambda: self.as_df(vin=True))

        if three_params is True:
            self.idx = DataParam(info='unique device idx')
            self.u = NumParam(default=1,
                              info='connection status',
                              unit='bool',
                              tex_name='u')
            self.name = DataParam(info='device name')
Exemplo n.º 10
0
    def __init__(self):
        ModelData.__init__(self, three_params=False)

        self.model = DataParam(info='Name of the model', mandatory=True)
        self.varname = DataParam(info='Variable name', )
        self.dev = DataParam(info='Device name', )