Let
f = 2 n + t
Now I want to evaluate f
given values for n
and t
. So what I've done is
Module[{n = 1, t = 5},
f]
(*f*)
What I expected to get is 7
, of course. But the output is just f
.
However,
Module[{n = 1, t = 5},
2 n + t]
(*7*)
returns a calculation.
Now I moved on to something more complicated. Let
u = a Sqrt[k^2 n1^2 - \[Beta]^2]
and
w = a Sqrt[\[Beta]^2 - k^2 n0^2]
I want to get the value of
BesselJ[1, u]/(u BesselJ[0, u]) == -(BesselK[1, w]/(w BesselK[0, w]))]
for some values of n1
, n2
and a
, as a function of Beta
and k
(and then plot a ContourPlot
).
The same trick does no calculation:
Module[{n1 = 1.4475, n2 = 1.4444, a = 5},
Evaluate[BesselJ[1, u]/(u BesselJ[0, u])] ==
Evaluate[-(BesselK[1, w]/(w BesselK[0, w]))]]
nor
Module[{n1 = 1.4475, n2 = 1.4444, a = 5},
Evaluate[BesselJ[1, u]]/Evaluate[u BesselJ[0, u]] ==
Evaluate[-(BesselK[1, w]/(w BesselK[0, w]))]]
or any other combination of wrapping Evaluate[]
around the u
and w
.
Can I use Module
at all for this kind of numerical substitution? Is Module
the advised tool?
Of course, I can set n1
, n2
and a
to these numerical values, but I good bookkeeping in my code.
Thanks very much for your help!