Questions tagged [variable]

Questions on the use or manipulation of Mathematica variables (i.e. names associated with a changeable value). Use [variable-definitions] or [assignment] for questions on variable context localization, or assignment.

Filter by
Sorted by
Tagged with
0 votes
0 answers
40 views

Identify a condition among variables that satisfy an inequality

I have a symbolic function that produces the output a = (1 - e - mu/n) Log[(1 - e - mu/n)/(1 - mu/n)] + (e + mu/n) Log[((e + mu/n) n)/mu] If I substitute ...
Dotman's user avatar
  • 376
0 votes
1 answer
63 views

A specific usage of "Solve" function [duplicate]

It is something from Simplifying polynomials with conditions on variables, that intend to minimize the number of variables. The problem is the usage of ``Solve". I know how to solve equations, ...
InFei's user avatar
  • 115
0 votes
0 answers
44 views

how to use subscripted variable such as a_i as the control of Manipulate?

I'd like to define a series of variables called $l_1$,$l_2$, etc., in Mathematica, using the "ctrl+_" shortcut. Moreover, I want to use these variables as the controls of a Manipulate[] ...
larry's user avatar
  • 695
1 vote
1 answer
76 views

How can I define a function with a variable with subscript?

I want to define a function in Mathematica: $$h(\tau_x)=\tau_x$$ $\tau_x$ has no special meaning. To be honest, it's totally OK if I use the function $h(x)=x$ to replace $h(\tau_x)=\tau_x$. It doesn't ...
Xiangyu Cui's user avatar
1 vote
2 answers
97 views

Generate family of linear inequalities from vector variable for use in `FindInstance`

