1 // ------------------------------------------------------------------------ //
2 // This source file is part of the 'ESA Advanced Concepts Team's //
3 // Space Mechanics Toolbox' software. //
5 // The source files are for research use only, //
6 // and are distributed WITHOUT ANY WARRANTY. Use them on your own risk. //
8 // Copyright (c) 2004-2007 European Space Agency //
9 // ------------------------------------------------------------------------ //
15 #include "Pl_Eph_An.h"
16 #include "Astro_Functions.h"
17 #include "propagateKEP.h"
19 #include "time2distance.h"
24 struct mgadsmproblem
{
25 int type
; //problem type
26 vector
<int> sequence
; //fly-by sequence (ex: 3,2,3,3,5,is Earth-Venus-Earth-Earth-Jupiter)
27 double e
; //insertion e (only in case total_DV_orbit_insertion)
28 double rp
; //insertion rp in km (only in case total_DV_orbit_insertion)
29 customobject asteroid
; //asteroid data (in case fly-by sequence has a final number = 10)
30 double AUdist
; //Distance to reach in AUs (only in case of time2AUs)
31 double DVtotal
; //Total DV allowed in km/s (only in case of time2AUs)
32 double DVonboard
; //Total DV on the spacecraft in km/s (only in case of time2AUs)
34 //Pre-allocated memory, in order to remove allocation of heap space in MGA_DSM calls
35 std::vector
<double*> r
;// = std::vector<double*>(n);
36 std::vector
<double*> v
;// = std::vector<double*>(n);
37 std::vector
<double> DV
;// = std::vector<double>(n+1);
43 vector
<double> x
, // it is the decision vector
44 mgadsmproblem
, // contains the problem specific data
47 double& J
, // J output