I have used the following code to evaluate an integral (val) numerically
mu = 0.0173262004;(*attenuation coefficient for E = ?*) k = (mu - 0.00324543007)/(0.00324543007); h = 150.; sz = 50.; eg = 0.7; qx = 1.0; u = 1.0; the = (22.5 Pi)/180; f1 = 1/(l^2 + z^2); f2 = 1 + k mu (l^2 + z^2)^0.5; f3 = Exp[-(z - h)^2/(2 sz sz)]; f4 = Exp[-(z + h)^2/(2 sz sz)]; f5 = Exp[-mu (l^2 + z^2)]; val = NIntegrate[ 2 Pi l f1 (f2 (f3 + f4) f5), {l, 0, Infinity}, {z, 0, Infinity}] dr[r_] := 0.0404 0.00324543007 eg qx val/((2 Pi)^0.5 u r sz the) LogPlot[dr[r], {r, 0, 10000}] Now, i will be using the parameter (sz) as a function of r. For example, sz=0.26*r^0.69; How to do this? Thanking you in advance
Have fun!
szas a function ofrinstead of a constant (as it is now)? $\endgroup$sz[r_]:=0.26*r^0.69and when calling it within something else, usesz[r], replacingrwith whatever variable is relevant (r_is a pattern so the input need not be explicitly the letter r). $\endgroup$