[Gmat-users] Optimizing trajectories with GMAT: how to understand the Vary parameters, and how to know what values to use for them?

2022-04-16 Thread Panagiotis Karakatsanis
Hello all,

I've been using GMAT in my free time to optimize trajectories, and have varied 
burn component values and spacecraft states, usually with success. The vary 
command in GMAT, with the Yukon optimizer that I am using, has the following 
parameters that can be changed:

  *   Initial value: The initial guess. I know the gradient descent 
optimization method that GMAT uses is very sensitive to initial conditions and 
so this must be feasible or reasonably close.
  *   Perturbation: The step size used to calculate the finite difference 
derivative.
  *   Max step: The maximum allowed change in the control variable during a 
single iteration of the solver.
  *   Additive scale factor: Number used to nondimensionalize the independent 
variable. This is done with the equation xn = m (xd + a), where xn is the 
non-dimensional parameter, xd is the dimensional parameter and this parameter 
is a.
  *   Multiplicative scale factor: Same as above, but it's the variable d in 
the equation.

For the initial value, I can usually see when my chosen value is feasible by 
observing the solver window or a graphical display of the orbit in different 
iterations. The max step is the most intuitive of these parameters for me, and 
by trial and error, observation of the solver window and how sensitive my 
target variables are to changes in the control variables I can usually get it 
right and get convergence. It is still partially trial and error though.

However, I do not understand the effect of the other parameters on the 
optimization. I read a bit about finite difference and 
nondimensionalization/rescaling, and I think I understand them conceptually, 
but I still don't understand what values they have to be to get an optimal 
optimization process.

This is especially a problem now because I have started to vary epochs 
(TAIModJulian usually) or time intervals (e.g. "travel for x days" and find 
optimal x, or to find optimal launch windows), and I cannot get the optimizer 
to vary them properly, even when I use a large step size. The optimizer usually 
stays close to the initial values, and eventually leads to a non-convergence 
message.

I have noticed that using large values for the two scale factors sometimes 
gives me larger step sizes and occasionally what I want, but it's still trial 
and error. As far as perturbation goes, I do not understand its influence on 
how the optimization works. Sometimes for extremely small values I get array 
dimension errors, sometimes for very large values I get similar results to if 
I'm using too large a max step size, and that's about it. I usually use 1e-5 to 
1e-7 and it seems to work most of the time.

So I guess my question is two-fold: how to understand the optimization 
parameters of GMAT and what they should be in different situations, and what 
should they be when I want GMAT to consider a wide array of possible 
trajectories with different values of control variables, especially when those 
control variables are epochs or time intervals? Is there a procedure or 
automatic method that takes into account the scale of the optimization problem 
and its sensitivity, and gives an estimate of what the optimization parameters 
should be?
Best regards,
Panagiotis Karakatsanis
___
GMAT-users mailing list
GMAT-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gmat-users


[Gmat-users] How do I prevent infinite propagation into the future, which causes the "requested epoch 95008.513478505 is not on the DE file" error?

2022-04-16 Thread Panagiotis Karakatsanis
Hello all,

I have a spacecraft I am trying to get from Earth to Mars. I use an Earth 
propagator until the SC is out of the Earth's sphere of influence, then a deep 
space propagator until Mars' sphere of influence, and then I switch to a Mars 
propagator. The only stopping conditions the propagators have are the distances 
(i.e. propagate until 924,000 km from Earth with Earth propagator, propagate 
until from 578,000 km from Mars with deep space propagator, and so on).

I want GMAT to decide how much time the spacecraft should spend in each 
propagator since I don't how many days it would take the SC to go from, e.g., 
LEO to the end of Earth's SOI, or the edge of Mars' SOI to my desired Mars 
altitude or periapsis, so the only conditions I give are the desired arrival 
date to Mars, and the distances in the trip in which it should switch 
propagators.

However, whenever there are no time-dependent stopping conditions in the 
propagators, GMAT propagates the spacecraft with what I assume is the aim of 
reducing delta-V as much as possible, leading to the trip lasting hundreds of 
years, which causes the optimizer to reach the end of GMAT's ephemeris data and 
the "PlanetaryEphem (sub)class exception: Requested epoch 95008.513478505 is 
not on the DE file" error. I sometimes get this error when I put impossible 
stopping conditions in the propagate commands, but this shouldn't be the case 
here.

I have tried adding a second stopping condition to the last propagator in the 
sequence, being the desired arrival date, or adding a non-linear constraint on 
the epoch of the SC upon arrival, but the optimizer still tries to consider 
unrealistic dates. I also tried minimizing total travel time in the cost 
function, same problem. The mission sequences from my attempts can be seen in 
this link: https://imgur.com/a/myLEmM6

Finally, I created three variables: earth_prop_time, deepspace_prop_time and 
mars_prop_time, being the amount of days spent by the spacecraft in each 
propagator. I added an "ElapsedDays" stopping condition in each propagator, 
equaling those variables, and then a constraint on their sum being my desired 
total travel time. I added some plausible initial values to the Vary commands 
for them, but it does not vary them properly, disregarding my initial values in 
one iteration and leading to a non-converge message: https://imgur.com/iPKM0M7

So, is there a way to constrain the dates that the optimizer analyzes without 
specifying time conditions in the propagators? I essentially want the same 
thing that happens when you specify a time-dependent stopping condition, like 
ElapsedDays, but with different propagators for each part of the trip. If that 
isn't possible, and I must always specify how long each part of the trip should 
be, how can I get those intervals?

PS: the commands labelled as "propagate to Mars periapsis" in the pictures are 
actually "propagate to Mars altitude", where the altitude equals the number I 
have on the constraint (500 km).

Best regards,

Panagiotis Karakatsanis
___
GMAT-users mailing list
GMAT-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gmat-users


[Gmat-users] Installing SNOPT

2022-04-16 Thread Panagiotis Karakatsanis
And my last question: I managed to get to the full version of the SNOPT 
optimizer due to being a student. How do I install it on GMAT?
___
GMAT-users mailing list
GMAT-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gmat-users