Skip to content

Commit 6b7a99d

Browse files
committed
Merge branch 'v1.6.5'
2 parents 9a93706 + e6b0ae5 commit 6b7a99d

87 files changed

Lines changed: 3135 additions & 3362 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

KSPTrajectoryOptimizationTool.prj

Lines changed: 137 additions & 2 deletions
Large diffs are not rendered by default.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
classdef IntegratorEnum < matlab.mixin.SetGet
2+
%IntegratorEnum Summary of this class goes here
3+
% Detailed explanation goes here
4+
5+
enumeration
6+
ODE45('ODE45','Most of the time ode45 should be the first solver you try.');
7+
ODE113('ODE113','ode113 can be more efficient than ode45 at problems with stringent error tolerances, or when the ODE function is expensive to evaluate.');
8+
ODE23('ODE23','ode23 can be more efficient than ode45 at problems with crude tolerances, or in the presence of moderate stiffness.');
9+
ODE15s('ODE15s','Try ode15s when ode45 fails or is inefficient and you suspect that the problem is stiff.');
10+
ODE23s('ODE23s','ode23s can be more efficient than ode15s at problems with crude error tolerances. It can solve some stiff problems for which ode15s is not effective.');
11+
ODE5('ODE5','ODE5 is a fixed step size integrator. This integrator may be faster on events where the integration time is short. Integration time is highly dependent on the step size in options.')
12+
end
13+
14+
properties
15+
nameStr char = '';
16+
descStr char = '';
17+
end
18+
19+
methods
20+
function obj = IntegratorEnum(nameStr, descStr)
21+
obj.nameStr = nameStr;
22+
obj.descStr = descStr;
23+
end
24+
end
25+
26+
methods(Static)
27+
function listBoxStr = getListBoxStrs()
28+
[m,~] = enumeration('IntegratorEnum');
29+
30+
listBoxStr = {};
31+
for(i=1:length(m)) %#ok<*NO4LP>
32+
listBoxStr{end+1} = m(i).nameStr; %#ok<AGROW>
33+
end
34+
end
35+
36+
function [ind, mInd] = getIndOfListboxStr(nameStr)
37+
[m,~] = enumeration('IntegratorEnum');
38+
39+
ind = -1;
40+
for(i=1:length(m))
41+
if(strcmpi(m(i).nameStr,nameStr))
42+
ind = i;
43+
mInd = m(i);
44+
break;
45+
end
46+
end
47+
end
48+
49+
function integratorObj = getIntegratorObjFromEnum(m)
50+
switch m
51+
case IntegratorEnum.ODE113
52+
integratorObj = ODE113Integrator();
53+
54+
case IntegratorEnum.ODE15s
55+
integratorObj = ODE15sIntegrator();
56+
57+
case IntegratorEnum.ODE23
58+
integratorObj = ODE23Integrator();
59+
60+
case IntegratorEnum.ODE23s
61+
integratorObj = ODE23sIntegrator();
62+
63+
case IntegratorEnum.ODE45
64+
integratorObj = ODE45Integrator();
65+
66+
case IntegratorEnum.ODE5
67+
integratorObj = ODE5Integrator();
68+
69+
otherwise
70+
error('Unknown integrator type.');
71+
end
72+
end
73+
end
74+
end

