Reputation: 364
How can I add a superscript to a variable, when I try to type it in to the Maxima Computer Algebra System?
So for example, I would like to have variables named U^(AC), U^(DC) where my intention is not to raise the variable to the power of something, but to have it as part of its name.
Upvotes: 2
Views: 1521
Reputation: 123
You can name it like that :
U^"AC"
U^"AC"*2=456; solve(%, U^"AC");
But it is a good idea to 'define' it before with something like :
UAC : U^"AC"; UAC *2=456; solve(%, UAC );
Upvotes: 0
Reputation: 17577
UPDATE, NEW ANSWER: Code to implement presuperscripts, presubscripts, postsuperscripts, and postsubscripts has been merged into Maxima. It is available now in the current version from Git, and it will be included in the next release of Maxima, which will be Maxima 5.44. See declare_index_properties
in the online documentation (via ?
).
OLD ANSWER: There isn't a built-in way to achieve that. That said, to some extent you can use A^B
as a symbolic variable in some ways, depending on what you are trying to do. For example, given e:X*A^B + Y
you can say solve(e, A^B)
and it will return [A^B = -Y/X]
. If you say more about exactly what you are trying to achieve, I might be able to give more specific advice.
A while ago I wrote some code to enable Maxima to treat indices of variables as subscripts as well as subscripts (as put the indices before as well as after the variable). I will dust off that code and write more about it here.
Upvotes: 3