Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Abs and variables
Replies: 3   Last Post: Jun 28, 1996 9:54 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Espen Haslund

Posts: 4
Registered: 12/7/04
Re: Abs and variables
Posted: Jun 28, 1996 9:54 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

>
> How can I have the Abs function treat real variables properly?
>I seem to recall a way of declaring a variable real, but I don't
>remember how. If there is such a way, would this work with Abs; i.e.
>fix the variable a so that "Abs[a]" will give a result of "a"?
>
>Thanks.
>
>/
>:@-) Scott
>\


Hi, Scott
I think you can obtain what want by using ComplexExpand with
the Option TargetFunctions->{Re, Im}. The optional
second argument of ComplexExpand specifies parameters to be
Complex (the rest is assumed to be real).

Below are two examples that I hope may be of some help.
(I think the manual is too brief on ComplexExpand)

-Espen




IN: z = 1 / (1/r1 + I w c) + r2

1
OUT: r2 + ----------
1
-- + I c w
r1


IN: ComplexExpand[Abs[z],
TargetFunctions->{Re, Im} ] //Simplify

2 2 2 2 2 2
r1 + 2 r1 r2 + r2 + c r1 r2 w
OUT: Sqrt[-----------------------------------]
2 2 2
1 + c r1 w


IN: z = 1 / (1/r1 + I w c) + z2

1
OUT: ---------- + z2
1
-- + I c w
r1


IN: ComplexExpand[Abs[z], {z2},
TargetFunctions->{Re, Im} ] //Simplify

c w 2
OUT: Sqrt[(-(------------) + Im[z2]) +
-2 2 2
r1 + c w

1 2
(------------- + Re[z2]) ]
1 2 2
-- + c r1 w
r1










Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.