Re: problem to define a complex quantity
- To: mathgroup at smc.vnet.net
- Subject: [mg116893] Re: problem to define a complex quantity
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Thu, 3 Mar 2011 06:00:19 -0500 (EST)
tarun dutta wrote: > i want to use complex variable such as > c[i_]=a[i]+I*b[i] ;where 'a' and 'b' are both real > then I get > conj[c[i]] =a[i]-I*b[i] > by stating > conj[x_]:=complexexpand[conjugate[x]]; > > > but now i am writing > c[i_][t_]=a[i][t]+I*b[i][t] > but i am not getting > conj[c[i][t]]=a[i][t]-I*b[i][t] > by stating > conj[x_]:=ComplexExpand[Conjugate[x]] > > moreover am using mathematica version-7 > > is there any way of writing this thing? > give some valuable insight. > regards, > tarun Above, werbatim, is the message I received around a week ago--less the part about using version 7, which I needed to guess. Below, verbatim, is what I sent in private email response at that time. It turns out that the same approach will still work today (I tested it). ------------------- The result below looks about right to me. In[327]:= c[i_][t_] := re[i][t] + I*im[i][t] conj[a_] := ComplexExpand[Conjugate[a]] In[329]:= conj[c[i][t]] Out[329]= -I im[i][t] + re[i][t] This was in version 8. A bug in earlier versions caused the various entities to be regarded as "complex valued". So you would see something like below. By the way, it would save people like myself a lot of time if you actually show your input and output, so nobody has to guess at the nature of teh problem. Out[4]= -Im[im[i][t]] + I (-Im[re[i][t]] - Re[im[i][t]]) + Re[re[i][t]] To work around this I'd suggest postprocessing with Simplify, giving assumptions that re[i][t] and im[i][t] are both real valued. Daniel Lichtblau Wolfram Research