Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Collecting terms in an expression' topicStudent Support Forum > General > Archives > "Collecting terms in an expression"

Next Comment >Help | Reply To Topic
Author Comment/Response
Sami
09/02/12 3:01pm

Hi guys,
I am writing a symbolic program and have "n" variables .... I am new to Mathematica, so sorry if I sound too amateur ....

Somewhere in my code, I get a function with terms exp(x[1]^2)+ exp(y[1]^2)+ exp(z[1]^2) .... +exp(x[n]^2)+exp(y[n]^2)+exp(z[n]^2)....


Now I want mathematica to combine exp[ x[i]^2 + y[i]^2 + z[i]^2 to exp (R[i]^2): Meaning exp([i]^2).... exp(R[n]^2)

I tried different ways like:

A) R[i]^2= x[i]^2 + y[i]^2 + z[i]^2;
Simplify[Function]

B) rules = {Exp[x[i]^2 + y[i]^2 + z[i]^2] -> Exp[R[i]^2]}
For[i = 1, i < n + 1, i++, prob /. rules]

C) rules1 = {Exp[ (x[i]^2 + y[i]^2 + z[i]^2)] -> Exp[ (V[[i]] ) ]};
simplified = For[i = 1, i < n + 1, i++, ReplaceList[prob, rules ] ]

in which V is a vector of R[1] to R[i]....


Could anyone please help me with this??
I am struggling with this for two days! I am just new in Mathematica...



But none of them worked out.
Could you please help me with this?

Thanks.

URL: ,

Subject (listing for 'Collecting terms in an expression')
Author Date Posted
Collecting terms in an expression Sami 09/02/12 3:01pm
Re: Collecting terms in an expression Bill Simpson 09/03/12 11:34pm
Re: Re: Collecting terms in an expression Sami 09/04/12 12:48pm
Re: Re: Re: Collecting terms in an expression Bill Simpson 09/04/12 10:29pm
Re: Re: Re: Re: Collecting terms in an expression Sami 09/06/12 00:45am
Re: Re: Re: Re: Re: Collecting terms in an expr... Bill Simpson 09/06/12 11:36am
Re: Re: Re: Re: Collecting terms in an expression Sami 09/06/12 01:14am
Re: Re: Re: Re: Re: Collecting terms in an expr... Bill Simpson 09/07/12 2:57pm
Re: Re: Re: Re: Re: Re: Collecting terms in an ... Sami 09/08/12 03:26am
Re: Re: Re: Re: Re: Re: Re: Collecting terms in... Sami 09/11/12 8:12pm
Re: Re: Re: Re: Re: Re: Re: Re: Collecting term... Bill Simpson 09/14/12 03:31am
Next Comment >Help | Reply To Topic