1The University of Tokyo 2ISAS/JAXA 3Nagoya University
Submitted to the Journal of Guidance, Control, and Dynamics
Between two lunar flybys a spacecraft can follow legs of several distinct families. A flow matching model, trained offline on optimized legs, proposes candidates of several families in 6.6 ms, and a beam search corrects only the leading candidates and chains them into a tour in seconds on one GPU.
As commercial lunar deliveries increase opportunities for missions to the Moon, expectations are growing for low-cost missions that exploit solar-perturbed lunar flybys. A tour of such flybys chains Moon-to-Moon legs, and a tour search evaluates many candidate legs at every flyby, each requiring a costly trajectory optimization under multibody dynamics. Conventional neural networks avoid this cost but return one answer per query, whereas a leg's boundary conditions admit several solution families. This paper proposes a generative surrogate in the planar Sun–Earth circular restricted three-body problem. Given boundary conditions, a conditional flow matching model samples legs of several families as collocation vectors. Within a root-mean-square distance of 104 km, 256 samples as generated recall on average 97.5% of the legs optimized at an unseen test condition, and 256 legs retrieved from the nearest training conditions recall 13.1%. The samples are screened by their constraint residual without propagation, and a beam search corrects only the leading candidates and chains them into tours. For three benchmarks modeled on past and planned missions, the beam search builds tours in seconds on one graphics processor after offline training, finding better tours than with retrieved legs in 71 to 84% of the test cases.
A leg, the flight from one lunar flyby to the next, is computed in the planar circular restricted three-body problem of the Sun and the Earth, and a tour chains such legs. Legs are drawn here in the frame that rotates with the Sun–Earth line, with the Earth at the origin and the Sun far away on the −x side. The Moon moves on a circle around the Earth, the lunar orbit, and is massless: lunar gravity is neglected along a leg, and a flyby instantaneously rotates the velocity relative to the Moon and keeps its magnitude, v∞.
Three numbers set the condition of a leg: the speed relative to the Moon at departure, v∞,dep; the speed relative to the Moon at arrival, v∞,arr; and the solar phase θs, the angle from the direction to the Sun to the Moon at departure, counterclockwise. The surrogate returns legs for these three numbers, within the range of its database: departure v∞ of 0.4 to 2.2 km/s, arrival v∞ of 0.05 to 2.57 km/s, and flight times of at most 200 days.
Lunar flyby escapes built in this dynamical model change little when reoptimized with ephemerides and lunar gravity (Lantoine and McElrath, 2014). Below a v∞ of 0.4 km/s, however, the neglected lunar gravity becomes significant (Chen, 2023), and the capture tours on this page end below that speed.
One condition admits legs of several families. Far from the Earth the Sun's gravity reshapes the orbit, so the spacecraft can meet the Moon again at another speed without an impulse. Several solution families meet the same three numbers, v∞,dep, v∞,arr and θs, and an optimizer reaches each one only from an initial guess inside its basin of convergence, so a tour search has to optimize at least one leg per family at every flyby. A regression network returns one answer per query, about the average of the solutions when there are several.
Each video shows legs of one condition, generated by the surrogate and then corrected: a Gauss–Newton iteration moves a generated leg to a nearby leg that satisfies the discretized equations of motion. Only the cheapest leg of each family is shown. Each panel has its own scale, and the panels are ordered by lunar revolutions, then apogees, then flight time. A label such as oi 7:3 reads outbound at departure, inbound at arrival, seven apogees, three lunar revolutions. Two legs count as distinct when the root-mean-square distance between their positions, at 200 equal fractions of their flight times, exceeds 104 km. Red arrows are the impulses, with lengths in proportion to ΔV at the scale given under the video.
The surrogate is trained once offline and then answers many conditions in one query. Offline, legs are optimized on a grid of conditions, first without impulses and then with them, and two networks are trained on these legs: a flow matching model and a decoder. Online, one query takes N conditions c1, …, cN and returns K samples for each, cut by their constraint residual: how far a leg is from satisfying the discretized equations of motion and its boundary conditions. The beam search below sends one such query at every depth.
Flow matching carries noise to legs of several families. The surrogate draws Gaussian noise in a 64-dimensional latent space and integrates a learned velocity field, conditioned on (v∞,dep, v∞,arr, θs), in four Heun steps. A decoder maps each latent vector to the collocation vector of a leg (782 values at the collocation nodes of its eight phases), the boundary conditions are enforced, and the samples are cut by their constraint residual without propagation. A query of 256 samples for one condition takes 6.6 ms on one NVIDIA GH200, from drawing the noise to the residual cut (median of 100 test conditions).
A beam search expands every partial tour of a depth in one query and corrects only the leading candidates. The search extends partial tours by one leg per depth. Each partial tour is expanded toward several arrival targets, values of v∞,arr, and the candidates are ranked by a score of the goal, computed from their values as generated. At each depth it generates K samples for every arrival target of every partial tour in one query (K = 64 here), screens them by the residual cut and by checks on their generated values, corrects only the leading candidates by a Gauss–Newton iteration, and keeps at most B partial tours as the next beam (B = 32); corrected tours that meet the goal are archived and not extended. Depths are added until no partial tour can be extended within the flight-time limit. Only then are the archived tours compared: the search returns the best one whose legs pass a propagation check (each leg, integrated on its own, reaches the Moon within 100 km).
Each depth expands all partial tours of the beam in one query (the map, their legs; the chart, flyby v∞ against cumulative flight time). The goal is a flyby v∞ of 0.45 km/s or less within 365 days, from 0.80 km/s. Tours that meet it are archived as open circles; none of them is singled out until the ninth depth ends the search, and then the best, a five-leg tour found at the fifth depth (0.126 km/s), is drawn in its leg colors.
The search that found the capture tour of the first video, run again with the same code and seed. A partial tour has the color of its last leg, on the map and on the chart. At every depth the map draws, from all partial tours of the beam at once, three samples of each, chosen at random (70 of the 65,536 at the first depth), and every leading candidate, first as generated and then corrected; the chart adds up to 1,500 of the screened candidates of each depth. From the fourth depth the map moves in, since the legs of the beam then stay within 2.3 LU of the Earth.
In a test over the first three depths of 15 searches, with the beams held fixed, 41 depths had a goal-meeting tour. At 34 of them, correcting only the leading candidates, ranked as generated, gave the same best objective (within 1 mm/s) as correcting every candidate.
The cost sits offline. Building the database of optimized legs took about 110,000 core-hours, and training the two networks 4.8 and 5.7 h on one GPU. The search times on this page also leave out loading and warm-up, 23 to 28 s once per goal.
The same networks give tours for three goals. Only the settings of the search change; the networks are not retrained. The goals are benchmarks modeled on missions, not measures of their performance: a capture that lowers v∞ at the Moon without orbit insertion, as for EQUULEUS (García Yárnoz et al., 2016); an Earth escape to the characteristic energy C3 of 2.64 km²/s², from the 2022 baseline of DESTINY+ (Ozaki et al., 2022); and the largest v∞ at a flyby, a GEO-X scenario (Sekine et al., 2025). The videos show one search at each initial solar phase θs of 0°, 60°, …, 300°, with one seed for the six phases of a goal.
Symbols as in the first video; the impulse scale of the escape video is given under it. The searches ran on one NVIDIA GH200.
The samples recall 97.5% of the optimized legs at unseen conditions, where retrieved legs recall 13.1%, and give the better tour in 71 to 84 of 100 problems per goal. The baseline, retrieval, returns the optimized legs of the nearest training conditions in the database instead of generating new ones. At 300 test conditions unseen in training, 256 samples per condition recall on average 97.5% of the legs optimized there within 104 km, before any correction, whereas 256 retrieved legs recall 13.1%. An optimized leg lies a median of 810 km from the closest kept sample and 23,600 km from the closest retrieved leg.
The gap depends on the threshold: it exceeds 50 points from 1,000 to 20,000 km and falls to 2.2 points at 100,000 km, where the retrieved legs recall 96.7%. Recall measures how close a leg is as generated, not whether an optimizer could reach the solution from it. Reoptimized by SNOPT, 95.8% of the samples within 104 km of an optimized leg return to it, as estimated from 300 samples.
In the tour searches, each goal was posed at 100 initial solar phases (0, 3.6, …, 356.4°), 100 problems per goal, and each problem was searched once with the samples and once with the retrieved legs, with the same seed.
| Problems out of 100 | Capture | Escape | Largest v∞ |
|---|---|---|---|
| Surrogate better | 84 | 81 | 71 |
| Retrieval better | 15 | 19 | 27 |
| Tie (within 1 mm/s) | 1 | 0 | 2 |
One escape search with the surrogate returned no tour and is counted as retrieval better.
@misc{okada2026flow,
title = {Flow Matching-Based Surrogate Model for Solar-Perturbed Lunar Flyby Tours},
author = {Okada, Hirotaka and Ozaki, Naoya and Kawabata, Yosuke and Ikari, Satoshi and Funase, Ryu},
year = {2026},
archivePrefix = {arXiv},
eprint = {2612.03631},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2612.03631}
}