Heliocentric to barycentric coordinates I have a system with a central body and "particles" orbiting around it. The system is described in heliocentric coordinates. I am trying to obtain the velocity of the central body in barycentric coordinates, how do I do that ?
I have the position and velocity of the center of mass in heliocentric coordinate system.
Apparently I can't just use minus the speed of the barycenter in heliocentric coordinates.
I know I have to use the fact that in a barycentric frame the sum of all linear momentum contributions is 0.
 A: For sol (our sun) and the Earth (only) the heliocentric and barycentric coordinates are almost the same, if you intend to include all the objects in our solar system (or calculate for a different solar system) it gets far more complicated:

Using a software package such as astropy and writing a few lines of code one can easily make such calculations accurately; utilizing the CODATA2018 physical constants, correct true or mean barycentric ecliptic frames, time dilation, etc. Complete documentation explains how to make various astrophysical calculations. It is used by dozens of software programs.
A book on the subject, Spherical Astronomy by Robin Micheal Green, explains the answer to your question in just under 2 dozen pages.
A: I would work out your barycentric co-ord first, then compare them with a matrix subtraction and normalisation (Most efficient in code).
This would give you a vector multiplier to from 0-1 (percentage) per component.
Next work out the maximum velocity in each dimension given the maximum offset.
Then simply times your normalised components by this velocity.
