|
[Date Index]
[Thread Index]
[Author Index]
Re: Complexes, Reals, FullSimplify
- To: mathgroup at smc.vnet.net
- Subject: [mg48815] Re: [mg48782] Complexes, Reals, FullSimplify
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Thu, 17 Jun 2004 04:07:32 -0400 (EDT)
- References: <200406160854.EAA12221@smc.vnet.net> <3FF51E64-BF8F-11D8-890A-000A95B4967A@mimuw.edu.pl>
- Sender: owner-wri-mathgroup at wolfram.com
Of course I meant:
ComplexExpand[Re[(1 - 6*I)*Cos[x] - (1 + 2*I)*Sin[0.5*x]]]
Cos[x] - Sin[0.5*x]
(that Element[x,Reals] was there only because I forgot to delete it
form your original code.)
Andrzej
On 16 Jun 2004, at 21:18, Andrzej Kozlowski wrote:
>
> On 16 Jun 2004, at 17:54, Stergios J. Papadakis wrote:
>
>> Dear group,
>> I am trying to use expressions of the below form as boundary
>> conditions
>> in NDSolve. I keep getting "non-numerical" errors. I have tried a
>> lot
>> of things and reduced the problem to this:
>>
>> These give different outputs:
>>
>> FullSimplify[Re[(1 - 6* I)* Cos[x] - (1 + 2*I)*Sin[(1/2)*
>> x]],Element[x,
>> Reals]]
>>
>> FullSimplify[Re[(1 - 6* I)* Cos[x] - (1 + 2*I)*Sin[0.5*x]],Element[x,
>> Reals]]
>>
>> I get:
>>
>> \!\(Cos[x] - Sin[x\/2]\)
>>
>> Re[(1 - 6 \[ImaginaryI]) Cos[x] - (1 + 2 \[ImaginaryI]) Sin[0.5 x]]
>>
>>
>> I think I can get my NDSolve to work if I can make the second
>> FullSimplify above give me an output without an Re in it. Mathematica
>> assumes that 0.5 may have some tiny imaginary part and therefore keeps
>> everything for full generality. How do I eliminate
>> this? Note that I have simplified things a lot here, the actual
>> expression that I will be using has many terms that all have the
>> form above, with many significant digits, which depend on earlier
>> calculations. I have tried using Chop,
>>
>> FullSimplify[Chop[Re[(1 -
>> 6* I)* Cos[x] - (1 + 2*I)*Sin[0.5* x]]], Element[x, Reals]]
>>
>> And that does not work, I get the same result.
>>
>>
>>
>>
>>
>>
>> Thanks,
>> Stergios
>>
>>
>
> The simplest way is to use ComplexExpand; you do not even need
> FullSimplify:
>
> ComplexExpand[Re[(1 - 6* I)* Cos[x] - (1 + 2*I)*Sin[0.5*x]], Element[x,
> Reals]]
>
> Cos[x] - Sin[0.5*x]
>
>
> Andrzej Kozlowski
> Chiba, Japan
> http://www.mimuw.edu.pl/~akoz/
>
Prev by Date:
RE: Complexes, Reals, FullSimplify
Next by Date:
Re: Using NDSolve in NonlinearFit
Previous by thread:
Re: Complexes, Reals, FullSimplify
Next by thread:
Re: Complexes, Reals, FullSimplify
|