0

I am trying to re-write some equation as input in Mathematica, but still cannot get it correctly.

Johny
  • 71
  • 5
  • 1
    Where is i(your summation index) in the TeX formula? – Dr. belisarius Mar 20 '15 at 23:50
  • You'll need to define n. You don/t need both Table and Total, because Sum combines those. What is j? Specify yourself an intermediate variable mu43 = ... to simplify your code. Use whitespace to clarify your code. – djp Mar 21 '15 at 01:24
  • @belisarius, thanks, you were right. Even the TeX formula was wrongly. Sorry for that. It should be OK now. I also defined "mu" separately, but it is used only once so I thought there was no need to define that, but it look clearer now :). – Johny Mar 21 '15 at 07:02

1 Answers1

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]

enter image description here

Ragged array:

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

enter image description here

Please check with your own test sample achieves desired result.

ubpdqn
  • 60,617
  • 3
  • 59
  • 148