This is the output of the script

Example 8.8

Departure:

Planet: Earth

Year : 2040

Month : May

Day : 7

Hour : 0

Minute: 0

Second: 0

Julian day: 2466281.500

Planet position vector (km) = [-1.03902e+08 -1.09492e+08 11864.8]

Magnitude = 1.50944e+08

Planet velocity (km/s) = [21.1239 -20.6176 0.00138267]

Magnitude = 29.5179

Spacecraft velocity (km/s) = [19.3726 -28.0145 -0.931206]

Magnitude = 34.0731

v-infinity at departure (km/s) = [-1.75132 -7.39691 -0.932589]

Magnitude = 7.6584

Time of flight = 493 days

Arrival:

Planet: Mars

Year : 2041

Month : September

Day : 12

Hour : 0

Minute: 0

Second: 0

Julian day: 2466774.500

Planet position vector (km) = [8.87105e+07 2.08065e+08 2.18782e+06]

Magnitude = 1.50944e+08

Planet velocity (km/s) = [-21.3728 11.5668 0.766488]

Magnitude = 24.3141

Spacecraft Velocity (km/s) = [-23.9898 0.456169 0.496433]

Magnitude = 23.9992

v-infinity at arrival (km/s) = [-2.61699 -11.1106 -0.270056]

Magnitude = 11.4179

Orbital elements of flight trajectory:

Angular momentum (km^2/s) = 5.03387e+09

Eccentricity = 0.374728

Right ascension of the ascending node (deg) = 46.6618

Inclination to the ecliptic (deg) = 1.60102

Argument of perihelion (deg) = 134.835

True anomaly at departure (deg) = 45.0034

True anomaly at arrival (deg) = 245.419

Semimajor axis (km) = 2.22129e+08

Period (days) = 660.875

Mind that I'm still trying to reproduce the orbit on GMAT so optimization will come after.

The problem is the GMAT modelling, I've watched the GMAT tutorial "Mars B-Plane Targeting" and I'm trying to adapt it but I don't know where to start. Any help would be appreciated