[Date Index] [Thread Index] [Author Index]
Re: Interpretation of subscripts
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.