From: Richard F. <fa...@gm...> - 2023-07-22 16:56:05
|
Often there is a conflict between the needs or expectations of a mathematician / engineer /textbook/ reference ... and the design of a computer algebra system. In fact, the conventions of one application area may be in conflict with another, and so it is difficult to have a CAS treat "all" users' domains naturally (and potentially simultaneously!) How far do we push the notation? Mathematica has a syntax for functions as f[x]. not f(x). You can write f(x)., but it means f*x. f'[x] means the same as Derivative[1][f][x]. and to define a function you write something like f[x_]:= x+1 and there are more "non-mathematical" constructions that will have to be learned. Maxima is closer to ordinarily high-school level algebra and conventional programming language syntax, but requires some adaptation as well. For instance, Maxima insists on a*x for multiplication, with ax being a single symbol and a x being illegal syntax. Some notational context issues can be dealt with by extending syntax, or by defining special displays, but in reality, there is a trade-off between humans learning to adapt to the existing formal CAS versus trying to make some kinds of notational hacks to make a superficial match to some application context. Is it worth doing? Frankly, why should a calculus student have to learn the syntax of a CAS like Mathematica, in order to do homework, when even the conventional version of the course is simply a requirement whose content is irrelevant: just a barrier to graduation? Anyway, to emphasize Robert's point: The f[i] notation in Maxima is quite powerful, and includes array referencing as a special case. But this is possible too: f[x]:=x+1 /* in general ... f[3] will return 4 */ f[1/2]: 34 /* except f[1/2] will return 34 */ note the use of :=, :, which may not correspond to what your textbook uses. Should we redefine these and other usages like ::=, =, etc? Should we also allow notations from programming languages like Python, C, etc? How about x++1 ? These are matters of taste and convenience so people will have different approaches depending on their needs and background. In discussion forums like this, I can only point out the breadth of notations and conventions ranging across a context of fields of "computational" mathematics as well as programming formalisms. RJF On Sat, Jul 22, 2023 at 9:04 AM Robert Dodier <rob...@gm...> wrote: > 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! > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > |