MathGroup Archive 2002

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

Search the Archive

Re: Assigning to superscripted variables

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34314] Re: Assigning to superscripted variables
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Tue, 14 May 2002 04:12:39 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <abo3f4$5dt$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

what you are doing is realy dangerous, because
Power[] is a very a basic build-in function and
allmost all other functions have rules for Power[].

To use super scripted index values, traditional mathematics
use a^{(b)}  with round brackets. If you are using the Frontend
you should try

MakeBoxes[SuperIndex[a_, b_], fmt_:StandardForm] := 
  SuperscriptBox[MakeBoxes[a,fmt], RowBox[{"(", MakeBoxes[b,fmt], ")"}]]

MakeExpression[SuperscriptBox[a_, RowBox[{"(", b_, ")"}]], 
    fmt_:StandardForm] := 
  MakeExpression[RowBox[{"SuperIndex", "[", a, ",", b, "]"}]]


and use SuperIndex[a,i] or enter the typesetted form

a <Crtl>^ ( i )

where <Crtl>^ means th Ctrl-Key on your keyboard.

Regards
  Jens


Dave Snead wrote:
> 
> Hi,
> 
> I've been trying to assign values to superscripted variable, ex,
> a^i = 5
> but I get a message that Tag Power is protected.
> I can
> Unprotect[Power]
> first and then it works fine.
> However after a few more expressions, Power somehow gets reprotected!
> Does anyone know what causes this?
> How can I keep Power unprotected for the remainder of the session?
> 
> Thanks in advance,
> Dave Snead


  • Prev by Date: Re: Limit with restrictions
  • Next by Date: RE: Tough Limit
  • Previous by thread: Re: Assigning to superscripted variables
  • Next by thread: RE: Assigning to superscripted variables