![]() We shall simply try to write code having the abstract model in mind.Ĭopied from the Mathematica Reference Guide (A.1.2): The name of a symbol must be a sequence of letters, letter-like forms and digits, not starting with a digit. However, this would be slow for pattern matching. It could also seem reasonable to define tensors as abstract types, instead of fixing a particular structure from the very beginning. The only general recommendation is using long names for tensors (like MaxwellF for the electromagnetic Faraday tensor) and short names (a, b, C, etc.) for abstract indices. In xTensor` we do not force any particular solution, leaving the decision to the user. We could use as well TensorA, ManifoldA, IndexA, or perhaps TenA, ManiA, IndA. This simply means using longer names for the objects defined. It could seem reasonable to use contexts to separate Tensor`A from Manifold`A or Index`A. This leads us to introduce a second important decision: symbols with some xTensor` type will always appear in the composite expression at level 0 in other words, the symbol identifying a tensor will be the head of the tensor, and so on: we shall use A rather than, for example, the more natural notation Tensor suggested by Maeder. There is a harsh limitation in Mathematica: an expression can be associated to a symbol if and only if the symbol is present in the expression at levels 0 or 1, but no deeper. At any time we can collect all the information known about a tensor, using Information (the ? command). Information on a tensor is only used by Mathematica when the tensor appears in the expression being evaluated. This decision has also two important advantages: We cannot have two different tensors identified by the same symbol, to avoid conflicting information. Tensors are identified using symbols, and not strings. In xTensor` we take the following important decision: information on a tensor will be associated to a symbol identifying that tensor. ![]() Information in Mathematica is associated to symbols only (not to strings, numbers or composite expressions as a whole). What follows in this section refers to tensors, but can also be applied to other xTensor` types of values, to be listed below. Tensors and other types of values must be composite types. Unfortunatlely it is not possible to define new primitive types. This tutorial is accredited appropriately.There are three primitive types of values in Mathematica: symbols (head Symbol), strings (head String) and numbers (heads Integer, Rational, Real and Complex). The right to distribute this tutorial and refer to this tutorial as long as You, as the user, are free to use the scripts for your needs to learn the Mathematica program, and have While Mathematica output is in normal font.įinally, you can copy and paste all commands into your Mathematica notebook, change the parameters, and run them because the tutorial is under the terms of the GNU General Public License The Mathematica commands in this tutorial are all written in bold black font, It is primarily for students who have very little experience or have never used Mathematica and programming before and would like to learn more of the basics for this computer algebra system.Īs a friendly reminder, don't forget to clear variables in use and/or the kernel. This tutorial was made solely for the purpose of education and it was designed for students taking Applied Math 0330.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |