11
votes
Accepted
Einstein summation convention for symbolic vector calculus
First let me remark that you can unprotect symbols by doing Unprotect[symbol], and then you can define whatever you want to it. This is however not always advised.
...
11
votes
Accepted
9
votes
Defining a function of arguments with sub- and superscripts
Following the comments I am encouraging the use of brackets rather than subscripts or superscripts. Here is an example where a function may take a variable with a subscript or a variable without a ...
8
votes
What are the requirements for a well behaved indexed variable? Subscript, ToExpression, Downvalue?
What are the requirements for well behaved variables?
Functions are not variables, although in most cases, the kernel treats undefined variables and functions identically. Sometimes it doesn't. ...
7
votes
Accepted
How to create a nested list of variable depth with indexed elements
You can try Array:
Array[c, {3, 3, 3, 3}]
...
5
votes
Combining Multiple Lists
Using indexed objects:
list[1] = {a, b, c, d};
list[2] = {e, f, g, h};
list[3] = {i, j, k, l};
list[4] = {m, n, o, p};
Array[list, 4, 1, Join]
...
5
votes
Accepted
How do I get Mathematica to invert a matrix with subscripts involved? (Subscript usage)
Rewrite your matrix (notice I'm fixing a the erroneous Subscript[towpx^2, i] that should be Subscript[towpx, i]^2.
...
5
votes
Accepted
Replacing multiple variables according to the index
The implementation depends on how you define your variables. I have used x[i] as an expression for $x_i$.
...
4
votes
Getting named functions from an sequence of parameter values applied to a parametric function
It is a common mistake of beginners to think they need names to refer to the results of ParametricNDSolveValue. I don't say naming is never needed, but it is very ...
4
votes
Subscripts use to make expression readable
See Defining Output Formats (tutorial/TextualInputAndOutput#9464). "whenever the Wolfram Language is given an expression to format for output, it first calls ...
4
votes
How to use a list of indexes as a variables inside a Module?
In an even more trivial case. It appears that Module is not willing to recognize such indexed variables as symbols:
...
4
votes
Accepted
Differentiation by indexed variable in equation of Christoffel Symbols
With syntax errors corrected, I choose as summation index m not l to make it more readable.
Can you check if my result is ...
4
votes
Solve with a non-numerical-index constant
Clear["Global`*"]
Use Format to format output display of variables, e.g., rm and <...
4
votes
Listing all Index Possibilities Given a Vector and Indexed Set
Method 1: Calculate all products
We can calculate all the products of the terms via KroneckerProduct and simply find where the positive ones are, and then get the ...
4
votes
Listing all Index Possibilities Given a Vector and Indexed Set
v = {5, 2, -2, -4, 3};
a = {-1, 1};
Select[Positive[First @ # v[[Last @ #]]] &]@Tuples[{a, Range @ Length @ v}]
...
4
votes
Accepted
Would it be poor advice to assign roman numerals as top variables?
I advise against
The reasons I will say it is "poor advice to assign roman numerals as top variables", is that it forces you to name the variable through strings operations, you end up with ...
4
votes
Defining custom operators for indexed objects
Do not use subscripted variables, use indexed variables.
Then it is not clear, if x and y are fixed or placeholders. To make it general, I assume x and y are placeholders and define an operator of the ...
3
votes
Defining a function of arguments with sub- and superscripts
Below I have defined a few different forms which will do exactly as you asked. While I, too, agree with the sentiments iterated by user @Hugh regarding the use of sub- and superscripts, that this is ...
3
votes
How to create a nested list of variable depth with indexed elements
To elaborate on b.gates.you.know.what's comment, this is a scalable version equivalent to kglr's solution:
...
3
votes
Define implicit dummy index?
You might consider using the symbolic tensor capabilities of Mathematica. For example, define a to be a matrix and b to be a ...
3
votes
3
votes
Loop with indexed function not defined for some index values
It is a really bad idea to use floating point numbers for indexing.
In order to see why, have a look at the output of following code after having run your code:
...
3
votes
Combining Multiple Lists
Ultimately, the answer by @Mr.Wizard is the way to create and manipulate many lists. But, that doesn't answer OP's question if one can't create the lists oneself and need to deal with lists already ...
3
votes
How to use a list of indexes as a variables inside a Module?
According to the Help, ''Every time a module is evaluated, a new temporary symbol is created'' and ''Block localizes values only; it does not create new symbols''
<...
3
votes
Accepted
how to create a list of machine-made index names
Clear["Global`*"]
n = 3; (* Use any desired value *)
Use indexed variables
...
3
votes
Listing all Index Possibilities Given a Vector and Indexed Set
For this particular problem, this is essentially:
Table[{Sign[v[[j]]], j}, {j, Length[v]}]
or more outrageously:
...
3
votes
List of letters longer than the alphabet
Updated answer
The problem I was struggling with when trying to use IntegerDigits was that the leading digit for any number in "normal form" can never be zero. The fancy Mod stuff couldn't ...
3
votes
List of letters longer than the alphabet
You may use QuotientRemainder with FromLetterNumber and a bit of recursion.
...
3
votes
3
votes
Counting multiple $-sign string indices in output and replacing them by normal indices
It is standard in xTensor work (and in all of xAct, actually) to set at the beginning of the session
$PrePrint = ScreenDollarIndices;
In this way the results will ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
indexed-variable × 62index × 12
list-manipulation × 10
summation × 9
indexing × 7
symbolic × 5
variable-definitions × 5
tensors × 5
variable × 5
functions × 4
core-language × 4
calculus-and-analysis × 3
function-construction × 3
replacement × 3
scoping × 3
equation-solving × 2
matrix × 2
mathematical-optimization × 2
pattern-matching × 2
syntax × 2
parallelization × 2
vector-calculus × 2
assignment × 2
operators × 2
custom-notation × 2