Questions tagged [subscript]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
11
votes
5answers
725 views

Remove subscript from string

I have a list that I am using for the legend of a plot gases = {"Air", "He", "Ar", "\!\(\*SubscriptBox[\(N\), \(2\)]\)", "\!\(\*SubscriptBox[\(CO\), \(2\)]\)"}; ...
6
votes
1answer
453 views

How to save/load (export/import) symbolized variables?

I have a large number of variables/functions with subscripts and use definitions with memoization to avoid recomputing them within a kernel session, but I cannot figure out how to export them all for ...
6
votes
1answer
296 views

An alternative to subscripts?

Are there any good alternatives to using subscripts to keep track of and uniquely identify many variables? I know that subscripted variables behave badly. Thanks!
5
votes
2answers
292 views

Unexpected interpretation of a variable with subscripts

I am new to Mathematica and encounter the following problem. Define two variables g = 1 and Subscript[g, 1]= 1. If we execute $...
5
votes
4answers
4k views

How do I write subscripts in the middle of a string? [duplicate]

As stated in the tile, I want to have a subscript in the middle of a sting, but StringJoin does not allow ...
5
votes
2answers
152 views

How to stop Mathematica from deriving index? [duplicate]

If I have two variables $k, k_x$ with $k_x\neq f(k)$, it is obvious that $$\frac{\partial k_x}{\partial k}=0$$ In Mathematica, I need the Subscript[] function to ...
5
votes
1answer
111 views

«Hidden rocks» of the algebra of indexed values

Some time ago, our community generally believed that one should avoid operating indexed variables such as Subscript[a,1]. I remember to have several times adviced ...
5
votes
1answer
53 views

Plotting with sub and superscripts on the PlotLabels

Bug persists through 12.0. I'm trying to produce a plot with PlotLabels that include sub- and superscripts. However, I haven't been able to do it consistently. ...
4
votes
2answers
1k views

Mathematica can't differentiate when variable name has subscript component

