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
sz
as a function ofr
instead of a constant (as it is now)? $\endgroup$ – honeste_vivere Sep 29 '14 at 13:43sz[r_]:=0.26*r^0.69
and when calling it within something else, usesz[r]
, replacingr
with whatever variable is relevant (r_
is a pattern so the input need not be explicitly the letter r). $\endgroup$ – honeste_vivere Sep 30 '14 at 13:20