Skip to content

Commit e1f382c

Browse files
committed
Merge conflicts from v1.6.5
1 parent 6b7a99d commit e1f382c

73 files changed

Lines changed: 141269 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
classdef CR3BPOrbitVariable < AbstractOrbitModelVariable
2+
%BodyFixedOrbitVariable Summary of this class goes here
3+
% Detailed explanation goes here
4+
5+
properties
6+
varObj(1,1) CR3BPOrbitStateModel = CR3BPOrbitStateModel.getDefaultOrbitState();
7+
8+
lb(1,6) double = 0;
9+
ub(1,6) double = 0;
10+
11+
varX(1,1) logical = false;
12+
varY(1,1) logical = false;
13+
varZ(1,1) logical = false;
14+
varVx(1,1) logical = false;
15+
varVy(1,1) logical = false;
16+
varVz(1,1) logical = false;
17+
end
18+
19+
methods
20+
function obj = CR3BPOrbitVariable(varObj)
21+
obj.varObj = varObj;
22+
obj.varObj.optVar = obj;
23+
24+
obj.id = rand();
25+
end
26+
27+
function x = getXsForVariable(obj)
28+
x = [];
29+
30+
if(obj.varX)
31+
x(end+1) = obj.varObj.x;
32+
end
33+
34+
if(obj.varY)
35+
x(end+1) = obj.varObj.y;
36+
end
37+
38+
if(obj.varZ)
39+
x(end+1) = obj.varObj.z;
40+
end
41+
42+
if(obj.varVx)
43+
x(end+1) = obj.varObj.vx;
44+
end
45+
46+
if(obj.varVy)
47+
x(end+1) = obj.varObj.vy;
48+
end
49+
50+
if(obj.varVz)
51+
x(end+1) = obj.varObj.vz;
52+
end
53+
end
54+
55+
function [lb, ub] = getBndsForVariable(obj)
56+
useTf = obj.getUseTfForVariable();
57+
58+
lb = obj.lb(useTf);
59+
ub = obj.ub(useTf);
60+
end
61+
62+
function [lb, ub] = getAllBndsForVariable(obj)
63+
lb = obj.lb;
64+
ub = obj.lb;
65+
end
66+
67+
function setBndsForVariable(obj, lb, ub)
68+
if(length(lb) == 6 && length(ub) == 6)
69+
obj.lb = lb;
70+
obj.ub = ub;
71+
else
72+
useTf = obj.getUseTfForVariable();
73+
74+
obj.lb(useTf) = lb;
75+
obj.ub(useTf) = ub;
76+
end
77+
end
78+
79+
function useTf = getUseTfForVariable(obj)
80+
useTf = [obj.varX obj.varY obj.varZ obj.varVx obj.varVy obj.varVz];
81+
end
82+
83+
function setUseTfForVariable(obj, useTf)
84+
obj.varX = useTf(1);
85+
obj.varY = useTf(2);
86+
obj.varZ = useTf(3);
87+
obj.varVx = useTf(4);
88+
obj.varVy = useTf(5);
89+
obj.varVz = useTf(6);
90+
end
91+
92+
function updateObjWithVarValue(obj, x)
93+
xInd = 1;
94+
95+
if(obj.varX)
96+
obj.varObj.x = x(xInd);
97+
xInd = xInd + 1;
98+
end
99+
100+
if(obj.varY)
101+
obj.varObj.y = x(xInd);
102+
xInd = xInd + 1;
103+
end
104+
105+
if(obj.varZ)
106+
obj.varObj.z = x(xInd);
107+
xInd = xInd + 1;
108+
end
109+
110+
if(obj.varVx)
111+
obj.varObj.vx = x(xInd);
112+
xInd = xInd + 1;
113+
end
114+
115+
if(obj.varVy)
116+
obj.varObj.vy = x(xInd);
117+
xInd = xInd + 1;
118+
end
119+
120+
if(obj.varVz)
121+
obj.varObj.vz = x(xInd);
122+
xInd = xInd + 1; %#ok<NASGU>
123+
end
124+
end
125+
126+
function nameStrs = getStrNamesOfVars(obj, evtNum)
127+
nameStrs = {sprintf('Event %i CR3BP Position (X)', evtNum), ...
128+
sprintf('Event %i CR3BP Position (Y)', evtNum), ...
129+
sprintf('Event %i CR3BP Position (Z)', evtNum), ...
130+
sprintf('Event %i CR3BP Velocity (X)', evtNum), ...
131+
sprintf('Event %i CR3BP Velocity (Y)', evtNum), ...
132+
sprintf('Event %i CR3BP Velocity (Z)', evtNum)};
133+
134+
nameStrs = nameStrs(obj.getUseTfForVariable());
135+
end
136+
end
137+
end
Binary file not shown.
Binary file not shown.
4.63 KB
Binary file not shown.
4.02 KB
Binary file not shown.
2.1 KB
Binary file not shown.
23.4 MB
Binary file not shown.
3.29 MB
Binary file not shown.
1.22 MB
Binary file not shown.
14.6 MB
Binary file not shown.

0 commit comments

Comments
 (0)