示例#1
0
    def __init__(self,
                 u,
                 T,
                 K,
                 lower,
                 upper,
                 name=None,
                 info='Lag transfer function with non-windup limiter'):
        super().__init__(name=name, info=info)
        if isinstance(K, (int, float)):
            self.K = DummyValues(K)
        else:
            self.K = K
        self.u = u
        self.T = T
        self.lower = lower
        self.upper = upper

        self.x = State(info='State in lag transfer function', tex_name="x'")
        self.lim = AntiWindupLimiter(u=self.x,
                                     lower=self.lower,
                                     upper=self.upper,
                                     tex_name='lim')

        self.vars = {'x': self.x, 'lim': self.lim}
示例#2
0
文件: block.py 项目: yuanzy97/andes
    def __init__(self,
                 u,
                 T,
                 K,
                 lower,
                 upper,
                 name=None,
                 info='Lag transfer function with non-windup limiter'):
        super().__init__(name=name, info=info)
        self.u = u
        self.T = dummify(T)
        self.K = dummify(K)

        self.lower = lower
        self.upper = upper

        self.enforce_tex_name((self.T, self.K))

        self.x = State(info='State in lag transfer function',
                       tex_name="x'",
                       t_const=self.T)
        self.lim = AntiWindupLimiter(u=self.x,
                                     lower=self.lower,
                                     upper=self.upper,
                                     tex_name='lim')

        self.vars = {'x': self.x, 'lim': self.lim}
示例#3
0
文件: block.py 项目: JiweiTian/andes
    def __init__(self, u, T1, T2, lower, upper, name=None, info='Lead-lag transfer function'):
        super().__init__(name=name, info=info)
        self.T1 = T1
        self.T2 = T2
        self.u = u
        self.lower = lower
        self.upper = upper
        self.enforce_tex_name((self.T1, self.T2))

        self.x = State(info='State in lead-lag transfer function', tex_name="x'")
        self.ynl = Algeb(info='Output of lead-lag transfer function before limiter', tex_name=r'y_{nl}')
        self.y = Algeb(info='Output of lead-lag transfer function after limiter', tex_name=r'y')
        self.lim = AntiWindupLimiter(u=self.ynl, lower=self.lower, upper=self.upper)

        self.vars = {'x': self.x, 'ynl': self.ynl, 'y': self.y, 'lim': self.lim}
示例#4
0
    def __init__(self, system, config):
        TGBase.__init__(self, system, config)

        self.pref = Algeb(
            info='Reference power input',
            tex_name='P_{ref}',
            v_str='tm0 * R',
            e_str='tm0 * R - pref',
        )
        self.wd = Algeb(
            info='Generator under speed',
            unit='p.u.',
            tex_name=r'\omega_{dev}',
            v_str='0',
            e_str='u * (wref - omega) - wd',
        )
        self.pd = Algeb(info='Pref plus under speed times gain',
                        unit='p.u.',
                        tex_name="P_d",
                        v_str='tm0',
                        e_str='(wd + pref) * gain - pd')

        self.LAG_x = State(
            info='State in lag transfer function',
            tex_name=r"x'_{LAG}",
            e_str='LAG_lim_zi * (1 * pd - LAG_x) / T1',
            v_str='pd',
        )
        self.LAG_lim = AntiWindupLimiter(
            u=self.LAG_x,
            lower=self.VMIN,
            upper=self.VMAX,
            tex_name='lim_{lag}',
        )
        self.LL_x = State(
            info='State in lead-lag transfer function',
            tex_name="x'_{LL}",
            v_str='LAG_x',
            e_str='(LAG_x - LL_x) / T3',
        )
        self.LL_y = Algeb(
            info='Lead-lag Output',
            tex_name='y_{LL}',
            v_str='LAG_x',
            e_str='T2 / T3 * (LAG_x - LL_x) + LL_x - LL_y',
        )

        self.pout.e_str = '(LL_y + Dt * wd) - pout'