Double integral of a function (Beginners Question)



Hi,

I just started using Maxima as I wanted to check some of my calculations which I am doing in C.
I searched a lot on the web and read several tutorials, but I think this confused me more than it helped.

I tried to bring my code from C to Maxima, which leads to the following code (I simplified some parts, that's why there is e.g the Cn2(l) function)

Lambda : 0 $
Theta : 1 $
Theta_inv : 1-Theta $
W_0 : 0.0254 $
L : 50000 $
Cn2 : 1e-17 $
li : 0.005 $
lo : 5.0 $
k : 7.139983303613165e+006 $
r : 0 $
Cn2(l) := block([l:l], 1e-17) $
rho_0(k,L,Cn2) := block([k:k,L:L,Cn2:Cn2],(1.46*k^2*integrate(Cn2(l),l,0,L))^(-3/5)) $
ka2x(k,l,Cn2) := block([k:k,l:l,Cn2:Cn2],(0.38/k + 0.35*(l/(k*rho_0(k,l,Cn2)))^2)^-1) $
ka2y(k,l,Cn2) := block([k:k,l:l,Cn2:Cn2],3*k/l + 1.7/rho_0(k,l,Cn2)) $
f(kappa,li):= block([kappa:kappa,li:li],exp(-kappa^2/(3.3/li)^2)*(1+1.803*(kappa/(3.3/li))-0.254*(kappa/(3.3/li))^(7/6))) $
g(kappa,lo):= block([kappa:kappa,lo:lo],(1-exp(-kappa^2/(8*%pi/lo)^2))) $
spec(Cn2,kappa,ka2x,ka2y,li,lo):= block([Cn2:Cn2,kappa:kappa,ka2x:ka2x,ka2y:ka2y,li:li,lo:lo],0.033*Cn2*kappa^(-11/3)* f(kappa,li) * g(kappa,lo) *exp(-(kappa^2)/(ka2x))+(kappa^(11/3))/(kappa^2+ka2y^2)^(11/6)) $
integrand(kappa,Cn2,l,L,Lambda,Theta_inv,xi,k,r):= block([kappa:kappa,Cn2:Cn2,l:l,L:L,Lambda:Lambda,Theta_inv:Theta_inv,xi:xi,k:k,r:r],kappa*spec(Cn2,kappa,ka2x(k,l,Cn2),ka2y(k,l,Cn2),li,lo)*exp(-(Lambda*L*kappa^2*xi^2)/(k)) * (bessel_i(0,2*Lambda*r*kappa*xi)-cos((L*kappa^2)/k)*xi*(1-Theta_inv*xi))) $
float(integrate('(integrate('(integrand(kappa,Cn2,(1-xi)/L,L,Lambda,Theta_inv,xi,k,r)),'kappa,0,inf)),xi,0,1));

My questions are:

Do I have to use the blocks?
I read at some places that I have to and at others that all passed variables are treated as local ones.

Why do I not get a result from the last statement?
I guess I am using ' in a wrong way.

Thanks for reading,
Bernd
 		 	   		  
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969