コード例 #1
0
# You should have received a copy of the GNU Lesser General Public License
# along with rawesome.  If not, see <http://www.gnu.org/licenses/>.

import matplotlib.pyplot as plt

import rawe
from rawe.collocation import Coll
import rocket_dae
from autogen.torocketProto import toProto
from autogen.rocket_pb2 import Trajectory

if __name__ == "__main__":
    dae = rocket_dae.makeDae()

    N = 100
    ocp = Coll(dae, nk=N, nicp=1, collPoly="RADAU", deg=4)

    endTime = 5
    ocp.setupCollocation( endTime )

    # bounds
    ocp.bound('thrust',(-1.3,0.9))
    ocp.bound('pos',(-10,10))
    ocp.bound('vel',(-10,10))
    ocp.bound('mass',(0.001,1000))

    # boundary conditions
    ocp.bound('pos',(0,0),timestep=0)
    ocp.bound('pos',(5,5),timestep=-1)

    ocp.bound('vel',(0,0),timestep=0)