MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: problem with"Re" syntax

  • To: mathgroup at smc.vnet.net
  • Subject: [mg116875] Re: problem with"Re" syntax
  • From: Peter Pein <petsie at dordos.net>
  • Date: Thu, 3 Mar 2011 05:57:03 -0500 (EST)
  • References: <ikan2k$cdr$1@smc.vnet.net>

Am 26.02.2011 12:10, schrieb tarun dutta:
> c[i_][t] = a[i][t] + I*b[i][t];
> d[i_][t] = g[i][t] + I*h[i][t];
> del = Together[Sum[Sqrt[i]*d[i - 1][t]*d[i][t], {i, 0, 5}]]
> Re[del]
>
> the problem is that after executing the program, as output I am not
> able to get only the real part of the expression(del).the output
> contains the whole expression though i am using "Re" term.
>
> some valuable insight will be much appreciated.
> regards,
> tarun
>
in this case too: tell Mathematica that everything except complexes is real:
In[1]:= c[i_][t]=a[i][t]+I*b[i][t];
d[i_][t]=g[i][t]+I*h[i][t];
del=Together[Sum[Sqrt[i]*d[i-1][t]*d[i][t],{i,0,5}]]
Simplify[Re[del],Element[Except[_Complex],Reals]]

Out[3]= g[0][t] g[1][t]+Sqrt[2] g[1][t] g[2][t]+Sqrt[3] g[2][t] 
g[3][t]+2 g[3][t] g[4][t]+Sqrt[5] g[4][t] g[5][t]+I g[1][t] h[0][t]+I 
g[0][t] h[1][t]+I Sqrt[2] g[2][t] h[1][t]-h[0][t] h[1][t]+I Sqrt[2] 
g[1][t] h[2][t]+I Sqrt[3] g[3][t] h[2][t]-Sqrt[2] h[1][t] h[2][t]+I 
Sqrt[3] g[2][t] h[3][t]+2 I g[4][t] h[3][t]-Sqrt[3] h[2][t] h[3][t]+2 I 
g[3][t] h[4][t]+I Sqrt[5] g[5][t] h[4][t]-2 h[3][t] h[4][t]+I Sqrt[5] 
g[4][t] h[5][t]-Sqrt[5] h[4][t] h[5][t]

Out[4]= g[0][t] g[1][t]+Sqrt[2] g[1][t] g[2][t]+Sqrt[3] g[2][t] 
g[3][t]+2 g[3][t] g[4][t]+Sqrt[5] g[4][t] g[5][t]-h[0][t] 
h[1][t]-Sqrt[2] h[1][t] h[2][t]-Sqrt[3] h[2][t] h[3][t]-2 h[3][t] 
h[4][t]-Sqrt[5] h[4][t] h[5][t]

P²


  • Prev by Date: Patterns with conditions
  • Next by Date: Re: making something autoexecute before normal execution
  • Previous by thread: Re: problem with"Re" syntax
  • Next by thread: generic binomial/trinomial tree