       Re: Struggling to figure out the correct coding for a multiple

• To: mathgroup at smc.vnet.net
• Subject: [mg100560] Re: Struggling to figure out the correct coding for a multiple
• From: Ray Koopman <koopman at sfu.ca>
• Date: Mon, 8 Jun 2009 02:05:34 -0400 (EDT)
• References: <h0d6t8\$sq5\$1@smc.vnet.net>

On Jun 6, 12:46 am, Steven Mullen <smul... at 21cm.com> wrote:
> I am trying to figure out how to write the code to solve the
> following equation (the capital "E" will represent the Sigma
> symbol and the character immediately following will represent
> the summation subscript...forgive me for not knowing the correct
> term for this).
>
> x = Ei ci + Ei Ej (Bi + Bj)/2 * ci * cj +
>     Ei Ej Ek (Ci Cj Ck)^(1/3) ci * cj * ck
>
> I want to have a list of values for the B terms, C terms, and
> c terms and refer to that list in the coding (please see below).

Let c = {c1, c2, ...}. Then c1 + c2 + ... = Total[c].

Let B = {B1, B2, ...}. Then second term factors into the product of
two sums, the first of which is a sum of products: B.c * Total[c].

The single-letter symbols C, D, E, I, K, N, O are all Protected,
so let Cx = {C1, C2, ...}. Then the third term factors into the
cube of a sum of products: (c.Cx^(1/3))^3

Finally, x =  Total[c]*(1 + B.c) + (c.Cx^(1/3))^3

>
> I have not been able to figure out how to correctly make the pair
> of summations in the second term work (likewise for the triple
> sum in term 3). I have been playing around with trying to break
> up the second and third terms and then multiply each section with
> the corresponding section (again, please see the code below), but
> there must be a correct way to do this all together...but darned
> if I have not spend days trying to figure out how).
>
> Any and all help is greatly appreciated. Sorry, I know this is
> probably simple, but I am not a mathematician and pretty new to
> Mathematica.
>
> (* my code so far *)
>
> c1 = {c2,    c3}
> B1 = {B2,    B3}
> C1 = {C2,    C3}
>
> term1 = Sum[i, {i, c1}];
>
> term2 = Sum[((i + j)/2) , {i, B1}, {j, C1}]
> trem2a =  Sum[k l, {k, B1}, {l, c1}]
> term3 = Sum[(i j k)^(1/3) l m n, {i, C1}, {j, C1}, {k, C1},
>                                  {l, c1}, {m, c1}, {n, c1}];
> x = term1 + term2 + term3;

• Prev by Date: RE: Setting GridLines style for major and minor grid lines
• Next by Date: Mathematica Special Interest Group (Washington DC Area)
• Previous by thread: Re: Coding for Mathematica
• Next by thread: Mathematica Special Interest Group (Washington DC Area)