i am new to Mathematica. Here is the situation:
I have a exponential function of n,t
that I want to calculate integral over t
for different values of n
. I want to define this integral as a function of n
. I do it with :=
and it works fine if I provide a number for n
but if I put a variable lets say x
it tries to evaluate the integral and get an expression of x
. This expression leads to precision error and the result for replacing x
with a number gives zero at the output which is not correct. This is a sample code that I use:
A[t_]=Exp[-2.005*10^8 t];
B[n_]:=Integrate[A[t] Exp[-4000 I n \[Pi] t], {t, 0, 1/2000}];
B[0]
B[x]
outputs:
General:"Exp[-100250.] is too small to represent as a normalized machine \
number; precision may be lost"
4.98753*10^-9
0. + 0. I
4.9*10^-9 even if not precise is OK for my application.
I have another function as:
C[f_, g_, n_, m_, max_] :=
ParallelSum[(f /. n :> it ) g /. n :> (m - it), {it, -max, max}];
I want to use B
and another function for example F
in C
like
F[x_]=1;
G[m_]=C[B[x/5],F[x],x,m,100];
Now for every m
I get zero instead of a very small value. The precision loss is ok for me but I would like to have some value instead of zero to work with in other parts of my application.