0
$\begingroup$

tlist = Table[i, {i, 1, 10}]

tlist:{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

f = E^(-((2 t)/T));

Sum[f, {t, {tlist[[i]], {i, 1, 8}}}]

How to calculate Sum of a function over a list?

One way to do this is by defining f[t_]:= E^(-((2 t)/T)); Is there a way to do it in any other manner. Because I have to do this for various functions with a higher level of complexity.

$\endgroup$
4
$\begingroup$
Sum[f, {t, tlist}]
 E^(-20/T) + E^(-18/T) + E^(-16/T) + E^(-14/T) + E^(-12/T) + E^(-10/ T) + 
  E^(-8/T) + E^(-6/T) + E^(-4/T) + E^(-2/T)
$\endgroup$
1
  • $\begingroup$ lol thanks. Can you please close this question? $\endgroup$
    – tabi_k
    Sep 10 '20 at 6:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.