Working on orbital dynamics code for my PhD in astronomy, written in rust, it can accurately calculate the positions of all asteroids/comets to within a few meters. Today I am adding a new numerical integration method which should enable me to predict orbits from observations.
Its an implementation of a pretty standard integrator used by astronomers informally called "RADAU", but it is not exactly the same RADAU you would find elsewhere. Basically it is about as good as you can typically get for multi-step integrators, tuned for speed not precision though.
Note that how the code is laid out you cant really simulate non-solar system masses. Its really aimed at massless objects in the solar system, your 3-body simulations are actually quite difficult to do given the design.
I suggest the appendix of the arxiv paper if you want to see some of the math required for solar system objects beyond simple Newtonian gravity (like Relativity corrections). I wrote that section specifically because I found it a pain in the ass to source those equations in literature.
This includes about 1.3 million known asteroids (most of the known ones), so the page is like 45mb. Consider yourself warned.
This is a plot of semi major axis, orbital eccentricity, and inclination of the orbit. The blobs are collisional groups, where a bigger rock(s) got smashed into 'families' of asteroids. Color is by the absolute magnitude H, which is a normalized, log scaled, brightness measurement. Typically smaller H means larger object.
You can see the Kirkwood gaps clearly along one axis, but as you move around you can see more complex orbital resonances. These resonances pump energy into or out of the orbit of the asteroid, causing them to leave the resonance after some time, depleting the region of phase space.
Source: I do solar system simulations for my PhD work.
One good reason to keep the raw data and orientation separate is hardware calibrations. I see some discussion here along the lines of "why not just flip the data before saving it", and one counter-argument is that you should store the flip metadata anyways, as it important to trace which hardware pixel corresponds to which stored pixel. I realize this information is not vital for everyone, but it is super useful in fields where you need to characterize the hardware performance at the pixel level (for example astronomy).
There are quite a few open source projects in astronomy, but in my experience there is a tremendous amount of code that is squirrelled away as it is difficult to reproduce and entrenches peoples positions. I have mixed feelings about this in general, as I understand the incentive structures, but I do wish in general some of the sub fields were a bit more open. I do think things are getting better in general.
Also I fully agree with the "codes" rant.
Source: working professionally in the field for 4 years.
This is really impressive! I considered buying a big harmonic drive mount for my scope, but the cost is really prohibitive.
I have experienced the pain of getting ekos/kstars/indi tools to work well on my personal scope. If you want to try driving indi devices via python I have some python code (it's not super polished, but it does enough for my needs): https://github.com/dahlend/contindi
Cool project. What prompted you to write this? Asking because EKOS already has pretty good scheduling features (I've seen, not used). Along the way I did vibe-code a TUI for controlling the INDI server running on the MeLE 4C minicomputer attached to the telescope: https://www.svendewaerhert.com/content/blog/telescope-mount/... - I switched to a headless setup using a remote indi server after having a bad experience with reliability using remote desktop in Gnome. I'll probably put this TUI on Github once I clean it up a bit.
I am a professional astronomer, and I am running a survey for asteroids. This needs to be controlled from python, as it decides every night which objects to observe.
I also heavily use Jupyter for analysis, and with this code I can take over the telescope and command it in a jupyter session, allowing me to do live data analysis.
It is neat to see some of the old work done in the field, this looks like a pretty classic treatment of the topic. It looks like they were using a fourth-order Runge-Kutta integrator, which would likely limit long term integrations accuracy (though looks sufficient for their use case). Many algorithms I have seen typically use much higher order integration methods to beat down the accumulation of numerical error.
Source: Working on my PhD in orbital mechanics of asteroids/comets, here are my open source (python/rust) orbital integration tools:
https://github.com/dahlend/kete
I'm one of those astronomers! I'm working on my PhD in orbital dynamics.
A lot of people are requesting discretionary time on telescopes trying to get observations in. The orbit will put us on the other side of the sun when 3I is nearest the sun in october, we can see it now and after it comes back out from behind the sun.
Unfortunately, right now the it is in a very crowded star field (IE, its close to the galactic plane, lots of stars in the background).
If you are interested in orbital dynamics, I have an open source rust/python package for accurate orbital calculations of asteroids/comets:
Cool to see! I spent a few years working on asteroid orbital dynamics too. What integrator are you using? Do you cover the weird stuff like Yarkovsky effects? That gets important for NEO impact risk, which is what I worked on.
I wrote a custom implementation of the Radau integrator, its been heavily modified. I have a lot of additional physics, it supports the non-gravitational models that JPL Horizons defaults to, so diurnal yarkovsky at least. I've been using it to study dust and small object dynamics, as they get pushed around by the sun a lot.
It does an OK job for impactors, but the integrator is tuned heavily for performance, and the tolerance defaults are not great for impactors.
I match jpl horizons for apophis to a few km, they have a lot more intense earth gravitational model then I care to implement, and by default I only include the 5 heaviest main belt asteroids, they have many more. That was the sweet spot for accuracy vs speed for me, overall accuracy goal is less than a few km over a decade.
The goal is to be able to handle the huge influx of new asteroids that the catalog will have due to LSST and eventually NEO Surveyor (which I worked on for 3 years). Most systems I know have been throwing hardware at the problem, I tried to make fast and efficient enough software that we can use it on a laptop for 5-10 million asteroids.
You might want to try OrdinaryDiffEq.jl. As of last summer, we have really fancy radau methods that are arbitrary order, arbitrary tolerance (see https://arxiv.org/abs/2412.14362 for the paper)
That is very impressive - getting the nongravs is a lot of work.
Anything published on your integrator and its modifications?
One nice feature of ASSIST (from what I remember, its been a while) was that I could add in more perturbers and crank up the gravitational harmonics if I wanted to. It sounds like you support that too at least for perturbers?
Final edits of a paper at the moment, aim to submit next week.
Perturbers are easy to add, though a little poorly documented at the moment. Additional physics right now are J2 of jupiter/sun/earth, and GR corrections for the sun and jupiter.
Biggest speed gain is that I have a custom SPICE reader that is multi-core friendly (I re-implemented a lot of the SPICE standard in rust), and it is used as the source for planet positions. Being able to skip planet integration leads to massive speedups.
Different goals, kete is meant to be aimed more toward observers and telescope data processing, all asteroids and comets at once on a laptop. Short term analysis (<100 years) and speed are the priority.
many things are labeled historic, though some very very tiny number will actualy retain the power to inspire as this event will
we have all dreamed of going into space to discover whatever is there, but as it turns out these interstelar objects are bringing us the only real physical evidence that we will ever get a good look at
You can approximate the orbits of basically everything in the solar system using 2-body mechanics (IE, ignore the planets). If you do this you get orbits which are elliptical (eccentricity <1), parabolic (eccentricity = 1), or hyperbolic (eccentricity>1).
If the object has an eccentricity above 1, its not bound to the solar system.
Many long period comets have eccentricity hovering near 1, often these long period comets will be on their first pass (sometimes only pass) through the solar system. These comets though usually dont get much above eccentricity of 1. The 3 interstellars we have spotted have had like 1.2 or bigger. This one is above eccentricity 6! Its moving fast.
Edit: I have heard that when the first interstellar was found it actually broke a lot of peoples code, as it was common to hard code limits to allowed eccentricities (or simply not support ecc>1 at all).
This thing actually crashed our observatory software because we were trying to calculate position at too far of time horizons where because of the eccentricity the algorithms would not converge… that sucked but has been fixed. Ready for the next one!
Oort cloud comets are so distant that they are only weakly gravitationally bound to the solar system. When they come in and we see them, they have enough energy to go back out to the extreme distances. Minor nudges from the big planets are enough to cause them to become ejected from the solar system (ecc>1). This can lead to the whole "one and done" thing.
This is an announcement from the Minor Planet Center (MPC).
They are the official international clearing house for observations of solar system objects.
The top indicates that the object has two names (this is common):
3I/ATLAS = C/2025 N1 (ATLAS)
ATLAS was the telescope that made the discovery.
The list of data are individual observations of the object by different telescopes. This observation format has been in use for a long time, but is being phased out. A row is meant to fit on a single punch card...
These observations are then used to calculate orbits, the MPC calculates the orbit as well, but this list of observations is also ingested by JPL and their Horizons service.
This one is coming in fast, it has an eccentricity of over 6 with the current fits. For point of reference, 1I and 2I have eccentricities of 1.2 and 3.3.
Right now it is mostly just a point on the sky, it is difficult to tell if it is active (like a comet) yet. If it is not active, IE: asteroid like, then the current observations put it somewhere between 8-22km in diameter (this depends on the albedo of the surface). From what we know, we would expect it to likely be made up of darker material meaning given that range of diameters it is more likely to be on the larger end. However if it is active, then the dust coming off can make it appear much larger than it is. As it comes in closer to the sun and starts to warm up it may become active (or more active if its already doing stuff).
It will not pass particularly close to any planet. It will be closest to the sun just before Halloween this year at 1.35 au, moving at 68 km/s (earth orbits at 29-30 km/s). It is also retrograde (IE, it is moving in the opposite direction of planetary motion), for an interstellar object this is basically random chance that this is the case.
The next couple of weeks will be interesting for a bunch of people I know.
Source: Working on my PhD in orbital dynamics and formerly wrote the asteroid simulation code used on several NASA missions: https://github.com/dahlend/kete
Closest approach will be October 29, 2025. It’s currently passing Jupiter’s orbit. I’m amazed that even at this speed it will take that long to get here.
“Space is big. You just won't believe how vastly, hugely, mind-bogglingly big it is.” ~Douglas Adams
Sometimes it is hard to think of big space is, especially because we tend to do that while sitting around inside (this is where we have most of our thoughts, after all). Of course space distances are nothing like the distances inside our rooms, no frame of reference.
Instead, go out to the ocean on a clear day, and observe how absurdly vast the ocean is. Just ocean, as far as you can see. Look around and realize you’ve gained absolutely nothing in terms of comprehending the vastness of space, to which the difference between your room and the most sweeping views on Earth are just totally insignificant.
An even better visualization of the size of the Solar System. It shows traveling from the Sun out to forever at the speed of light. Be prepared to spend hours watching the paint dry. I suspect traveling in space will be like war, long periods of boredom punctuated by brief moments of sheer terror.
"On this scale, the Sun, by far the largest thing in our solar system, is only a ball about two-thirds of an inch (17 millimeters) in diameter sitting on the goal line — that's about the width of a U.S. dime coin. ...
The inner planets — Mercury, Venus, Earth and Mars — are about the size of grains of sand on a football field scale. They would be dwarfed by a typical flea, which is about 3 millimeters long.
Closest to the goal line is Mercury, just under a yard from the end zone (.8 yards to be specific). ... At this scale, Mercury's diameter would be scarcely as large as the point of a needle.
Venus is next. It is 1.4 yards from the end zone. ...
On to Earth, sitting pretty on the 2-yard line. ...
Mars is on the three-yard line of our imaginary football field. ...
Jupiter remains pretty close to our end zone on the 10.5-yard line. ...
Saturn is on the field at 19 yards from the goal line. ...
Uranus ... is about 38 yards from our end zone.
Neptune is where things start to get way out. It is 60 yards from our solar goal line on the imaginary football field. ...
Tiny Pluto is much closer to the opposing team's end zone. It's about 79 yards out from the Sun ...
On this scale, our little friend Voyager 1 has left the game and is well out in the stadium parking lot or beyond."
It's illegal to mention the solar system and football without mentioning one of the greatest pieces of science fiction on the two, Jon Bois' 17776 https://en.wikipedia.org/wiki/17776
Thanks for sharing your expertise! What really bends my mind is the relative speeds involved. Reddit's /r/space has a great visual[1] which depicts it as basically going straight through our solar system, only bending slightly as it passes Sol. This is only possible if the object moving at 68 km/s is also moving sideways at 230 km/s so as to match our galactic orbit, and moving up at a mind-boggling 600 km/s (relative to CMB). This is all basic stuff of course, but something about having the object actually pass by us is making it more real than usual...
Hell, maybe it's only orbiting the galaxy at a leisurely 160 km/s, and from its perspective we're a spinning disc of chaos zipping past it for the first time in a few million years! I don't even know how I would start to analyze its orientation in relation to the galactic center, but I'll be keeping this as my little "headcannon" until proven wrong, that's for sure.
From the simulation you linked looks like it is passing closeish to the Mars... but I do know that space is big. However, I am curious of what would happen if an object of this magnitude hit mars at 90km/s.
Would be wild if a sufficiently large object with a lot of water and organic molecules hit Mars, ejected a lot of material in to Mars’ orbit to then go on to form a sufficiently large moon that tidally massaged Mars’ core to cause a dynamo to generate a sufficiently strong magnetic field to…
in a somewhat related story, I was on a beach in Costa Rica last week, watching some spider monkeys in a palm tree trying to whack open small nuts. Just then, an American family walked up the beach with two teenage boys. They didn't notice the monkeys I was watching. But one of the boys grabbed a coconut off the sand and became determined to break it open with a rock in front of his parents. So watching the monkeys and the boy simultaneously, I had the distinct feeling of how slowly evolutionary, let alone geological, processes actually move.
“We'll be saying a big hello to all intelligent lifeforms everywhere and to everyone else out there, the secret is to bang the rocks together, guys.” - The Hitchhikers Guige to the Galaxy, Douglas Adams
But are you implying that we are somehow more evolved than the monkeys? Both the human and the monkey in the story have evolved for the same amount of time since our last common ancestor.
That argument always struck me as vacuous. Dump a barrel of ball bearings on the top of a craggy hill. Wait as they all bounce around, some getting stuck in local minima and some bouncing over obstacles and covering large distances.
Would you claim that they all traveled the same distance because they all traveled for the same amount of time?
Evolutionary space is very high dimension, which makes the argument that just projecting onto the (1d) time axis is misleading even stronger.
I'm not sure more/less evolved is a meaningful concept in Darwinian terms. Organisms have a level of fitness for their environment. Perhaps you are talking about cultural evolution?
frame of reference matters,
from the center of the sun or galactic core they all most certainly moved the same distance in the same amount of time and it was much further than the hill was tall.
Sure? What is the analog to this other frame of reference in the evolution case though? Or are you just stepping out of the analogy's applicability range to show that it can be pushed too far (which is of course true of an analogy)?
A Molecular clock would be gravity in your model, when ever you called stop
all your marbles would have experienced the same amount of gravitational force.
That is the intent of "experienced the same amount of evolution" and similar.
Where I see the model flounder is; the hill provides the fitness context. You implied distance "means" more evolved, but for life it is all about making it to the next round, in your marble game how many of those furthest marbles will ever be found for the next round?
With life big changes are dangerous,
you may find yourself improved out of options.
If it would be so bad, Earth's polar regions (experiencing aurora borealis) would be inhabitable too. Earth's magnetic field is not magically neutralizing all charged particles from the Sun, just diverts them (some maybe away, but many simply towards poles).
And clearly even our mag field (and Sun's heliosphere) is not enough to shield us from those crazy cosmic rays.
It’s not worth doing because it is easier, but because all of our eggs are in one basket (planet). We know of disasters that can wipe out almost all life on a single planet. Of course, there are also disasters that can wipe out all life in one star system (and one region of the Galaxy). So, ideally we need to colonize many worlds in many different parts of the Galaxy, but baby steps. Step one is to have a sustainable population on multiple moons/planets/stations of this star system before we jump to other star systems.
Assuming it’s at the upper range of the size estimate above, and of average rocky density, the kinetic energy of the impact would be something like a 10 billion megaton nuke.
If we could steer it to hit one of Mars’s poles, it might do a bit of terraforming for us!
Where did my math go wrong? I got about 50,000 megatons. Assuming the high-end of 22km and a rocky/metallic density of 5000 kg/cubic meter (and assuming it's a cube):
kinetic energy = 1/2 m v**2 = 1/2 * size * density * v**2
= 1/2 *(22000 m)**3 * (5000 kg/m**3) * (90 m/s)**2 / (4.184E15 J/megaton)
= 52,000 megaton
If it's an icy comet then the density is more like 500 kg/cubic meter, or 1/10th that number.
I can not confirm this; the parent calculation is the correct one. I can't immediately find what your error was. (edit: It's your [km/s]—you wrote [m/s] by mistake).
(let* ((ρ ([g (cm -3)] 5))
(d ([km] 22))
(m (* ρ (expt d 3)))
(v ([km (s -1)] 90))
(ke (* 1/2 m (expt v 2)))
(kg-tnt ([J (kg -1)] 4.2e6)))
(values (/ ke kg-tnt)
(as [megaton] (/ ke kg-tnt))))
5.133857142857142e19 [KG]
5.133857142857143e10 [MEGATON]
How fast does something need to be traveling before you’d consider it to be fast? It probably weighs as much as a city and it is traveling tens of times faster than a high-velocity bullet.
It is of the same caliber as the dinosaur ending meteorite. The planet barely shrugged from it. There is suspicion that something the size of pluto has already hit mars once upon a time. And it is way more massive than this speck of cosmic dust.
Thanks for sharing this info. Does "eccentricity" refer to the orbit, or the shape of the object?
For ‘Oumuamua in 2017, some method was used to determine its shape, which is (apparently) remarkably elongated. Is it possible to determine the elongation of the new object?
Eccentricity refers to the shape of the orbit, derivable from the highest and lowest distances in the orbit of the orbiting body (there's actually a bunch of ways to calculate it that are mathematically equivalent). It's related to modeling orbits as conic sections. An eccentricity of 0 is a perfect circle, <1 is a normal elliptical orbit, >=1 is an escaping trajectory.
For example, Earth's orbit around the sun is ~0.0167, Pluto's is 0.248.
To add what others said, eccentricity is also a way to tell if the object is captured or not. 0 means perfectly circular orbit, >=1 means escape, >=2 means hyperbolic.
Are you able to calculate whether, by any chance, it will come close to any of the NASA probes around Jupiter, Mars, Venus, etc...? What is its closest approach to the JWST?
The closest it will come is Mars, but when I say close these are quite literally astronomical distances, about 0.2 au from Mars. This is about 75x further than the moon is from the Earth.
If it is an inactive rock, then we will not see it as any more than a point of light during its visit.
An object (depending on consistency) of about 100m is enough to wipe out a city and do enough damage to the environment. Something of 8-20km is in the same category as what wiped out the dinosaurs (10-15km).
It is also a factor of where our surveys look on the sky. A lot of asteroid surveys have biases to look at the plane of our solar system (since this is where a lot of asteroids are).
It is probably random chance, however there may be some biases from where they come from on the sky (I know people who work on that, but I don't know much about it).
N=3 does not provide very robust statistics yet, give us another decade or two.
Not terribly related but I got curious, the ELT has a reported angular resolution of 0.005 arcseconds. The sad state of public trust has resulted in many people no longer accepting the US landed on the moon at all. Tossing the question of what it would take to resolve the lunar landing sites into a LLM gives a broad requirement of 0.0005 arcseconds. Even still, you could never "prove" it to most people unless it's glass the entire way with no "hoax generating" computers involved.
I can't believe that all those super-intelligent astronomers, who spend hours on their own in the dark, couldn't come up with a better name than 'Extremely Large Telescope'. ;0)
Huh. It looks like on 10/2 it will make its closest pass to a planet, Mars, and on that date it also is in a straight line with Mars, Mercury and the sun, while Earth and Venus are roughly opposite each other. Do you know if this sim accounts for solar or martian gravity diverting its trajectory?
This orbit visualization uses a simple 2 body approximation, so only the sun. This is because unless an object has a VERY close approach to a planet the two body approximation is more then enough for this style of visualization.
I did a full proper n-body integration and it is not visually different than this.
https://github.com/dahlend/kete
I'm working on modeling the motion of observed dust particles coming off of comet 67P, here is are some example 3d plots:
Example of rocks ejected from one position and their possible motions: https://dahlend.github.io/67p_beta_dust.html
Trying to determine possible orbits from a set of observations (the straight lines): https://dahlend.github.io/67p_dust_orbit.html
Shout out to pyvista for making these great 3d plots possible, a little less ergonomic than matplotlib, but it can export directly to html.
reply