Attitude stabilization of spacecraft using magnetorqers can be achieved by a proportional-derivative-like control algorithm. The gains of this algorithm are usually determined by using a trial-and-error approach within the large search space of the possible values of the gains. However, when finding the gains in this manner, only a small portion of the search space is actually explored. We prop...