This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// KSP 2D Ascent Trajectory Optimization Problem | |
#include "psopt.h" | |
////////////////////////////////////////////////////////////////////////// | |
/////////////////// Define the end point (Mayer) cost function ////////// | |
////////////////////////////////////////////////////////////////////////// | |
adouble endpoint_cost(adouble* initial_states, adouble* final_states, | |
adouble* parameters,adouble& t0, adouble& tf, | |
adouble* xad, int iphase) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [phi_out] = landingcalc( orbit_alt, landing_pe ) | |
% Returns the landing phase angle, where the ship starts in a circular | |
% orbit and drops its PE down to landing_pe. | |
% Set to true to log a bunch of details. | |
details = false; | |
% Kerbin planetary data from Wiki | |
dt = 1; | |
m = 1.0; |