Skip to main content
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. ...
MannyC's user avatar
  • 820
11 votes
Accepted

Undefined Indexed Variable

The variable i is a dummy one. The evaluated expression: ...
Alexei Boulbitch's user avatar
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 ...
Hugh's user avatar
  • 16.8k
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. ...
Edward Huff's user avatar
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}] ...
kglr's user avatar
  • 401k
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] ...
Mr.Wizard's user avatar
  • 273k
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. ...
rhermans's user avatar
  • 37.4k
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$. ...
Domen's user avatar
  • 33.4k
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 ...
m_goldberg's user avatar
  • 108k
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 ...
Bob Hanlon's user avatar
  • 163k
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: ...
David Keith's user avatar
  • 4,724
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 ...
Daniel Huber's user avatar
  • 56.4k
4 votes

Solve with a non-numerical-index constant

Clear["Global`*"] Use Format to format output display of variables, e.g., rm and <...
Bob Hanlon's user avatar
  • 163k
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 ...
NonDairyNeutrino's user avatar
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}] ...
kglr's user avatar
  • 401k
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 ...
rhermans's user avatar
  • 37.4k
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 ...
Daniel Huber's user avatar
  • 56.4k
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 ...
CA Trevillian's user avatar
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: ...
C. E.'s user avatar
  • 71.2k
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 ...
Carl Woll's user avatar
  • 132k
3 votes

Summation over an index and a set

Try, ...
bbgodfrey's user avatar
  • 62.1k
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: ...
Henrik Schumacher's user avatar
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 ...
rhermans's user avatar
  • 37.4k
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'' <...
cvgmt's user avatar
  • 84.1k
3 votes
Accepted

how to create a list of machine-made index names

Clear["Global`*"] n = 3; (* Use any desired value *) Use indexed variables ...
Bob Hanlon's user avatar
  • 163k
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: ...
ubpdqn's user avatar
  • 64.9k
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 ...
lericr's user avatar
  • 34.1k
3 votes

List of letters longer than the alphabet

You may use QuotientRemainder with FromLetterNumber and a bit of recursion. ...
Edmund's user avatar
  • 43.2k
3 votes

List of letters longer than the alphabet

Another way: ...
Michael E2's user avatar
  • 245k
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 ...
jose's user avatar
  • 6,683

Only top scored, non community-wiki answers of a minimum length are eligible