helper_methods/ksptot_ma/launch_vehicle_designer/classes/Optimization/variables/@ApoapsisAltitudeOptimizationVariable/ApoapsisAltitudeOptimizationVariable.m renamed to helper_methods/ksptot_lvd/classes/Optimization/variables/@ApoapsisAltitudeOptimizationVariable/ApoapsisAltitudeOptimizationVariable.m

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
1-
classdef ApoapsisAltitudeOptimizationVariable < AbstractOptimizationVariable
2-
%ApoapsisAltitudeOptimizationVariable Summary of this class goes here
3-
% Detailed explanation goes here
4-
5-
properties
6-
varObj(1,1) ApoapsisAltitudeTermCondition = ApoapsisAltitudeTermCondition(0);
7-
8-
lb(1,1) double = 0;
9-
ub(1,1) double = 0;
10-
11-
useTf(1,1) = false;
12-
end
13-
14-
methods
15-
function obj = ApoapsisAltitudeOptimizationVariable(varObj)
16-
obj.varObj = varObj;
17-
obj.varObj.optVar = obj;
18-
19-
obj.id = rand();
20-
end
21-
22-
function x = getXsForVariable(obj)
23-
x = [];
24-
25-
if(obj.useTf)
26-
x = obj.varObj.apoalt;
27-
end
28-
end
29-
30-
function [lb, ub] = getBndsForVariable(obj)
31-
lb = obj.lb(obj.useTf);
32-
ub = obj.ub(obj.useTf);
33-
end
34-
35-
function [lb, ub] = getAllBndsForVariable(obj)
36-
lb = obj.lwrBnd;
37-
ub = obj.uprBnd;
38-
end
39-
40-
function setBndsForVariable(obj, lb, ub)
41-
obj.lb = lb;
42-
obj.ub = ub;
43-
end
44-
45-
function useTf = getUseTfForVariable(obj)
46-
useTf = obj.useTf;
47-
end
48-
49-
function setUseTfForVariable(obj, useTf)
50-
obj.useTf = useTf;
51-
end
52-
53-
function updateObjWithVarValue(obj, x)
54-
obj.varObj.apoalt = x;
55-
end
56-
57-
function nameStrs = getStrNamesOfVars(obj, evtNum)
58-
nameStrs = {sprintf('Event %i Apoapsis Altitude Termination Condition', evtNum)};
59-
end
60-
end
1+
classdef ApoapsisAltitudeOptimizationVariable < AbstractOptimizationVariable
2+
%ApoapsisAltitudeOptimizationVariable Summary of this class goes here
3+
% Detailed explanation goes here
4+
5+
properties
6+
varObj(1,1) ApoapsisAltitudeTermCondition = ApoapsisAltitudeTermCondition(0);
7+
8+
lb(1,1) double = 0;
9+
ub(1,1) double = 0;
10+
11+
useTf(1,1) = false;
12+
end
13+
14+
methods
15+
function obj = ApoapsisAltitudeOptimizationVariable(varObj)
16+
obj.varObj = varObj;
17+
obj.varObj.optVar = obj;
18+
19+
obj.id = rand();
20+
end
21+
22+
function x = getXsForVariable(obj)
23+
x = [];
24+
25+
if(obj.useTf)
26+
x = obj.varObj.apoalt;
27+
end
28+
end
29+
30+
function [lb, ub] = getBndsForVariable(obj)
31+
lb = obj.lb(obj.useTf);
32+
ub = obj.ub(obj.useTf);
33+
end
34+
35+
function [lb, ub] = getAllBndsForVariable(obj)
36+
lb = obj.lwrBnd;
37+
ub = obj.uprBnd;
38+
end
39+
40+
function setBndsForVariable(obj, lb, ub)
41+
obj.lb = lb;
42+
obj.ub = ub;
43+
end
44+
45+
function useTf = getUseTfForVariable(obj)
46+
useTf = obj.useTf;
47+
end
48+
49+
function setUseTfForVariable(obj, useTf)
50+
obj.useTf = useTf;
51+
end
52+
53+
function updateObjWithVarValue(obj, x)
54+
obj.varObj.apoalt = x;
55+
end
56+
57+
function nameStrs = getStrNamesOfVars(obj, evtNum)
58+
nameStrs = {sprintf('Event %i Apoapsis Altitude Termination Condition', evtNum)};
59+
end
60+
end
6161
end

