I have been now using the ephemeris table attached as an image. It gives the orbital elements of all planets on Jan 1 2000 calculated from Heliocentric-Ecliptic frame. The current planetary orbital elements can be obtained using linear interpolation.I wrote a MATLAB script in order to obtain planetary position and velocity vectors on specific dates. I also used ESA's Lambert Solver in order to obtain spacecraft heliocentric velocity vector and the periapsis and apoapsis distances. Using these distances I calculated the semi-major axis and eccentricity of the transfer ellipse to Venus. When I tried to calculate the true anomaly of the spacecraft(from the Heliocentric-Ecliptic frame) when the spacecraft enters the Venus SOI, the cosine value is exceeding value and as a result I am unable to calculate the true anomaly.Please let me know where I am going wrong!