pan>,[0 0 1])
plot(banb,<span class="string">'range'</span>,[-0.5 1.5;-0.5 1.5;0 0.5],<span class="string">'magCentered'</span>,true)
swplot.zoom(1.3)
E1 = banb.energy;

<span class="comment">% Keep the manual magnetic structure.</span>
Mag0 = banb.mag_str;
</pre><img vspace="5" hspace="5" src="tutorial15_03.png" style="width:560px;height:420px;" alt=""> <h2 id="5">Alternatively we optimize the magnetic structure</h2><p>First we find the propagation vector, then determine the moment directions. We find a sl