I am trying to re-write some equation as input in Mathematica, but still cannot get it correctly.
Asked
Active
Viewed 132 times
1 Answers
0
Perhaps:
f[r_, t_, n_] := With[{m = (2^(2/3)*(Gamma[7/6]/Gamma[1/2]))^(-3)},
(m n^2 )/(n - 4)Sum
[Times @@ (Abs[#]^(4/3) & /@ {r[[t, j - 4]], r[[t, j - 2]],r[[t, j]]}),
{j, 5, n}]]
Testing on rectangular array:
r = RandomReal[{-1, 1}, {5, 10}];
r // MatrixForm
f[r, #, 5] & /@ Range[5]

Ragged array:
test = Join@Table[RandomReal[{-1, 1}, j], {j, 5, 10}]
MapThread[f[test, #1, Length[#2]] &, {Range[Length[test]], test}]

Please check with your own test sample achieves desired result.
ubpdqn
- 60,617
- 3
- 59
- 148
-
-
@belisarius will edit...not well...missing point a little too much lately – ubpdqn Mar 21 '15 at 12:51
-
Trying to shorten it:
f1[r_, t_, n_] := With[{m = 1/4 (Gamma[7/6]/Sqrt@Pi)^-3}, m n^2/(n - 4) Sum[ Times @@ Abs@r[[t, j - 4 ;; j ;; 2]]^(4/3), {j, 5, n}]]– Dr. belisarius Mar 21 '15 at 12:57
i(your summation index) in the TeX formula? – Dr. belisarius Mar 20 '15 at 23:50TableandTotal, becauseSumcombines those. What isj? Specify yourself an intermediate variablemu43 = ...to simplify your code. Use whitespace to clarify your code. – djp Mar 21 '15 at 01:24