Re: Newby Q: How to specify reals
- To: mathgroup at smc.vnet.net
- Subject: [mg110525] Re: Newby Q: How to specify reals
- From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
- Date: Wed, 23 Jun 2010 01:52:58 -0400 (EDT)
- References: <hvq549$1o$1@smc.vnet.net>
Hi Dave, In Mathematica there are no typed variables, so you cannot in general declare certain variables to be reals. Your attempt to do so with {T1, T2, C1, C2, R1, R2, w} \[Element] Reals is not a declaration that these variables are reals, but actually a *test* whether or not they are real. You can set up environments for functions like Simplify in which you specify certain assumptions about variable domains, using Assuming. You might look up Assumptions as well. Your problem can be solved by using ComplexExpand. It will assume that any named variable is real. ComplexExpand[Im[R1 + I/(C1 w)]] 1/(C1 w) Cheers -- Sjoerd On Jun 22, 1:00 pm, DBird <db... at ieee.org> wrote: > Trying the following procedure: > > In[41]:= {T1, T2, C1, C2, R1, R2, w} \[Element] Reals > > Out[41]= (T1|T2|C1|C2|R1|R2|w)\[Element]\[DoubleStruckCapitalR] > > In[42]:= x = R1 + I 1/(w C1) > > Out[42]= R1+I/(C1 w) > > In[43]:= Im[x] > > Out[43]= Re(1/(C1 w))+Im(R1) > > Question is, how do I specify the list {T1,T2,...} such that Im[x] > yield just R1. > > I usually find I am missing something dumb... > > Thanks, > > Dave