Exemplo n.º 1
0
if __name__ == '__main__':
    context = zmq.Context(1)
    publisher = context.socket(zmq.PUB)
    publisher.bind("tcp://*:5563")

    print "reading config..."
    #    conf = readConfig('stingray.ini','configspec.ini')
    conf = readConfig('config.ini', 'configspec.ini')

    print "creating model..."
    dae = models.crosswind(conf)  #,extraParams=['endTime'])

    nk = 30

    # setup MHE
    mhe = Nmhe(dae, nk)

    # bounds
    mhe.bound('aileron', (-0.04, 0.04))
    mhe.bound('elevator', (-0.1, 0.3))

    mhe.bound('x', (-200, 200))
    mhe.bound('y', (-200, 200))
    if 'minAltitude' in conf:
        mhe.bound('z', (conf['minAltitude'], 200))
    else:
        mhe.bound('z', (0.5, 200))
    mhe.bound('r', (1, 200))
    mhe.bound('dr', (-30, 30))

    for e in ['e11', 'e21', 'e31', 'e12', 'e22', 'e32', 'e13', 'e23', 'e33']: