#get the data
expansion_for_R = getresult("modeExpansion","expansion for R");
Ttotal = getattribute(expansion_for_R,"T_total");
Tforward = getattribute(expansion_for_R,"T_forward");
Tbackward = getattribute(expansion_for_R,"T_backward");
Tnet = getattribute(expansion_for_R,"T_net");
#display the data
?"T total, the total reflected power is simulated to be " + num2str(-Ttotal);
?"T forward, the forward power into the original source mode is simulated to be " + num2str(Tforward);
?"T backward, the backward power into the original source mode is simulated to be " + num2str(-Tbackward);
?"T net, the total reflected power into the original source mode is simulated to be " + num2str(-Tnet);
#Confirm the result
T = getresult("transmission","T");
R = getresult("reflection","T");
y1 = getresult("y1","T");
y2 = getresult("y2","T");
z1 = getresult("z1","T");
z2 = getresult("z2","T");
gIncidence = -y1.T + y2.T - z1.T + z2.T;
#Display the confirmation
?"Transmitted power is " + num2str(T.T);
?"Reflected power is " + num2str(-R.T);
?"Unaccounted power at grazing incidence is " + num2str(gIncidence);
?"The total power in the system is " + num2str(T.T - R.T + gIncidence);