コード例 #1
0
DOSA, DOSs, DOSb = mat2ab(array([[1., 0.,  1., 66.],
                                 [1., 0., -1., 68.],
                                 [0., 1.,  1., 78.],
                                 [0., 1., -1., 82.]]))
DOS = ConSet(DOSA, DOSs, DOSb)

# define G (steady-state model)
#              R     T10sp
G = array([[-0.0575, 0.96],    # T1
           [ -0.146, 0.518]])  # T8
Gi = linalg.inv(G)

# calc AOS (from G and AIS)
lss = array([[68., 78.]]) # nominal operating point (used for model generation)
AOSA, AOSs, AOSb = AIS.outconlin(G, AIS.cscent, lss)
AOS = ConSet(AOSA, AOSs, AOSb)
#TODO: check nominal op.point use

# Calc intersection of AOS|DOS
DOSi = ConSet(*mat2ab(array([[-0.47486499,  0.88005866, -1, 36.55612415],
                             [ 1.,         0.,         -1,  68.],
                             [ 0.,        -1.,         -1, -78.]])))


# Calc additional spaces
DIS = ConSet(*DOS.outconlin(Gi, lss, AIS.cscent))
DOSn = fitset(DOSi, 'r', 'a')
DISn = ConSet(*DOSn.outconlin(Gi, lss, AIS.cscent))
DISi = ConSet(*DOSi.outconlin(Gi, lss, AIS.cscent))
DIS2 = ConSet(AIS.intersect(DIS))
コード例 #2
0
                                 [1., 0., -1., 1.5],
                                 [0., 1.,  1., 15.],
                                 [0., 1., -1., 18.]]))
DOS = ConSet(DOSA, DOSs, DOSb)

POS = ConSet(*mat2ab(array([[1., 0.,  1., 0],
                            [1., 0., -1., 1.9],
                            [0., 1.,  1., 6.],
                            [0., 1., -1., 25.]])))

# define G (steady-state model)
G = array([[-0.0476, -0.0498],
           [ 0.0111, -0.0604]])

Gi = linalg.inv(G)

# calc AOS (from G and AIS)
lss = array([[1.322, 16.4048]]) # nominal operating point (used for model generation)
AOS = ConSet(*AIS.outconlin(G, AIS.cscent, lss))
mbox = ConSet(fitmaxbox(AOS, 0.2).intersect(POS))

# -- AOS/DOS intersection
DOSi = ConSet(AOS.intersect(DOS))
DIS = ConSet(*DOS.outconlin(Gi, lss, AIS.cscent))

# -- Fitted constraints
DOSn = fitset(DOSi, 'r', 'a')
DISn = ConSet(*DOSn.outconlin(Gi, lss, AIS.cscent))
DISi = ConSet(DIS.intersect(AIS))

print DISi
コード例 #3
0
from auxfuns import mat2ab

#MAIN START =================================================================

# define AIS and DOS (equations : Ax<b)
# equations in the form Ax<b, matrix = [A s b] 
# with s the sign vector [1:>, -1:<]
AISA, AISs, AISb = mat2ab(array([[1., 0., 1.,  -0.0525],
                                 [1., 0., -1., 0.125],
                                 [0., 1.,  1., -10],
                                 [0., 1., -1., 10.]]))
AIS = ConSet(AISA, AISs, AISb) 

DOSA, DOSs, DOSb = mat2ab(array([[1., 0.,  1., -1.],
                                 [1., 0., -1.,  1.],
                                 [0., 1.,  1., -1.],
                                 [0., 1., -1.,  1.]]))
DOS = ConSet(DOSA, DOSs, DOSb)

# define G (steady-state model)
lss = array([[50., 50.]]) # nominal operating point (used for model generation)
G = array([[1, 0.0025],
           [2, 0.0025]])  # gain matrix - atm linear steady state matrix

# calc AOS (from G and AIS)
AOSA, AOSs, AOSb = AIS.outconlin(G, AIS.cscent, lss)  
AOS = ConSet(AOSA, AOSs, AOSb)
print AOS.vert

# Calc intersection of AOS|DOS
#print AOS.intersect(DOS)