helper_methods/ksptot_ma/launch_vehicle_designer/classes/Optimization/variables/@PeriapsisAltitudeOptimizationVariable/PeriapsisAltitudeOptimizationVariable.m renamed to helper_methods/ksptot_lvd/classes/Optimization/variables/@PeriapsisAltitudeOptimizationVariable/PeriapsisAltitudeOptimizationVariable.m

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
1-
classdef PeriapsisAltitudeOptimizationVariable < AbstractOptimizationVariable
2-
%PeriapsisAltitudeOptimizationVariable Summary of this class goes here
3-
% Detailed explanation goes here
4-
5-
properties
6-
varObj(1,1) PeriapsisAltitudeTermCondition = PeriapsisAltitudeTermCondition(0);
7-
8-
lb(1,1) double = 0;
9-
ub(1,1) double = 0;
10-
11-
useTf(1,1) = false;
12-
end
13-
14-
methods
15-
function obj = PeriapsisAltitudeOptimizationVariable(varObj)
16-
obj.varObj = varObj;
17-
obj.varObj.optVar = obj;
18-
19-
obj.id = rand();
20-
end
21-
22-
function x = getXsForVariable(obj)
23-
x = [];
24-
25-
if(obj.useTf)
26-
x = obj.varObj.perialt;
27-
end
28-
end
29-
30-
function [lb, ub] = getBndsForVariable(obj)
31-
lb = obj.lb(obj.useTf);
32-
ub = obj.ub(obj.useTf);
33-
end
34-
35-
function [lb, ub] = getAllBndsForVariable(obj)
36-
lb = obj.lwrBnd;
37-
ub = obj.uprBnd;
38-
end
39-
40-
function setBndsForVariable(obj, lb, ub)
41-
obj.lb = lb;
42-
obj.ub = ub;
43-
end
44-
45-
function useTf = getUseTfForVariable(obj)
46-
useTf = obj.useTf;
47-
end
48-
49-
function setUseTfForVariable(obj, useTf)
50-
obj.useTf = useTf;
51-
end
52-
53-
function updateObjWithVarValue(obj, x)
54-
obj.varObj.perialt = x;
55-
end
56-
57-
function nameStrs = getStrNamesOfVars(obj, evtNum)
58-
nameStrs = {sprintf('Event %i Periapsis Altitude Termination Condition', evtNum)};
59-
end
60-
end
1+
classdef PeriapsisAltitudeOptimizationVariable < AbstractOptimizationVariable
2+
%PeriapsisAltitudeOptimizationVariable Summary of this class goes here
3+
% Detailed explanation goes here
4+
5+
properties
6+
varObj(1,1) PeriapsisAltitudeTermCondition = PeriapsisAltitudeTermCondition(0);
7+
8+
lb(1,1) double = 0;
9+
ub(1,1) double = 0;
10+
11+
useTf(1,1) = false;
12+
end
13+
14+
methods
15+
function obj = PeriapsisAltitudeOptimizationVariable(varObj)
16+
obj.varObj = varObj;
17+
obj.varObj.optVar = obj;
18+
19+
obj.id = rand();
20+
end
21+
22+
function x = getXsForVariable(obj)
23+
x = [];
24+
25+
if(obj.useTf)
26+
x = obj.varObj.perialt;
27+
end
28+
end
29+
30+
function [lb, ub] = getBndsForVariable(obj)
31+
lb = obj.lb(obj.useTf);
32+
ub = obj.ub(obj.useTf);
33+
end
34+
35+
function [lb, ub] = getAllBndsForVariable(obj)
36+
lb = obj.lwrBnd;
37+
ub = obj.uprBnd;
38+
end
39+
40+
function setBndsForVariable(obj, lb, ub)
41+
obj.lb = lb;
42+
obj.ub = ub;
43+
end
44+
45+
function useTf = getUseTfForVariable(obj)
46+
useTf = obj.useTf;
47+
end
48+
49+
function setUseTfForVariable(obj, useTf)
50+
obj.useTf = useTf;
51+
end
52+
53+
function updateObjWithVarValue(obj, x)
54+
obj.varObj.perialt = x;
55+
end
56+
57+
function nameStrs = getStrNamesOfVars(obj, evtNum)
58+
nameStrs = {sprintf('Event %i Periapsis Altitude Termination Condition', evtNum)};
59+
end
60+
end
6161
end
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
classdef(Abstract) AbstractIntegrator < matlab.mixin.SetGet & matlab.mixin.Heterogeneous
2+
%AbstractIntegrator Summary of this class goes here
3+
% Detailed explanation goes here
4+
5+
properties
6+
7+
end
8+
9+
methods
10+
[t,y,te,ye,ie] = integrate(obj, odefun, tspan, y0, evtsFunc, odeOutputFun)
11+
12+
options = getOptions(obj)
13+
end
14+
end

helper_methods/ksptot_ma/launch_vehicle_designer/classes/Simulation/ode/@FirstOrderODE/odeOutput.m renamed to helper_methods/ksptot_lvd/classes/Simulation/ode/@FirstOrderODE/odeOutput.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
function status = odeOutput(t,y,flag, intStartTime, maxIntegrationDuration)
2-
integrationDuration = toc(intStartTime);
3-
4-
status = 0;
5-
if(integrationDuration > maxIntegrationDuration)
6-
status = 1;
7-
disp('STOP!');
8-
end
1+
function status = odeOutput(t,y,flag, intStartTime, maxIntegrationDuration)
2+
integrationDuration = toc(intStartTime);
3+
4+
status = 0;
5+
if(integrationDuration > maxIntegrationDuration)
6+
status = 1;
7+
disp('STOP!');
8+
end
99
end

0 commit comments

Comments
 (0)