MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: j instead of I

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34676] Re: j instead of I
  • From: "Carl K. Woll" <carlw at u.washington.edu>
  • Date: Fri, 31 May 2002 04:27:37 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Oliver,

I didn't see your post, so let me add to the post from Omega Consulting.

There are two issues here, how to input "I" and how it looks on output. 
The previous reply addresses the first issue. However, an alternative is 
to simply use \[ImaginaryJ] instead, which can be input by the alias esc 
j j esc. Mathematica already recognizes that \[ImaginaryJ] has the value 
I. For example, if you enter \[ImaginaryJ]^2 you will get the answer -1. 
If you are willing to enter j as \[ImaginaryJ], there is no need to mess 
with autoload packages.

The second issue concerns how to get Mathematica to use j on output. If 
you are willing to use StandardForm or TraditionalForm, there is a 
simple way to get your desired behavior. Simply add the following 
definition:

MakeBoxes[I, _] := "\[ImaginaryJ]"

You can enter \[ImaginaryJ] directly or through the alias, just don't 
forget to include the quotes. If you want this definition for all of 
your notebooks, then follow the previous posters guidelines on init.m 
and autoload packages.

If you like OutputForm, then the above solution won't work. There are 
other possible workarounds then, but I don't know of anything simple.

Carl Woll
Physics Dept
U of Washington


"Omega Consulting" <omega_consulting at yahoo.com> wrote in message 
news:ad4iv0$jko$1 at smc.vnet.net...
> At 02:50 AM 5/18/2002, Oliver Friedrich wrote:
> >Hallo,
> >
> >doing some electrical engineering, I would like to have the symbol
> >j=sqrt(-1) instead of the I. What's the best way to do this 
permanent, so
> >each time Mathematica starts it is done already?
> >
> >Oliver Friedrich
>
> This can be accomplished by creating an autoload package. This is a
> Mathematica package (*.m) placed in one of several possible locations. 
The
> following command gives a list
>
> In[1]:=
> Map[ToFileName[#, "init.m"] &, {
>    {$TopDirectory, "AddOns", "Autoload", "*", "Kernel"},
>    {$PreferencesDirectory, "AddOns", "Autoload", "*", "Kernel"},
>    {$TopDirectory, "Configuration", "Kernel"}
> }]
>
> where * represents any directory name. So you can create as many 
autoload
> packages as you want. In your package, you want the commands formatted 
in
> InputForm. So for you, the init.m should look like
>
> j=Sqrt[-1]
>
> --------------------------------------------------------------
> Omega Consulting
> "The final answer to your Mathematica needs"
>
> Spend less time searching and more time finding.
> http://www.wz.com/internet/Mathematica.html
>




  • Prev by Date: RE: RE: Define a function
  • Next by Date: Re: Finding Maxima in tensors
  • Previous by thread: RE: Re: j instead of I
  • Next by thread: //MatrixForm