       Re: Euler Form

• To: mathgroup at christensen.cybernetics.net
• Subject: [mg1919] Re: Euler Form
• From: zizza at willamette.edu (Frank Zizza)
• Date: Fri, 18 Aug 1995 02:14:42 -0400
• Organization: Willamette University, Salem, OR, USA

```In article <DDFr3o.I0C at wri.com> "Paul J. Simonich"
<simonichpj%dfms%usafa at dfmail.usafa.af.mil> writes:
> I am trying to leave an expression in a phasor (Euler's Form) format.
> If my angle theta is a non-decimal number it remains in the form I
> desire:
>
> In: Exp[I 3]
> Out: Exp[I 3]
>
> However, if my angle is a decimal approximation, Mathematica converts to
> a rectangular format:
>
> In:  Exp[I .3]
> Out:  0.955336 + 0.29552 I
>
> I would like to have the output remain in phasor notation. Can you help?
> The specific problem I was working with was:
>
> In: Exp[I ArcTan[1/8]]
>
> When I tried to numerical approximate the ArcTan[ ], Mathematica shifted
> to the rectangular format.  I have tried numerous techniques but to no
> avail.
>
> Capt Paul Simonich
> Dept of Mathematical Sciences
>
>
>

See if this will do it for you.  The idea is to create your own N form, I
called it n below that formats the numbers as you desire (thats what the
first rule does) but does not effect subsequent calculations (I hope that
is what the second rule below will do.)

janus> math
Mathematica 2.2 for NeXT
-- NeXT graphics initialized --

In:= <<test.m

In:= !!test.m

Format[n[a_]] := (HoldForm[A * Exp[I*B]]) /. {A -> Abs[a], B -> Arg[a]}

n /: h_[a___, n[b_], c___] := h[a, b, c]

In:= Random[] + I Random[]  (*Here is a rect. number*)

Out= 0.150264 + 0.262879 I

In:= n[%]              (*Here is its n form*)

Out= 0.302795 Exp[I 1.05152]

In:= 2 * %^2           (*And this tests if we can still work with it*)

Out= -0.0930527 + 0.158005 I

In:= n[%]

Out= 0.183369 Exp[I 2.10303]

Good luck.

Frank Zizza
zizza at willamette.edu

```

• Prev by Date: Re: Help required on differential equation
• Next by Date: Together
• Previous by thread: Euler Form
• Next by thread: Problem with ComplexExpand[Abs[]]