## Calculating the velocity needed to enter the transfer orbit

### Velocity at any point in the orbit

The first logical step would be to determine the velocity needed to enter the transfer orbit from the terrestrial orbit to the Martian orbit. This, for the reasons stated before, would coincide with the velocity at perihelion of the new heliocentric orbit.

For any elliptical orbit, the energy must be conserved and so we can equate Kinetic Energy to Gravitational Potential Energy. At any point in the orbit, when the spacecraft is at a distance r from Sun :

E=1/2*m*V^2 - G * Ms*m / r = - G*Ms*m/(2a) (1)

where m is the mass of the spacecraft, G the universal constant of Gravitation, Ms the mass of the Sun and a the semimajor axis of the orbit.

The values for these constants are :

Ms = 1.989E+30 kg
G = 6.67 E -11 N m2/kg2
dEarth = 149,600,000,000 m (average radius of Terrestrial orbit)
dMars = 227,900,000,000 m (average radius of Martian orbit)

As we have stated, the transfer orbit is such that it will constitute perihelion when leaving Earth and aphelion when arriving in Mars, so it must follow that the semimajor axis of the ellipse, which is always equal to the addition of apoapsis+periapsis divided by two will then be :

a= (dEarth+dMars)/2

If we then find V from equation (1), the mass of the spacecraft will cancel out as expected and we will arrive at :

V={2*G*Ms*[1/r - 1/(dEarth+dMars)]}^1/2 (2)

This expression will then give us, for an elliptical heliocentric orbit of semimajor axis (dEarth+dMars)/2, that is, our transfer orbit, the velocity when the spacecraft is at a distance r from the Sun.