Lambert Problem - Mission Geometry and Orbit Design
Lambert Problem - Mission Geometry and Orbit Design
1 Problem Definition
1
forms for an algorithm to solve the Lam- However E1 and E2 are unknown.
bert’s Problem. It started with the clas- Hence, one solution for this problem is
sical method devised by Gauss, attractive to normalize ∆t and a
because of its simplicity. Unfortunately it r
has two major flaws: the method is sin- 8µ
T = ∆t (1.3)
gular for a transfer angle of 180 deg and s3
the convergence rate is extremely slow,
s
when that angle is not very small. There- x2 = a − (1.4)
2a
fore [Battin and Vaughan,1983] have de-
vised an algorithm that takes away these Where,
flaws [2]. Then again, [Gooding,1990] did r1 + r2 + c
this as well, albeit in a different way, also s= (1.5)
2
providing the possibility of implementing
multiple revolutions. Although, to sim- So, equation 1.2 can be now expressed
plify, in this assignment the algorithm in the non-dimensional variables T and x
will only consider a maximum of one sin- 2(x − qz − d/y)
gle revolution. For these reasons, the T = (1.6)
Elam
algorithm developed by [Gooding, 1990]
will be applied and summarized in the In equation 1.6 the new parameters
rest of this section [3]. are all dependent of x, except q, which
As a starting point to find the Lam- follows directly from a geometry problem.
bert’s problem solution, let’s consider a √
r1 r2
generic transfer orbit, Fig 2 q= cos(∆θ/2) (1.7)
s
p
y= Elam = y(x) (1.9)
q
z= 1 − q 2 + q 2 x2 = z(x) (1.10)
2
In the implemented code the single ar-
gument arctangent function will be sub-
stitute by atan2 which uses two argu-
ments instead of one to gather informa-
tion on the signs of the inputs in order
to return the appropriate quadrant of the
computed angle. Thus, the following ex-
pression derived from the tangent half-
angle formula can be used to define atan2.
p
f 2 + g2 − g
atan2(f, g) = 2arctan
f
(1.15)
3
s/2
a= (1.21) If a < 0 (Hyperbola) ⇒
1 − x2
Then, with some more calculation 1 − ra1
E1 = acosh( ) and (1.32)
other relevant elements to characterize e
the conic can be found [4]. With the 1 − ra2
E2 = acosh( )
aid of the three new parameters presented e
bellow, the inertial velocities can be com-
In conclusion, by using the former al-
puted, accordingly to Figure 1
gorithm, the conic trajectory described
q by the satellite can be determined know-
γ= µs/2 (1.22)
ing only the two position vectors of the
planets and the time of flight. The Mat-
ρ = (r1 − r2 )/c (1.23) lab program to solve Lambert’s Problem
is in Section 4.1
q ∆θ
σ = 2 r1 r2 /c2 sin( ) (1.24) 2 Testing and Validation
2
Thus, The convergence of x is one of the re-
quirements that should be taken into ac-
count in order to validate the algorithm
V1,rad = γ[(qz −x)−ρ(qz +x)]/r1 (1.25) described in Section 1.1
s
h2
e= 1− (1.30)
µa
Other important parameter to charac-
terize the orbit is the eccentric anomaly,
which can be now calculated by using the
previous data [5].
If a > 0 (Ellipse) ⇒
Figure 4: Relative error of the semi-major
1 − ra1
E1 = acos(
e
) and (1.31) axis in % as function of the number of
iterations, considering r1 = 1AU, r2 =
1 − ra2
E2 = acos( ) 1.5AU, ∆θ = 45 deg, ∆t = 90days
e
4
Moreover, to validate the results ob- tion. Richmond, Virginia, USA,
tained by this algorithm a comparative William Bell Inc., 1998.
analysis between the Hohmann trans-
fer trajectory and the Lambert prob- [2] Richard H.Battin and Robin
lem should be performed. Considering M. Vaughan, An elegant
an Hohmann transfer between Earth Lambert Algorithm. Cam-
and Mars,2 where, r1 = 1AU, r2 = bridge,Massachusetts, USA,
1.5AU, ∆θ = 180 deg, ∆t = 225.231days Journal of Guidance, Control,
as input, the return values of the algo- and Dynamics 1984 7:6 , 662-670.
rithm used are,
[3] Jeroen Melman, Trajectory Opti-
[ a (AU) , e , E1 [ deg ] , E2 [ deg ] ] = mization for a Mission to Nep-
=1.250 ,0.200 ,0.000 ,180.000 tune and Triton - Thesis Re-
Lastly, as intended, the conic ob- port. Delft, The Netherlands, TU
tained corresponds exactly to the ellip- Delft, 18 January 2007.
tic orbit of an Hohmann transfer between
Earth and Mars, which can be considered [4] R. Noomen, Space Mission De-
as a proof of the validity of this algorithm. sign: Lambert Targeting AE4-878
V4.8. Delft, The Netherlands, TU
Delft, 2 December 2013.
3 Conclusion
In conclusion this algorithm is a good [5] Wakker K. F, Astrodynamics I
way to determine the conic that takes - Lecture notes AE4-874. Delft,
a specific time for the satellite to trans- The Netherlands, TU Delft - Fac-
fer from one planet to other. The main ulty of Aerospace Engineering,
limitation of this algorithm is that it is 2007a.
based in a two-body problem approxima-
tion. However results are good enough to [6] R.H. Gooding, A procedure for
be considered for preliminary orbit deter- the solution of Lambert’s orbital
mination. Future developments to this boundary-value problem. Farnbor-
algorithm could take into consideration ough, Hants, England Royal
the relative inclination between the two Aerospace Establishment, 9 Jan-
planets and multiple revolutions. uary 1990.
The estimated time to realize this as- [7] James F. Jordan, The application
signment was about 25 hours. of Lambert’s Theorem to the So-
lution of Interplanetary Transfer
References Problem - Technical report No.32-
521. Pasadena, California, Jet
[1] J.M.A. Danby, Fundamental of Propulsion Laboratory, 1 Febru-
Celestial Mechanics 2nd edi- ary 1964.
2
Earth and Mars orbit are assumed to be circular
5
4 Appendix
4.1 Matlab Algorithm
4.1.1 main.m
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 % LAMBERT PROBLEM SOLVER
3 % Author : R i c a r d o F i l i p e P e r e i r a Gomes
4 % S t u de n t Number : 69385
5 % Assignment 1 : main f u n c t i o n
6 % F i l e name : main .m
7 % Version 1.0
8 % 27 October 2014
9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10
11
12 %D e f a u l f v a l u e s :
13 r 1= 1 ; %[AU]
14 r 2= 1 . 5 ; %[AU]
15 t h e t a= 1 8 0 ; % [ deg ]
16 miu= 1 3 2 7 1 2 4 4 0 0 1 8 ; %[ km^ 3 . s ^ −2]
17 d_t= 2 5 5 . 2 3 1 ; %[ days ]
18
19
20 [ a , e , E1 , E2 ] = l a m b e r t ( r1 , r2 , t h e t a , miu , d_t )
21 f p r i n t f ( ’ [ a (AU) , e , E1 [ deg ] , E2 [ deg ] ] = % 3 . 3 f , % 3 . 3 f , % 3 . 3 f , % 3 . 3 f \n ’ , a , e , E1 , E2 ) ;
4.1.2 lambert.m
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 % LAMBERT PROBLEM SOLVER
3 % Author : R i c a r d o F i l i p e P e r e i r a Gomes
4 % S t u de n t Number : 69385
5 % Assignment 1 : S o l v e Lambert ’ s problem 2D: g i v e n two p l a n e t s ,
6 % d e t e r m i n e a c o n i c t h a t t a k e s a s p e c i f i c time t o
7 % transfer
8 % F i l e name : l a m b e r t .m
9 % Version 1.0
10 % 27 October 2014
11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12
13 f u n c t i o n [ a_AU, e , E1 , E2 ] = l a m b e r t ( r1 , r2 , t h e t a , miu , d_t )
14 %%%%%%%%%%%%%%%%%%%%%%% INPUTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15 % r 1 − d i s t a n c e t o p l a n e t 1 i n [AU]
16 % r 2 − d i s t a n c e t o p l a n e t 2 i n [AU]
17 % t h e t a − a r c between a r r i v a l and d e p a r t u r e i n [ deg ]
18 % miu − g r a v i t a c i o n a l p a r a m e t e r o f t h e c e n t r a l body i n [ km^ 3 . s ^ −2]
19 % d_t i s t h e time t r a n s f e r i n days
20
21 %%%%%%%%%%%%%%%%%%%%%% OUTPUTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22 % a_UA − semi−major a x i s o f t h e t r a n s f e r o r b i t [AU]
23 % e − e c c e n t r i c i t y of the t r a n s f e r o r b i t
24 % E1 − e c c e n t r i c anomaly on d e p a r t u r e [ deg ]
25 % E2 − e c c e n t r i c anomaly i n a r r i v a l [ deg ]
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27
28 t = cputime ; %a l l o w s t o know t h e time o f computation
29
30 % Convert v a r i a b l e s :
31 AU=149597871000; %Value o f one a s t r o n o m i c a l u n i t i n [m]
32 deg_r=p i / 1 8 0 ;
33 r_deg =180/ p i ;
34
35 r 1=r 1 ∗AU; %c o n v e r t i n t o [m]
36 r 2=r 2 ∗AU; %c o n v e r t i n t o [m]
37 t h e t a=t h e t a ∗ deg_r ; %c o n v e r t i n t o rad
38 miu = miu ∗ 1 e9 ; % c o n v e r t i n t o [m^ 3 . s ^ −2]
39 d_t=d_t ∗ 8 6 4 0 0 ; %Convert days i n t o s e c o n d s
6
40
41 %%%%%%%%%% Begin o f t h e a l g o r i t h m %%%%%%%%%%%%%%%%%%%%%%%%%
42
43 c=s q r t ( r 1 ^2+ r 2 ^2−2∗ r 1 ∗ r 2 ∗ c o s ( t h e t a ) ) ;
44 s =( r 1+r 2+c ) / 2 ;
45 T=s q r t ( 8 ∗ miu/ s ^ 3 ) ∗d_t ;
46
47 q=s q r t ( r 1 ∗ r 2 ) / s ∗ c o s ( t h e t a / 2 ) ; %km
48
49 % To compute t h e i n i t i a l v a l u e o f x0 i n o r d e r t o o p t i m i z e t h e
50 % a l g o t i t h m s i n c e t h e i n i t i a l v a l u e w i l l came c l o s e r t o t h e f i n a l
51 % s o l u t i o n , then f a s t e r c o n v e r g e n c e
52
53 x0 =0;
54 Elam0=x0 ^2 −1;
55 y0=s q r t ( abs ( Elam0 ) ) ;
56 z0=s q r t (1−q^2+(q∗ x0 ) ^ 2 ) ;
57 f 0=y0 ∗ ( z0−q∗ x0 ) ;
58 g0=x0 ∗ z0−q∗Elam0 ;
59 i f ( Elam0<0) %E l l i p t i c o r b i t
60 d0=atan2 ( f 0 , g0 ) ; % atan2 ( f , g )=atan ( f / g ) The p u r p o s e o f u s i n g two
61 % arguments i n s t e a d o f one i s t o g a t h e r i n f o r m a t i o n on
62 % the s i g n s of the inputs in order to return the
63 % a p p r o p r i a t e quadrant o f t h e computed a n g l e , which i s
64 % not p o s s i b l e f o r t h e s i n g l e −argument a r c t a n g e n t f u n c t i o n
65 else
66 d0=l o g ( f 0+g0 ) ; %H y p e r b o l i c o r b i t
67 end
68
69 %I n i t i a l v a l u e o f x
70 T0=2∗(x0−q∗ z0−d0 / y0 ) /Elam0 ;
71
72 i f ( T0>T)
73 x0=T0 ∗ ( T0−T) / ( 4 ∗T) ; %x0
74 else
75 x0=−(T−T0 ) / (T−T0+4) ; %x0
76 end
77
78 %D e f i n i t i o n o f t h e s i m b o l i c v a r i a b l e s b e f o r e i t e r a t e
79 syms x ;
80 Elam=x ^2 −1;
81 y=s q r t ( abs ( Elam ) ) ;
82 z=s q r t (1−q^2+(q∗x ) ^ 2 ) ;
83 f=y ∗ ( z−q∗x ) ;
84 g=x∗ z−q∗Elam ;
85
86 %C a l c u l a t e i n e r t i a l velocities
87
88 gamma=s q r t ( miu∗ s / 2 ) ;
89 rho =(r1−r 2 ) / c ;
90 sigma=2∗ s q r t ( r 1 ∗ r 2 / c ^ 2 ) ∗ s i n ( t h e t a / 2 ) ;
91
92 % I t i s used m a t l a b F u n c t i o n t o Convert s y m b o l i c e x p r e s s i o n
93 % to f u n c t i o n handle
94
95 V1_rad=gamma ∗ ( ( q∗ z−x )−rho ∗ ( q∗ z+x ) ) / r 1 ; %r a d i a l v e l o c i t i y d e p a r t u r e
96 V1_rad=m a t l a b F u n c t i o n ( V1_rad ) ;
97 V1_tan=gamma∗ sigma ∗ ( z+q∗x ) / r 1 ; %t a n g e n c i a l v e l o c i t y d e p a r t u r e
98 V1_tan=m a t l a b F u n c t i o n ( V1_tan ) ;
99
100 V2_rad=−gamma ∗ ( ( q∗ z−x )+rho ∗ ( q∗ z+x ) ) / r 1 ; %r a d i a l v e l o c i t y a r r i v a l
101 V2_rad=m a t l a b F u n c t i o n ( V2_rad ) ;
102 V2_tan=gamma∗ sigma ∗ ( z+q∗x ) / r 2 ; %t a n g e n c i a l v e l o c i t y a r r i v a l
103 V2_tan=m a t l a b F u n c t i o n ( V2_tan ) ;
104
105
106 % With syms atan2 d o e s n t work , need t o be decomposed .
107 % For t h i s i t w i l l be used t h e t a n g e n t h a l f −a n g l e f o r m u l a
108 % ATAN2(Y,X) = 2∗ atan ( ( s q r t (X^2 + Y^ 2 ) − X) /Y) ;
109 % This must be used f o r a c o m p l e t c o v e r a g e between 0 and 2 p i
7
110
111 d_e = 2∗ atan ( ( s q r t ( f ^2 + g ^ 2 ) − g ) / f ) ; %i f eliptic orbit
112 d_h=l o g ( f+g ) ; %i f h y p e r b o l i c o r b i t
113
114 % D e f i n i t i o n o f x u s i n g Newton−Rapson method
115 % x ( i +1)=x ( i )−F( x ) /F ’ ( X)
116
117 %I f t h e o r b i t i s e l l i p t i c
118 F_e=T−(2∗( x−q∗ z−d_e/y ) /Elam ) ;
119 dF_e= d i f f ( F_e ) ;
120 aux1=F_e/dF_e ;
121 aux1=m a t l a b F u n c t i o n ( aux1 ) ;
122
123 %I f t h e o r b i t i s h y p e r b o l i c
124 F_h=T−(2∗( x−q∗ z−d_h/y ) /Elam ) ;
125 dF_h= d i f f (F_h) ;
126 aux2=F_h/dF_h ;
127 aux2=m a t l a b F u n c t i o n ( aux2 ) ;
128
129
130 Elam=m a t l a b F u n c t i o n ( Elam ) ;
131 e r r o r=I n f ;
132 i =1;
133 aux ( i )=x0 ;
134 i n t e r ( i ) =1;
135
136 w h i l e e r r o r >1e −15 % Does not compromise computation time and i m p l i e s
137 % a v e r y s m a l l e r r o r f o r t h e semi−major a x i s
138 % ( s m a l l e r than a few k i l o m e t e r s )
139
140 i f ( Elam ( aux ( i ) ) <0)
141 aux ( i +1)=aux ( i )− aux1 ( aux ( i ) ) ; %E l l i p t i c O r b i t
142 else
143 aux ( i +1)=aux ( i )− aux2 ( aux ( i ) ) ; %H y p e r b o l i c o r b i t
144 end
145
146 e r r o r=abs ( aux ( i +1)−aux ( i ) ) ; %Compute i t e r a t i o n e r r o r
147
148 % Creates the v a r i a b l e s f o r f i g u r e 4 in the assignment
149 % i n t e r ( i +1)=i +1;
150 % e r r o ( i )=abs ( s /2∗1/(1 − aux ( i +1) ^ 2 ) . . .
151 % −s /2∗1/(1 − aux ( i ) ^ 2 ) ) / ( s /2∗1/(1 − aux ( i +1) ^ 2 ) ) ∗100
152
153 i=i +1;
154 end
155
156 % e r r o ( i )=abs ( s /2∗1/(1 − aux ( i ) ^ 2 ) . . .
157 % −s /2∗1/(1 − aux ( i −1) ^ 2 ) ) / ( s /2∗1/(1 − aux ( i ) ^ 2 ) ) ∗100
158 x=aux ( i ) ;
159 a= s /2∗1/(1 − x ^ 2 ) ; %Semi−major a x i s a f t e r c o n v e r g e n c e o f x
160 a_AU=a /AU; %Convert i n t o AU
161
162 V1_rad=V1_rad ( x ) ; %R a d i a l d e p a r t u r e v e l o c i t y a f t e r c o n v e r g e n c e o f x
163 V1_tan=V1_tan ( x ) ; %T a n g e n c i a l d e p a r t u r e v e l o c i t y a f t e r c o n v e r g e n c e o f x
164 V2_rad=V2_rad ( x ) ; %R a d i a l a r r i v a l v e l o c i t y a f t e r c o n v e r g e n c e o f x
165 V2_tan=V2_tan ( x ) ; %T a n g e n c i a l a r r i v a l v e l o c i t y a f t e r c o n v e r g e n c e o f x
166
167 h=V1_tan∗ r 1 ; % R e l a t i v e a n g u l a r momentum
168 e=s q r t (1 −(h ^ 2 ) / ( miu∗ a ) ) %e c c e n t r i c i t y o f t h e t r a n s f e r o r b i t
169
170 % C a l c u l u s o f t h e e c c e n t i c anomaly
171 i f a>0 % I f e l l i p s e
172 E1=a c o s ((1 − r 1 / a ) / e ) ∗ r_deg ;
173 E2=a c o s ((1 − r 2 / a ) / e ) ∗ r_deg ;
174 e l s e %I f h y p e r b o l a
175 E1=a c o s h ((1 − r 1 / a ) / e ) ∗ r_deg ;
176 E2=a c o s h ((1 − r 2 / a ) / e ) ∗ r_deg ;
177 end
178
179 %%Used t o c a l c u l a t e t h e f l i g h t path a n g l e on d e p a r t u r e and a r r i v a l p o i n t
8
180 %f p a 1=atan2 ( V1_rad , V1_tan ) ∗ r_deg ;
181 %f p a 2=atan2 ( V2_rad , V2_tan ) ∗ r_deg ;
182
183
184 % To a n a l y s e t h e r a t e o f c o n v e r g e n c e
185 % s e m i l o g y ( i n t e r , e r r o , ’ bo ’ ) ;
186 % x l a b e l ( ’ Number o f i t e r a t i o n s ’ ) % x−a x i s l a b e l
187 % y l a b e l ( ’ R e l a t i v e e r r o r f o r t h e semi−major a x i s [ % ] ’ )
188
189
190
191
192 time = cputime−t ; %h e l p f u l l t o a n a l y s e computation time