$n=3$, $m=3$, $B$ - identity matrix $3 \times 3$
Trying to implement it in Mathematica, but can't figure out how to program the second term. The result is an error.
Clear["Derivative"]
ClearAll["Global`*"]
n = 3
m = 3
B = IdentityMatrix[3]
Sum[x[i] f[i], {i, 1, n}] +
Sum[x[i], {i, 1, n}] Sum[B[[i, j]] u[i], {j, 1, m}] -
1/T Log[\[Alpha]/\[Beta]] Sum[x[i]^2, {i, 1, n}]
Sum[B[[i, j]] u[i], {j, 1, m}]
wherei
is undefined. $\endgroup$Sum[x[i] Sum[B[[i, j]] u[i], {j, 1, m}], {i, 1, n}]
I tried this construction, but it seems to me that it is not correct. $\endgroup$i
inB[[i,j]] u[i]
should indeed be bound by the same summation that the sum overx[i]
is.Sum[x[i] Sum[B[[i, j]] u[i], {j, 1, m}], {i, 1, n}]
should be correct. $\endgroup$