Hello guys, I have a problem with double Integral
length = 10*10^-6;
dz = 5*10^-7;
anzahl = length/dz;
z = N[Range[0,length,dz]];
f = Range[anzahl+1];
For[i=1,i<(anzahl+2),i++,f[[i]]=RandomReal[{-3*10^-9,3*10^-9}]];
koordinaten = Transpose[{z, f}];
finterpol = Interpolation[koordinaten];
finterpol2[zn_] := Piecewise[{{0,zn<0},{finterpol[zn],0<=zn<=length},{0,zn>length}}]
I use this Piecewise function "finterpol2[zn_]" with an interpolated function in it for the following integration. (beta, n1, n2 and k0 are constants )
Ftilde[theta_] := NIntegrate[finterpol2[zn]*Re[Exp[-I*(beta-(n2*k0*Cos[theta]))*zn]],{zn,-Infinity,Infinity}];
After that I want to do a definite integration with Ftilde ([Phi][d] is defined and outputs a constant):
alpha = \[Phi][d]^2*(n2^2-n1^2)^2*(k0^3)/(4*Pi*n1)*NIntegrate[(1/length)*Abs[Ftilde[theta]]^2,{theta,0,Pi}]
For the integral which calculates alpha I get an error message:
"NIntegrate::inumr: The integrand ([Piecewise] <<1>>) Re[E^(-I zn (1.0924610^7-5.8372810^6 Cos[theta]))] has evaluated to non-numerical values for all sampling points in the region with boundaries {{0.,5.*10^-7}}." and so on.
How can I solve this?
Thank you in advance for all the answers.