I am not pasting my input code here since the website modifies my code. Instead I am attaching a screenshot of my notebook. Issue: I enter two separate commands (asking Mathematica to differentiate ...
4
votes
1answer
169 views

Does using subscripted variables decrease the performance of Mathematica?

I tried integrating two equation with the same structure, the first equation fails to evaluate completely - the answer is still in terms of integration. The second integration evaluated fine. The only ...
4
votes
4answers
1k views

Subscripted (or superscripted) variables in Mathematica

When I first learned of Mathematica and started to use it, I soon discovered that Mathematica supported subscripted and superscripted variables such as $M_{i j}$. Naively, I first thought that I ...
4
votes
3answers
126 views

How to pull out negative signs through subscripted variables while displaying output in traditional form?

I am trying to get an expression to display correctly in TraditionalForm, with the negative sign in front of other symbols: ...
3
votes
2answers
107 views

Creating an Array with Subscripts and Superscripts

I would like to figure out how to construct an array using subscripts and superscripts based on the following info: ...
3
votes
2answers
371 views

assign 2 letters in a subscript

Suppose I want to solve an equation for the matrix elements of $\bar{W}$: $$\alpha W_{ba}+\beta W_{bb}=x; \alpha W_{aa}+\beta W_{ab}=y$$ Using the syntax ...
3
votes
2answers
107 views

How to extract the subscript from a variable?

I simply want to be able to assign the subscript from something like Subscript[x, 1] to a new variable. How should I do this?
3
votes
1answer
465 views

How to "clear" the downvalues of a subscripted variable?

I have a function that sets certain subscripts of the symbol aa as in the following example: ...
3
votes
1answer
106 views

Generate C code from symbolic computation in Mathematica

I am doing some tensor multiplication operations and would like to have Mathematica generate C code so that I can use it later. I want to supply two 2nd order tensors(A and B) and get the entries of a ...
3
votes
1answer
142 views

Symbolized, Subscripted Variable Doesn't Look Pretty

Background I'm trying to programmatically generate a subscripted variable in a way that makes it appear "pretty". Here is a minimal working example that shows some strange behavior I'm ...
3
votes
1answer
38 views

Symbolic ticks with subscript - ListPlot

Is it possible to rename ticks with a name like this: "$0.125 \, V_{FS}$"? In the below code I wrote "$0.125 \, V$", I don't know how can I insert the subscript. ...
3
votes
3answers
307 views

Simplification behaviour of subscript expression: is this correct?

Why does the code (Mathematica version 10.0.2.0, Linux x86-64): Subscript[Subscript[S,i],j] Subscript[Subscript[S,i],j] // Simplify output the expression: $(...
3
votes
2answers
183 views

How do I convert Subscript[a, 1] Subscript[e, 1] into Subscript[a, 1] Subscript[f, 1]?

I have a series expression like x = a0 + a1 e1 + a2 e2 + a3 e1 e2 and I wish to convert all instances of e1 into f1. The series is subscripted. If there are no subscripts, then the following answer ...
3
votes
1answer
137 views

Using ParametricNDSolve with n subscripted functions

I want to calculate trajectories of an n-pendulum. For the number n=1 it's just a pendulum, for n=2 a double pendulum , for n=3 a triple and so on. The Solver has to solve n equations for the angle. ...
3
votes
1answer
85 views

List all subscripts in an expression

Say we have the following expression: $r_{1,3} r_{1,2}^3 m^2-r_{1}r_{4,2,1}$ (Sorry I had to use TeX, read as Mathematica input notation) I need a function that lists all the subscripts of $r$. ...
3
votes
1answer
201 views

What role to sub/superscripts play in Mathematica?

I'm not sure I understand the role of subscripts and superscripts in the Mathematica language. For me, the expression: ...
3
votes
0answers
61 views

Different output to Solve command in Mathematica changing a variable for a subscripted variable

I have a system of equations that is solved with the Solve command in Mathematica 10.2, when one of the variables is changed for a subscripted variable the answer is not the same, the difference is ...
2
votes
3answers
297 views

How to avoid Replace substituting subscripts?

I have a polynomial in $\rho$ with many parameters (I will omit the polynomial code in the Mathematica expressions below because it is too long): $$ \rho ^3 J (\mu +1) \left[(A \delta \tau _0+B (1-\...
2
votes
1answer
105 views

Changing the elements of the list based on subscripts

Say I have a list of lists: {{Subscript[a,1],Subscript[a,1]+Subscript[a,2],Subscript[a,-3]}, {Subscript[a,1],Subscript[a,-2],Subscript[a,-4]}} Now, in the ...
2
votes
1answer
127 views

Variables with both super-subscripts on the same vertical axis [closed]

When writing out a variable with both a subscript and a superscript, such as: Subscript[Superscript[f, a], b] one has that the "b" letter is "pushed" to the ...
2
votes
1answer
210 views

Notation package with Traditional Form

I symbolize subscripted variables with the form TraditionalForm, to enable easy use of TeXForm as suggested here: ...
2
votes
1answer
193 views

How to treat Subscript objects as constants when using D

I want to define a constant vector {$k_x , k_y , k_z$}. The problem is that Mathematica gives me D[$k_x$,x]$=k_1$. I want this to be zero, because $k_x$ is a constant. Clearly D[$k_x$,x]$=k_1$ makes ...
2
votes
1answer
59 views

Replacing product of powers of subscripted symbol

I have an expression that involves subscripts, powers and products, for example: $3(m-1)^2 \alpha_{a,b}^c \alpha_{d,e} + n \alpha_{f,g}^h$ (Sorry, I had to use TeX, but read it as mathematica input ...
2
votes
1answer
45 views

Problem with superscript

I would like to know if there is option to make such scrpits like in this picture below. Is option to put letter instead of a *?
2
votes
1answer
347 views

Making subscripts with variable

How do I make a variable $k_{1x}$ where the $x$ is just a label to denote the magnitude along the x-axis and not an actual defined variable x in the code? Similarly, if I wanted to make $E_x$ or $E_{...
2
votes
1answer
67 views

Writing a variable-labelling function that will subscript a specific variable in a derivative or other function?

I have made a function which takes any expression and should replace it with one whose variables are identical, but replaced by those with a chosen subscript (inside the "{}" part goes a set ...
2
votes
1answer
149 views

How to sort subscripts of symbols in an expression?

For example, I want to change expr1 into expr2. I am pretty sure I can do this using nested loops to find and then modify terms with subscripts, but that is clunky, old school thinking. Is there a ...
2
votes
1answer
129 views

How to set a symbol indirectly?

I have a symbol, say x, whose calculated value is a 2nd symbol. How can I set the 2nd symbol to a given value? For example, say the value of x is one of the symbols a, b, or c. If it is a, I want to ...
2
votes
0answers
79 views

Unable to solve for variables with subscripts [closed]

ΔF = 0.0025; Subscript[R, s] = Quantity[0.8, "SolarRadius"]; P = Quantity[8, "Days"]; When I solve for Rp ...
2
votes
0answers
108 views

ParametricPlot and ParametricPlot3D crash with subscript notation

Bug introduced in 11.0 and persisting through 11.2 In all previous versions of Mathematica, the following works perfectly well: ...
2
votes
0answers
3k views

"neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing" - NDSolver Problem [closed]

I'm currently working on a simulation of n linked pendulums and I'm using the Euler-Lagrange Equations to solve the problem. As I compile this error appears several times: "ReplaceAll: {{}[[1,1]]} is ...
2
votes
1answer
83 views

How can I append a subscript? [closed]

In a symbolic computation I might get a symbol b to be a subscripted variable with n subscripts; for example ...
2
votes
0answers
103 views

Subscript vs. Brackets [duplicate]

I'm used to using Ctr+_ to create indexes for variables (which evaluates to something like Subscript[a,i,j]), but on this site I ...
2
votes
0answers
575 views

Defining a function with a subscripted head

How can I define a function with subscript? Forexample: f_alpha[x] = 2*x
1
vote
3answers
104 views

How to replace the number of each element of a matrix with a subscript?

I want to get the matrix as Figure 2. There should be two ways to achieve the result. There is a matrix as Figure 1, and change it to the form of Figure 2. Generating the matrix as Figure 2 directly....
1
vote
1answer
148 views

Problems with Subsuperscript and Subscript Combination [closed]

I have a 3D figure, not important what it is, and I have the following code for the Z axis of this figure: ...
1
vote
1answer
371 views

Converting the subscript of matrix name to a variable

I want to change indices of matrix name during loop for creating different matrices. For example; ...
1
vote
2answers
146 views

I want to set $x = \{x_1, x_2, \cdots, x_n\}$

I want to get $\{x_1, x_2, \cdots, x_n\}$. I want to use the $x_i$ as a variable. The following code did't work. ...
1
vote
1answer
140 views

Automatic variable naming

I am trying to construct a complicated code in which I need to name a lot of variables and their definitions. For Example: The problem is as follow: Once I insert new variable in between two, I ...
1
vote
2answers
4k views

The partial derivative symbol with subscript - what does it mean and how do I type it?

The guide that I am using to study Mathematica tells me to type the following to get I am stuck at the partial derivative symbol because I do not understand what it exactly means with the ...
1
vote
3answers
65 views

Variable subscript in AxesLabel [closed]

I am calling $y_{n}=x^{n}$ and I want to plot $ln(y_{n})$ for a number of different integer values of $n$ (I know this is very simple- it's actually a much simpler version of what I'm actually trying ...
1
vote
1answer
109 views

Problem displaying Killing equations

What I'm trying to do is to compute the Killing equations and then solve them using DSolve to determine their solutions. I have a problem understanding where my Mathematica program doesn't work ...