annotate private/EDB1betaoverml.m @ 18:2d5f50205527 jabuilder_int tip

Escape the trailing backslash as well
author Chris Cannam
date Tue, 30 Sep 2014 16:23:00 +0100
parents 90220f7249fc
children
rev   line source
tp@0 1 function outval = EDB1betaoverml(zvec,rs,rr,zs,zr,ny,sinnyfivec,cosnyfivec)
tp@0 2 % EDB1betaoverml - Integrand function which is called for num. int. of ED IR.
tp@0 3 % EDB1betaoverml is copied directly
tp@0 4 % into the numerical integration function EDB1quadstep for faster operation
tp@0 5 % but EDB1betaoverml is also called directly by EDbwedge1st_int.
tp@0 6 %
tp@0 7 % Uses no special functions.
tp@0 8 %
tp@0 9 % ----------------------------------------------------------------------------------------------
tp@0 10 % This file is part of the Edge Diffraction Toolbox by Peter Svensson.
tp@0 11 %
tp@0 12 % The Edge Diffraction Toolbox is free software: you can redistribute it and/or modify
tp@0 13 % it under the terms of the GNU General Public License as published by the Free Software
tp@0 14 % Foundation, either version 3 of the License, or (at your option) any later version.
tp@0 15 %
tp@0 16 % The Edge Diffraction Toolbox is distributed in the hope that it will be useful,
tp@0 17 % but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
tp@0 18 % FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
tp@0 19 %
tp@0 20 % You should have received a copy of the GNU General Public License along with the
tp@0 21 % Edge Diffraction Toolbox. If not, see <http://www.gnu.org/licenses/>.
tp@0 22 % ----------------------------------------------------------------------------------------------
tp@0 23 % Peter Svensson 20040323 (svensson@iet.ntnu.no)
tp@0 24 %
tp@0 25 % outval = EDB1betaoverml(zvec,rs,rr,zs,zr,ny,sinnyfivec,cosnyfivec);
tp@0 26
tp@0 27 ml = sqrt( (zvec-zs).^2 + rs.^2 ).*sqrt( (zvec-zr).^2 + rr.^2 );
tp@0 28
tp@0 29 %------------------------------------------------
tp@0 30 % We would have liked to use the following code:
tp@0 31 % y = (ml + (zvec-zs).*(zvec-zr))./(rs*rr);
tp@0 32 % expnyeta = real((real(sqrt(y.^2-1)) + y).^ny);
tp@0 33 % coshnyeta = 0.5*( expnyeta + 1./expnyeta);
tp@0 34 % but to save three vectors, zvec will be re-used for
tp@0 35 % y and expnyeta and coshnyeta
tp@0 36
tp@0 37 zvec = (ml + (zvec-zs).*(zvec-zr))./(rs*rr);
tp@0 38 zvec = real((real(sqrt(zvec.^2-1) + zvec)).^ny);
tp@0 39 zvec = 0.5*( zvec + 1./zvec);
tp@0 40
tp@0 41 outval = sinnyfivec(1)./(zvec - cosnyfivec(1));
tp@0 42 outval = outval + sinnyfivec(2)./(zvec - cosnyfivec(2));
tp@0 43 outval = outval + sinnyfivec(3)./(zvec - cosnyfivec(3));
tp@0 44 outval = outval + sinnyfivec(4)./(zvec - cosnyfivec(4));
tp@0 45
tp@0 46 outval = outval./ml;