ocp.setObjective(obj - ocp.lookup('prop_energy', timestep=-1) / ocp.lookup('endTime')) return ocp if __name__ == '__main__': print "reading config..." # from carousel_conf import conf #from highwind_carousel_conf import conf from rawe.models.betty_conf import makeConf nk = 60 * numLoops # nk = 70 print "creating model..." conf = makeConf() dae = rawe.models.crosswind_drag(conf) dae.addP('endTime') conf['minAltitude'] = 0.5 print "setting up ocp..." nicp = 1 deg = 4 collPoly = 'RADAU' #collPoly='LEGENDRE' ocp = setupOcp(dae, conf, nk, nicp, deg, collPoly) # spawn telemetry thread callback = rawe.telemetry.startTelemetry( ocp, callbacks=[(rawe.telemetry.trajectoryCallback(toProto,
def get_steady_state_guess(): ddelta = nTurns*2*pi/(ocp._guess.lookup('endTime')) from rawekite.carouselSteadyState import getSteadyState conf_ss = makeConf() steadyState,_ = getSteadyState(carousel_dae.makeDae(conf_ss), None, ddelta, lineRadiusGuess, {}) return steadyState
ocp.bound('endTime',(0.5,4.0)) ocp.guess('endTime',1) ocp.bound('w0',(10,10)) # boundary conditions ocp.bound('sin_delta', (0,0), timestep=0, quiet=True) ocp.bound('cos_delta', (0.5,1.5), timestep=0, quiet=True) ocp.bound('cos_delta', (0.5,1.5), timestep=-1, quiet=True) return ocp if __name__=='__main__': from rawe.models.betty_conf import makeConf conf = makeConf() conf['runHomotopy'] = True conf['minAltitude'] = 0.5 nk = 75 dae = carousel_dae.makeDae(conf) dae.addP('endTime') print "setting up ocp..." ocp = setupOcp(dae,conf,nk) lineRadiusGuess = 4.0 nTurns = 1 # trajectory for homotopy def get_steady_state_guess(): ddelta = nTurns*2*pi/(ocp._guess.lookup('endTime'))
def makeDae(conf=None): if conf is None: conf = betty_conf.makeConf() return rawe.models.crosswind_drag(conf)
def makeDae(conf=None): if conf is None: conf = betty_conf.makeConf() return rawe.models.carousel(conf)