We proceed to optimize this function of two variables a and theta, using the calculus approach of setting the respective partial derivatives with respect to a and theta equal to 0 and solving for values of a and theta which make these partial derivatives equal to 0. We use our contour plot to obtain an initial starting point for our root finding algorithm.
Input :=
Remove[theta]
Input :=
axrange[a_,theta_] = D[xrange[a,theta],a];
thetaxrange[a_,theta_] = D[xrange[a,theta],theta];
Input :=
sol = FindRoot[{axrange[a,theta]==0,
thetaxrange[a,theta]==0},
{a,2000},{theta,.6}]
Output =
{a -> 1623.8, theta -> 0.523599}
Input :=
position = {-a, Sqrt[3] a}/.sol//N
Output =
{-1623.8, 2812.5}
Input :=
distance = Sqrt[position[[1]]^2 + position[[2]]^2]/5280
Output =
0.615075
Input :=
xrange[a,theta]/.sol//N
Output =
3247.6