 1]). We plot the triangular plane magnetic
% structure.

S0 = [1 -1/2 -1/2;0 eD*sqrt(3)/2 -eD*sqrt(3)/2;0 0 0];
banb.genmagstr('mode','helical','S',S0,'k',[0 0 eH*1/7],'n',[0 0 1])
plot(banb,'range',[-0.5 1.5;-0.5 1.5;0 0.5],'magCentered',true)
swplot.zoom(1.3)
E1 = banb.energy;

% Keep the manual magnetic structure.
Mag0 = banb.mag_str;

%% Alternatively we optimize the magnetic structure
% First we find the propagation vector, then determine the moment
% directions. We find a slightly lower energy by all