-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInitialGuess.m
More file actions
85 lines (68 loc) · 2.28 KB
/
InitialGuess.m
File metadata and controls
85 lines (68 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
%{
...
Created on 26/2/2020 17:53
This file calculates the Initial Guess for Differential Correction.
Inputs
------
1) PointLoc - Lagrange Points - Provide (1/2/3) as inputs
Outputs
--------
for all families
1) XGuess(1 and 2) - Guess for the initial point, a structure file containing
* XGuess.one - First guess
* XGuess.two - Second Guess
Note:
XGuess(1) - Guess in 3 Dimension(1 x 6) vector
XGuess(2) - Guess in 2 Dimension(1 x 4) vector
Dependencies
------------
1) GlobalData - Takes "mu,Ax1,Ax2" for calculation.
Note: Change Ax1 and Ax2 values in "Globaldata"
Reference
----------
1) Wang Sang Koon, Martin W Lo,JE Marsden, Shane D Ross - "Dynamical
Systems,the Three Body Problem and Space Mission Design", 2011
(see chapter 4 (Sec 4.4 - Step 2) for description)
...
%}
function[XGuess] = InitialGuess(PointLoc,G_var)
Ax1 = G_var.Constants.Ax1;
Ax2 = G_var.Constants.Ax2;
mu = G_var.Constants.mu;
switch PointLoc %Location of Equilibruim (L1/L2/L3)
case 1
x_e = G_var.LagPts.L1;
mu_bar = mu*abs(x_e(1) -1+mu)^-3 + (1-mu)*abs(x_e(1) + mu)^-3 ;
nu = sqrt(-0.5*(mu_bar-2-sqrt(9*mu_bar^2-8*mu_bar)));
Tau = -(nu^2 + 2*mu_bar+1)/(2*nu);
nu_y0.one = -Ax1*nu*Tau;
nu_y0.two = -Ax2*nu*Tau;
XGuess(1).one = [(x_e(1)-Ax1),0, 0, 0,nu_y0.one, 0];
XGuess(1).two = [(x_e(1)-Ax2),0, 0, 0,nu_y0.two, 0];
XGuess(2).one = [(x_e(1)-Ax1),0,0,nu_y0.one];
XGuess(2).two = [(x_e(1)-Ax2),0,0,nu_y0.two];
case 2
Ax1 = -Ax1;
Ax2 = -Ax2;
x_e = G_var.LagPts.L2;
mu_bar = mu*abs(x_e(1) -1+mu)^-3 + (1-mu)*abs(x_e(1) + mu)^-3 ;
nu = sqrt(-0.5*(mu_bar-2-sqrt(9*mu_bar^2-8*mu_bar)));
Tau = -(nu^2 + 2*mu_bar+1)/(2*nu);
nu_y0.one = -Ax1*nu*Tau;
nu_y0.two = -Ax2*nu*Tau;
XGuess(1).one = [(x_e(1)-Ax1),0, 0, 0,nu_y0.one, 0];
XGuess(1).two = [(x_e(1)-Ax2),0, 0, 0,nu_y0.two, 0];
XGuess(2).one = [(x_e(1)-Ax1),0,0,nu_y0.one];
XGuess(2).two = [(x_e(1)-Ax2),0,0,nu_y0.two];
case 3
x_e = G_var.LagPts.L3;
mu_bar = mu*abs(x_e(1) -1+mu)^-3 + (1-mu)*abs(x_e(1) + mu)^-3 ;
nu = sqrt(-0.5*(mu_bar-2-sqrt(9*mu_bar^2-8*mu_bar)));
Tau = -(nu^2 + 2*mu_bar+1)/(2*nu);
nu_y0.one = -Ax1*nu*Tau;
nu_y0.two = -Ax2*nu*Tau;
XGuess(1).one = [(x_e(1)-Ax1),0, 0, 0,nu_y0.one, 0];
XGuess(1).two = [(x_e(1)-Ax2),0, 0, 0,nu_y0.two, 0];
XGuess(2).one = [(x_e(1)-Ax1),0,0,nu_y0.one];
XGuess(2).two = [(x_e(1)-Ax2),0,0,nu_y0.two];
end