Determining optimal parameters in magnetic spacecraft stabilization via attitude feedback