(This is the function that I programmed)
Zm2[Z_, nk_] := (zm2 = 0;
For[i = 0, i < Length[Z], i++, zm2 += nk[[i]] *Z[[i]]* Z[[i]];];
Return[zm2];);
(These are the input data)
z = List[82, 57, 40, 22, 41, 8];
n = List[0.1973, 0.002, 0.1068, 0.0930, 0.002, 0.5989];
(Hear I evaluate the function in the input data)
Zm2[z, n]
(This is the result)
1552.4 + List^3
I need to remove the +List^3
; the value 1552.4 is correct, but I can't use the function for further calculations with the +List^3
.
PLEASE IF SOMEONE CAN HELPE ME WITH THAT, THIS IS FOR MY THESIS WORK.