Suppose that I have a vector variable xvec = Array[x, 10]. How do I generate the family of linear inequalities $$F = \{ {x\in\mathbb{R}^{10}:x_1\geq x_2,\ldots,x_9\...
rrrrr's user avatar
  • 125
0 votes
1 answer
25 views

sum elements (variables) of a vector variable [closed]

I would like to sum elements of a vector variable, e.g., Is xvec = Array[x, 10] s24 = Sum[xvec[i], {i, 2, 4}] where $s_{24}:=\sum_{i=2}^4 x_i$. However, I am ...
rrrrr's user avatar
  • 125
0 votes
0 answers
38 views

Invalid Variable Error for Solve When Using Law of Cosines

I'm making a shadow simulator, and am using the Law of Cosines to calculate a certain angle in a triangle with two known widths and one known angle. I'm using Solve ...
LonelySpaceman's user avatar
2 votes
1 answer
60 views

Problem with integration with indexed variable

I wonder why I can not have a correct integration form on Mathematica with some indexed variables. Indeed, when I write : ...
Nathan Gege's user avatar
0 votes
3 answers
114 views

Conflicting variables

So, I read a set of variables and respective values from a file and store them in a variable specs = {{"Type", "KP", "fp"}, {"LP1", 2, 2000}, {"Type", ...
Granger Obliviate's user avatar
2 votes
5 answers
238 views

Repeating definitons of variables

I have the piece of definitions y = 1; x = 2; n = 2; a := (y^(x - 1) + n)/(y^(x - 1) + y^(x - 2)) I want to keep defining y as a by doing: ...
CAN GÜLLÜ's user avatar
0 votes
0 answers
64 views

Answer changes slightly when re-run

I am trying to resolve why I get slightly different answers when I re-run my notebook. Here is my full code: ...
LTB's user avatar
  • 1
1 vote
3 answers
76 views

Local variables in a module don't show their actual values

I need to do the following transformation that pick[a,b] -> ex[c|->{c[a],c[b]}] ex is a function that accepts a function as parameter which returns a list ...
Gqqnbig's user avatar
  • 307
7 votes
1 answer
179 views

How to Obtain Complete List of Properties

I am working with Matrix Market matrices in Mathematica (specifically GEMAT12), and I saw from other posts that you call properties of a variable exemplified below: ...
Chloe's user avatar
  • 105
0 votes
0 answers
69 views

Can you dynamically create variable names in Mathematica? [duplicate]

I was wondering if there is a way of Mathematica to read a string or number and create variable with that name. For instance imagine that I have a file with the word data1. I would want to create a ...
Granger Obliviate's user avatar
2 votes
0 answers
72 views

how to understand the locality of variables in Mathematica

(in the first i should say may be the title is not very accurate) how to understand case like the following: ...
Aerterliusi's user avatar
2 votes
0 answers
69 views

a basic question about variable in Mathematica

I can't describe exactly the problem I'm experiencing, but this kind of problem has a remarkable feature, that is, commands which couldn't work in the before can be executed correctly when i turn off ...
Aerterliusi's user avatar
3 votes
1 answer
278 views

Does Mathematica have that function which returns the variables back [duplicate]

Does Mathematica have this function where I can give a system of equations as an input and the function return back to me the variables which were included in that system. For example: input Function[...
Math View's user avatar
3 votes
1 answer
189 views

How to use <* *> in tex to substitute mathematica variables [closed]

I am generating tex files with a "for" loop in Mathematica. In each file I need to have different quantities. So I am defining a variable in Mathematica, which is is evaluated during each ...
Stoyan Apostolov's user avatar
0 votes
0 answers
53 views

SolveAlways with functions as fixed variables

I have an expression that looks like this: c1*dot[p[1],p[2]]+c2*dot[eps[1],p[2]]+c3*dot[p[1],S,p[2]]+...==dot[p[1],p[2]]+... i.e. an equation where in the left ...
Marcosko's user avatar
  • 239
1 vote
0 answers
83 views

Internal variable in Sum inside a function [closed]

I am writing a simple function which performs a sum, but run into an unexpected answer. ...
Lelouch's user avatar
  • 479
3 votes
4 answers
432 views

Define a delayed function depending on a global variable as though the variable's contents was pasted

Problem Say I previously defined a variable (maybe through some extensive calculation) thing = (a+x)y Then, I want to use that expression elsewhere. In general, I ...
ions me's user avatar
  • 751
5 votes
1 answer
214 views

Is it necessary to use Print inside a Block? [closed]

If I use a Block with variables already used and ask it to Solve an equation inside the Block...
RoberRM's user avatar
  • 319
0 votes
0 answers
21 views

Replacing System` definitions in a context whilst still maintaing acces to them [duplicate]

Given the system operator TensorContract I can define a new one, TensorContractLazy with the attribute ...
user3257842's user avatar
0 votes
0 answers
45 views

Reusing local variables through Reduce and ToRules

Problem: I am interested in solving a system of linear equations through Mathematica. In my current test scenario, I am having trouble using the Reduce function followed by the ToRules command. I ...
Axion004's user avatar
  • 111
1 vote
0 answers
33 views

How to best query if an expression contains Symbol/variable

Say I have this expression, among many: ...
Tempus Nomen's user avatar
1 vote
0 answers
79 views

Why =. is not clearing the value of a variable in this case? [closed]

I am reading "Mathematics and Algorithms" as part of the Wolfram Tutorial series. In "Values for symbols" section of the "Algebraic Calculations" chapter it is described ...
M.E.'s user avatar
  • 323
0 votes
1 answer
49 views

Function of two variables - how to supress one variable dependency

I have this equation i would like to solve: e0 = (2 \[Alpha]1g)/((1 - v1g) (c^2 - b^2)) Integrate[r \[Tau]1[r, t], {r, b, c}] - (2 v1)/E1 A1; Function e0 ...
U.Grammy's user avatar
0 votes
0 answers
67 views

How to define variables properly in mathematica, a variable with two name [duplicate]

I wanted to define a variable in the name "beam_frequency", this is quite possible in other programming languages like python and Matlab. How to define two pair variable name in Mathematica ...
Nanavanalla's user avatar
2 votes
2 answers
336 views

Would it be poor advice to assign roman numerals as top variables?

For example like so. x = 10; xi = 11; xv = 15; Is there an automated way to spit these numbers out maybe 1-1000.
William's user avatar
  • 7,565
2 votes
2 answers
100 views

Rewriting an expression while using another parameter

I wish to rewrite V and M with the given A. I have provided what the end result is supposed to look like. Here is V ...
user128616's user avatar
0 votes
0 answers
41 views

Scaling a variable multiplied by power series is not giving expected output

I have a power series getting multiplied by a variable, which gets scaled by the small parameter used in the power series. As an example, in the following dummy series: ...
Manpreet Singh's user avatar
2 votes
2 answers
100 views

How to plot the perimeter of an ellipse where the variable is its eccentricity?

I'm basically just trying to plot a function where the x value is the eccentricity of an ellipse and the y value its perimeter. I've tried first defining the eccentricity ...
kat's user avatar
  • 21
0 votes
1 answer
82 views

How to define prefix that can turn numeric?

I put these prefix in my init.m file. First I Unprotect all these symbols, set values and then ...
hana's user avatar
  • 2,678
1 vote
1 answer
147 views

Solving for linear combination of variables

I have a set of constraints on nine variables, ...
Dotman's user avatar
  • 376
5 votes
5 answers
883 views

List of letters longer than the alphabet

I would like to create a list of the first $n$ letters of the english alphabet. Importantly, I would like that in case $n$ is bigger than the size of the alphabet, the letters will start repeating in ...
Federico Carta's user avatar
0 votes
1 answer
178 views

How to convert mathematica root expression to readable one? [duplicate]

I am trying to find out at what regions a function is monotonically decreasing. The function is a function of X and has two more variables epsilon and B with the constrains 0 < B, 0 <epsilon< ...
TTT's user avatar
  • 35
0 votes
0 answers
78 views

Cannot Optimize where NSolve and NDSolveValue are involved with Multi-Variables

My Objective Function is Sqrt[Sum[((sol[[j]])^2), {j, 1, noofnode}]/noofnode] with variables v1, v2, v3, v4, v5, v6. But just ...
Sazedur Rahman's user avatar
0 votes
1 answer
116 views

How to change the values of a parameter within the domain in NDSolveValue?

In the following code, e is constant within the domain. But I want to change the value of e continuously within the domain. For ...
Sazedur Rahman's user avatar
0 votes
0 answers
125 views

How to Optimize a Finite Element Model with Multiple Variables in Mathematica?

Urgent Help, Please !!! I am attaching my codes for a Finite Element Model which needs to be optimized and the Objective Function ("of" in the code) has been mentioned at the last line of ...
Sazedur Rahman's user avatar
0 votes
0 answers
498 views

Help with Error: Recursion depth of 1024 exceeded during evaluation

I am quite new to Mathematica. Please excuse my mistakes. I would appreciate if you could help me with the following set of commands. ...
grkcn's user avatar
  • 1
0 votes
0 answers
41 views

how to delete a variable programmatically in a notebook from another notebook

how to delete a variable programmatically in a notebook from another notebook? c = b; I have already tried Remove[c] but ...
Mohammad Shahbazi's user avatar
2 votes
1 answer
43 views

Arrange an expression based on variables' names

I have a problem of arranging an expression as shown in the following picture. The first expression exp is derived from other functions and equations. I want to get ...
likehust's user avatar
  • 663
3 votes
1 answer
124 views

Partial derivatives in a variable name

I would like to create variable with names of the form \[PartialD]g and \[PartialD]\[PartialD]g. Is there any way to do this?
Jonathan Shock's user avatar
1 vote
0 answers
84 views

Full Information Maximum Likelihood - Under some other name in Mathematica

I have recently stumbled upon something called FIML - Full Information Maximum Likelihood. Apparently this methodology helps overcome missing variables provided the gaps are random. Searching the ...
Rogo's user avatar
  • 790
5 votes
1 answer
149 views

What Does this Syntax Mean in Ouput from DSolve?

When I run the code DSolve[y*D[f[x, y, z], z] - z*D[f[x, y, z], y] == 0, f[x, y, z], {x, y, z}] I get the following output. I don't understand this syntax. I ...
Just Some Old Man's user avatar
0 votes
2 answers
75 views

Integrate of simple equation but is not solving!

I have this simple integral but I don't know why Mathematica can't solve it?! FullSimplify[Integrate[x/(-x^2 + a x + b)^(1/2), {x, Sqrt[b], Sqrt[R^2 + b]},Assumptions -> {a > 0, b > 0}]]
Mathecis's user avatar
  • 143
3 votes
2 answers
179 views

Making a list of variables

Consider the following code, which give a Manipulate object that returns the "total" of a certain variable var 1 ...
sam wolfe's user avatar
  • 4,187
2 votes
0 answers
70 views

Extracting variables [closed]

Similar to this perhaps, but I prefer a built-in function. I have defined the expression L = a*b*c. Is there a Mathematica function that can identify and extract ...
Mike's user avatar
  • 21
2 votes
1 answer
556 views

How to replace the arguments of a function?

I have the following type of (very long) expression: $$\ldots + X[1,2,3,5] + X[2,4,5,6] + \ldots \tag{1}$$ where $X[a,b,c,d]$ is some undefined function. I would like to replace all the occurrences of ...
Pxx's user avatar
  • 681
2 votes
1 answer
153 views

Coloring all the variables with the same name with the same color

I would like to know if there is a possibility to automatically color the variables with the same name with the same color. For example, like in the picture below: Right now I need to do it manually ...
Andris Erglis's user avatar

1
2 3 4 5
7