2
$\begingroup$

im in the medal of coding and i reached the point where i have something like this, enter image description here

the problem is i have up to 35 terms and all should be index in order to preform summation to count all possibilities, is there any automatic way to generate as variable index as much as i want ? also is there any way to fill all the summations automatically ?

thanks

$\endgroup$
4
  • $\begingroup$ Are you looking for Table[Subscript[u, Unique["x"]], 35], or maybe Array[Subscript[u, x[#]] &, 35]? (Subscript could be replaced by Indexed.) $\endgroup$
    – user31159
    Nov 7, 2016 at 21:21
  • $\begingroup$ actually i want 35 term of u[x] with variable index, so i can do summation. in the pic its only 3 terms i need 32 term extra each term will have summation with same index letters $\endgroup$
    – Love Eva
    Nov 7, 2016 at 21:28
  • $\begingroup$ Yes, I should have written it this way: Table[Subscript[u, Unique["x"]][t], 35], and Array[Subscript[u, x[#]][t] &, 35]. For instance for the latter, the sum iterators are the x[1], ..., x[35]. $\endgroup$
    – user31159
    Nov 7, 2016 at 21:31
  • $\begingroup$ the table command did not work, what about the summation ? $\endgroup$
    – Love Eva
    Nov 7, 2016 at 21:38

2 Answers 2

2
$\begingroup$

You could use $ii[1]$, $ii[2]$, $ii[3]$ etc instead of $ii$, $kk$, $ll$:

expr = Product[Indexed[u, ii[i]][t], {i, 3}];

Sum[expr, ##] & @@ Array[{ii[#], jj} &, 3]

enter image description here

$\endgroup$
4
  • $\begingroup$ what about making it start from 1? this will generate the terms what about making it start from 1? $\endgroup$
    – Love Eva
    Nov 7, 2016 at 21:47
  • $\begingroup$ @LoveEva, it implicitly starts from 1 but if you want it explicit use {ii[#], 1, jj} in the Array $\endgroup$ Nov 7, 2016 at 21:50
  • $\begingroup$ final thing, im using mathematica 7 and this command is only available in advanced versions of the program is there any alternative way in 7? $\endgroup$
    – Love Eva
    Nov 7, 2016 at 21:54
  • $\begingroup$ @LoveEva, you can use Subscript instead of Indexed. Or just make the index an argument of u, as in u[ii[3], t] $\endgroup$ Nov 7, 2016 at 22:03
1
$\begingroup$

If you really have that simple structure, exploit it:

Clear[u]
jj = 4;
Times @@ (Total /@ Array[u, {3, jj}])
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.