|
From: Robert D. <rob...@gm...> - 2023-07-22 16:04:10
|
On Sat, Jul 22, 2023 at 12:38 AM Wolfgang Hugemann <Au...@hu...> wrote: > Thanks for that hint. But in engineering subscripts are not always meant > as a variable index, but often serve as a means to distinguish quantities. > > If you denote the drag coefficient as c_d > (https://en.wikipedia.org/wiki/Drag_(physics)), you surely don't mean > c[d]. Well, Maxima doesn't require subscripts to correspond to indices; instead a more general correspondence is allowed. In fact, subscripts can be any expressions, and there is no requirement that they form a complete set of anything. (Internally values assigned to subscripted variables are stored in a hash table.) In that sense, the subscript does indeed just serve as an indicator to distinguish conceptually-related quantities. Also of interest in this context, a recently-added feature (present in Maxima 5.44 and later) is that one can declare subscripts to be displayed above or below, before or after the base symbol. See declare_index_properties. E.g.: (%i11) declare_index_properties (FOO, [presubscript, presuperscript, postsuperscript, postsubscript]); (%o11) done (%i12) FOO[a, b, c, d]; b c (%o12) FOO a d All the best, Robert PS. I see now that the function is misnamed; it should be called declare_subscript_properties. See, I got myself mixed up ... oh well! |