Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15005

Re: Decoupling E and I

From "Nasser M. Abbasi" <nma@12000.org>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Decoupling E and I
Date 2013-06-25 06:51 +0000
Message-ID <kqbelk$fo3$1@smc.vnet.net> (permalink)
References <20130624025738.EE9906A12@smc.vnet.net> <kq8ttr$8p4$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


On 6/24/2013 2:53 AM, Dave Snead wrote:
> Hi,
>
> Anyone know of a way to decouple capital E and capital I
> from their exponential and imaginary uses
> so they can be used as ordinary user defined variables?
> I don't want to change the current use of Exp
> or the lower case double struck e and i however!
>
> Thanks in advance,
> Dave Snead
>
>

You can use ClearAttributes[E, Protected] but that
would not be the right way to do things.

Some other option is to use as variables CapitolEpsilon which
looks just like E and use CapitolIota which looks very much like I.

But I also do not like this solution, since when reading the code, one
has to look very hard to see that this is the official I vs. the
look-alike one.

Another solution if these are meant to be constants, is to use
a With:

In[3]:= With[{E = 2, I = 4}, E*I]
Out[3]= 8

Another option if they are variables, is to use a Module

-----------------------------
foo := Module[{E, I},
   E = 2;
   I = 4;
   E*I
   ]

In[7]:= foo
Out[7]= 8
----------------------------

But I really think the best solution is to just accept that Mathematica
uses UpperCase for symbols and use lower case.

Small price to pay for having consistency in code, then your code
will be readable by others and less confusing.

--Nasser



Back to comp.soft-sys.math.mathematica | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Decoupling E and I "Dave Snead" <dsnead6@charter.net> - 2013-06-24 07:53 +0000
  Re: Decoupling E and I "Nasser M. Abbasi" <nma@12000.org> - 2013-06-25 06:51 +0000
  Re: Decoupling E and I "Kevin J. McCann" <kjm@KevinMcCann.com> - 2013-06-29 08:48 +0000

csiph-web