# One Astrogator Tool to Rule Them All

Astrogator’s Scripting Tool is a super useful feature that allows you to interact with your Mission Control Sequence (MCS) on a deeper level. It can be used for many things, like:
• Providing initial guesses for your differential corrector or optimizer to help it converge more quickly
• Relating one independent variable over multiple segments
• Modifying the execution of the MCS
You can find more information about all of that here. But today I’ll show you an easy example of the first use case to get you started with the Scripting Tool! Suppose you want to plan a maneuver to change the Right Ascension of the Ascending Node (RAAN) of a circular orbit. In order for the maneuver to change only the RAAN (and not the inclination), it can only be executed at two possible points – where the initial and final orbits intersect each other.
Intersection of Initial and Final Orbits
The simplest Astrogator setup for this problem involves targeting the time of the burn (so that it occurs in the correct location) as well as its magnitude and direction. Sounds easy enough! Unfortunately, 200 iterations later, we find that the differential corrector is having trouble converging. So what are we to do? Well, we can dust off the old Astrodynamics book, and find that there is a simple analytical two-body solution for this type of maneuver. Yay! We can use those equations, along with the Astrogator Scripting tool, to form initial guesses of the location and magnitude of the maneuver to help our differential corrector converge more quickly! Astrogator will then refine those initial guesses using its high fidelity propagators to give us our final answer. All without leaving the comfort of our Astrogator panel – no external tools required! And if our inputs change? No problem – just update the values in the Parameters to compute new initial guesses! The Scripting Tool panel is shown below: Some highlights:
• The initial and final RAAN values are set as Parameters.
• The Object Properties panel on the left is where the Scripting Tool actually interacts with the objects in the MCS itself. For example, I assign the guesstimate for the burn location to the Target_Sequence.Propagate object’s StoppingConditions.Argument_of_Latitude.TripValue attribute and the guesstimate for the DeltaV magnitude to the Target_Sequence.Maneuver object’s ImpulsiveMnvr.Spherical.Magnitude attribute.
• The scripting part of the Scripting Tool is at the bottom. I wrote this one in Matlab, but you also have the choice of JScript or VBScript too. The Object Attributes, Calc Objects, and Parameters you have defined are all available as variables to your script.

Astrogator Scripting Tool example
In this example, with the help of the Scripting Tool, my differential corrector converged in only a handful of iterations! As you can see, the Scripting Tool is a great feature and this initial guess example only scratches the surface of what you can do with it. Want to learn more? Check out this tutorial to get started!
Posted: 3/6/2017 5:45:09 PM