Re: Interpretation of subscripts

• To: mathgroup at smc.vnet.net
• Subject: [mg48061] Re: Interpretation of subscripts
• From: Jon Harrop <jdh30 at cam.ac.uk>
• Date: Mon, 10 May 2004 06:51:16 -0400 (EDT)
• Organization: University of Cambridge
• References: <c7hrfh\$bjb\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Guido wrote:

> I wanted to solve a differential equation via DSolve. When naming the
> constants with subscripts (e.g. for the mass of the sun M_Sun with the
> word Sun on the line), Mathematica 5 in some way misinterpreted this
> and told me:
>   DSolve::bvfail : For some branches of the general solution, unable
> to solve the conditions.

If you are literally writing "M_Sun" then this has a special meaning in
Mathematica: it means a pattern matching a single "object", called "M",
which must have head "Sun". This isn't what you want.

If you are writing "M [ctrl]+_ Sun" in a notebook, to get proper
subscripting, then it is interpreted as an "object" with downvalue key "M"
rather than "M_Sun". This is closer to what you want, but if you solve
things then you are likely to get answers like "2_Sun".

I suspect you want to load in the Notation package:

<< Utilities`Notation`

and then define "M [ctrl]+_ Sun" to act as a single symbol. You can do this
by writing:

Symbolize[Subscript[M,Sun]]

But you _must_ enter the "Symbolize[...]" using the palette and not just by
typing it in.

Then, Subscript[M,Sun] (equivalently typed "M [ctrl]+_ Sun" in the notebook
front-end) will be treated as a single symbol.

Cheers,
Jon.

```

• Prev by Date: Re: Finding errors in my code?
• Next by Date: Re: Re: Mandelbrot Set & Mathematica
• Previous by thread: Interpretation of subscripts
• Next by thread: Re: Interpretation of subscripts