Thank you so much for your help. It means a lot to me considering I've been pulling my hair out over this problem for the last month.
I redefined the incident wave vector to the following.
ux0=cos(psi)*cos(theta0)*cos(phi0)-sin(psi)*sin(phi0);
uy0=cos(psi)*cos(theta0)*sin(phi0)+sin(psi)*cos(phi0);
uz0=-cos(psi)*sin(theta0);
For the case when psi=45, theta0=0, and phi0=0, I get ux0=1/sqrt(2), uy0=1/sqrt(2), and uz0=0, so that the magnitude is 1. Thanks for the tip on that one.
I also noticed that I didn't multiply 2*pi when I defined my irreducible lattice vector in the file titled input_var.m
And I have an extra 2*pi when I defined x in the file called eps_convo.m. I have x=2*pi*GG when it should be x=GG.
And finally, when I defined the transmission diffraction efficiency, I placed a kz_c (cover wavenumber) value when it should be a kz_s (substrate wavenumber) value.
I now get a list of diffraction efficiencies that look symmetric, but I can't get them to sum up to 100%.
Have you had any luck getting this thing to work? Again, thank you so much for your time.
From one student to another,
lostinsocorro
P.S. When I define the k+G vector in the file titled kvect.m, should I normalize?
Added after 4 hours 42 minutes:
Rumpf,
In your thesis, you define Pi (Eq. 6.52) and Qi (Eq. 6.53). Within those equations, you define inv( epsilon_iz ) , epsilon_ix, and epsilon_iy. What is the difference between these three equations? Can I define them the way I did in my code??
Thanks.