%
% Symbolic code for DFIM with single-phase excitation
%
syms lsr msr np th lrr lrw mrw lsrll lrrll lsrl2l lrrl2l real
%
% Original model
%
a=2*pi/3;
lsr=msr*[cos(np*th) cos(np*th+a) cos(np*th-a); ...
    cos(np*th-a) cos(np*th) cos(np*th+a);
    cos(np*th+a) cos(np*th-a) cos(np*th)];
lrr=[lrw mrw mrw;mrw lrw mrw;mrw mrw lrw];
%
% Line-to-line excitation
%
lsrll=simplify(lsr*[0;1;-1])
lrrll=simplify([0 1 -1]*lrr*[0;1;-1])
% 
% Line-to-2 line excitation
%
ml2l=[1 0;-1/2 sqrt(3)/2;-1/2 -sqrt(3)/2];
lsrl2l=simplify(lsr*ml2l)
lrrl2l=simplify(ml2l'*lrr*ml2l)