I have a summation function q[i]*f[j]
which runs over i
and j
of same length with different limits. Following I provided an example, where q
is in list form:
q={2,7,11};
and f[j]
runs over -1, 0 and 1
.
The output of this summation function should be:
ouptput= 2*f[-1]+7*f[0]+11*f[1];
So far, I have been able to iterate f[j]
over j
and using Sum
to add, as following:
In: Sum[f[j], {j, -1, 1}]
Out: f[-1] + f[0] + f[1]
But how to iterate q[i]
values provided in listform above and multiply to f[j]
finnaly get following:
ouptput= q[[1]]*f[-1]+q[[2]]*f[0]+q[[3]]*f[1];
thanks in advance.