Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
119 views

Can I bake my own PI using your Wolfram language oven and prebuilt utensils? [closed]

How might I override the value of the Greek letter PI within various builtin language functions in the Wolfram language? Specifically and without having to reinvent the wheel or code equivalent ...
0
votes
1answer
67 views

Computing an integral : Mathematica seems to say it's diverging or not defined and I think it is

I would like to compute : Element[a, Integers] Element[b, Integers] Integrate[Exp[-a^2*(x (1 - x/b^2))^2], {x, 0, Infinity}] which is obviously not diverging. ...
0
votes
1answer
23 views

Inequality with assumptions

I would like to find 2D region formed by $(a,c) \in \mathbb{R}^2$ such that the inequality $f(a,c,x,y) \geq 0$ holds for all $x,y \in [0,1]$. If I solve this inequality with reduce of the form ...
0
votes
1answer
27 views

Factoring out a parameter

I have some function: f[a_,b_,c_]:=Sqrt[a^2+b^2+c^2] Is there a way that I can factor out parameter (variable) b like this: <...
1
vote
1answer
53 views

What is the recommended way to plot a function with a dependent variable?

I am currently learning the basics of Mathematica. I can't seem to find a straightforward answer in the Wolfram documentation, probably for a lack of clarity in my queries. For example, I want to ...
1
vote
1answer
36 views

Question about ListPlot of variables [closed]

My question is trivial but I don't seem to be able to get the answer. Suppose that I do a numerical computation (division of some numbers that come from the numerical solution of an NDSolve or ...
3
votes
2answers
48 views

Using Symbolize to Convert Multiple Variables at Once

So, I have created a list of subscripted and overdotted variables that I would like to symbolize, so I run them through a for loop. Seems to me that this would work? Any help is appreciated. ...
6
votes
0answers
62 views

Nested rules and automatic renaming of variables [duplicate]

I understand why $ happens here: ClearAll[foo] foo[a_] := (x_ :> a x) foo[1] ...
1
vote
2answers
79 views

Possible to solve this function?

I have this function: Emax[T_, d_] := -(1/2) + d + d/(-1 + E^(d/T)) - 1/2 Coth[1/(2 T)]; All I want is to transform this Function so I get: ...
1
vote
2answers
48 views

Showing variable values on a 3D Plot

I am running a 3D plot a 100 times to show the dynamics of two undetermined variables (cM and cR) for a 100 values of ...
0
votes
1answer
21 views

Extract and name PNG's from loops [duplicate]

I want to extract PNG files and name them depending on the dummy variable of a loop. For example, starting from ...
0
votes
0answers
32 views

matrix perturbation general formula with random values

Is there a way to generate an arbitrary-sized diagonal matrix of variables, not numbers, in mathematica? Probably unnecessary context: For a research question I'm pursuing, I want to find general ...
0
votes
1answer
33 views

Use Solve for two Functions to find 1 common Variable

I have 2 functions that look like this: F[t_,d_]:= 10+t+2d G[t_,d_]:= 5+t+d I'd like to solve this in such a way to know for which t both Function have the Same value. I assume that this won't be ...
17
votes
2answers
311 views

When to name a variable with $

There are some symbols in the Wolfram Language that start with $, including $Abort, ...
1
vote
1answer
43 views

Mathematica is picking up variable definition from other files

Mathematica is using definitions from other open files in the same folder. I want variables not defined in a particular file to be treated as undefined variables. I do not want Mathematica to pick ...
0
votes
0answers
25 views

What's “expr”, “opts”, “s”, “uspec” in Names[“Global`*”]

SYSTEM: Win7 SP1 X64 Eng - MMA X64 On a very random occasion, I did something and some undesired result came up. So I checked Names["Global*"]`. All I had ...
0
votes
0answers
25 views

Problem in importing function in NDSolveValue

I have a code for solving a system of 2 differential equations (sol1). Given that what's inside is a bit heavy, I define functions so that I can call them. My issue is that when I write everything ...
2
votes
2answers
86 views

Define a function of a function of an arbitrary variable

I want to define a function called int that takes another function as an argument and yields an integral of that function from 0 to 1 (just for example). So I ...
0
votes
1answer
28 views

Plot interpolating function depending on free variable inside manipulate

I create an interpolating function which depends on some free variables. I then want to plot it inside a manipulate, but my output is empty. What am I doing wrong? ...
0
votes
1answer
34 views

Altering the Values of Global Lists Within Tables

Say I have some lists: list1 = {4} list2 = {2} list3 = {6} list4 = {9} list5 = {7}. I want to alter them in a table like so: ...
0
votes
1answer
50 views

Solve an equation with two specific domains?

In Solve an equation with specific domain? I asked how to write a code in Mathematica with one specific domain for one of its variables. Now I have a questions: If two of the variables are from ...
1
vote
2answers
102 views

Solve an equation with specific domain?

How can I write a code in Mathematica to solve an equation with variable in specific domains? For instance, I want to write a code for ...
-1
votes
2answers
87 views

How to replace Variable With Variable [closed]

Clear[a, b, c]; a = c; a =. ; b = a; b =.; c = b; c =.; Print[a, b] and the result is {a b} but I want the result ...
0
votes
1answer
69 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
1answer
44 views

Using Variables[] as the argument of Plot[]

I want to use the Variables[] function to extract the name of the variable of a function, such that I can use it later, e.g. in a ...
0
votes
1answer
49 views

How to plot solutions for simultaneous equations

I have 2 simultaneous equation of $x$ and $y$. Here is how I solve it, and it works. But I want to vary the parameters n and ...
2
votes
1answer
64 views

Relabeling and matching variables (in MultiplicationTable)

Suppose we have a set of data given here as the multiplication table of 8 elements labeled {1,2,3,4,9,10,11,12}: $$ \begin{array}{cccccccc} 1 & 2 & 3 & 4 & 9 & 10 & 11 & ...
1
vote
1answer
56 views

Use Manipulate for a global variable

I do have a global variable called w1, which is used as a factor in a dataset, however I want to make this factor dynamic. ...
0
votes
1answer
49 views

How can I evaluate a function using the results of Reduce?

Can I use the output of reduce to define a variable in a function definition? In other words, can I somehow skip the step where I manually enter t:=2? ...
0
votes
0answers
31 views

assigning numerical values to variable

I have a csv data file, has two columns of data. First column denotes time (t) and the corresponding value in the second column is flow rate (f). I would like to assign these values to an array f[t], ...
0
votes
0answers
97 views

What are the valid symbol names for packages?

Regarding to the message: ...
1
vote
0answers
46 views

Execute a notebook with a changing variable

I have created a notebook with one fix variable that I want to run from 1 to 100. Every time the whole notebook (all cells) shall be executed for the given number. At the end of the notebook, it shall ...
0
votes
1answer
56 views

Issue with variable recognition

Why are the variables r,s,u,v identified differently in the definitions of F2,G1,G2?
1
vote
1answer
81 views

How to evaluate user-defined functions with variables?

I have an extremely simple question, but I couldn't find anything anywhere, maybe I didn't know what to search for, so feel free to mark it as duplicate if there is a duplicate. Let's say that I ...
0
votes
1answer
51 views

Create an array of independent variables of variable size, all dependent upon the same dependent variable

I have an array of variables that I've constructed, that all depend on time s ...
0
votes
2answers
47 views

How can I create a row matrices of large dimension by a code? [closed]

I am trying to figure out how to create a function that can create the row matrix pattern below. co = {{a1, a2, a3, a4, a5, a6, ...., a100}};
3
votes
0answers
276 views

Multiple variable assignment from a list

For example in Python, if we have a list of 3 elements, say ls = [1,2,3] and we want to assign a variable to each value (from left to right), one can do as follows: ...
3
votes
2answers
162 views

Combining Multiple Lists

Let's say I have 4 lists: list1 = {a,b,c,d}; list2 = {e,f,g,h}; list3 = {i,j,k,l}; list4 = {m,n,o,p}; I can combine them using Join ...
0
votes
0answers
72 views

Is there in Mathematica something like class in Java or struct in C? [duplicate]

I am new to Mathematica and I am very impressed with its features. Although I don't understand how to do a simple thing: for example, I want to create few point variables (say a,b,c,d,e), each storing ...
0
votes
0answers
42 views

The conditions used in Sum or ParallelSum: Calling a function/variable

For some reason, I encounter a problem when doing the Sum and ParallelSum (or doing the Do or ParallelDo, e.g. such as the issue here), I figured that the potential cause of the problem can be ...
0
votes
0answers
19 views

Write vector with variables and calculate its norm in terms of the variables [duplicate]

I have a vector v defined as follows: v[x_] = {0.5, 0., x} I calculate its norm, and expect for it to be ...
0
votes
1answer
76 views

Solving an equation of two variables by looping over different values for one variable [closed]

I have a function: f[x_,y_]=x+y. I would like to loop over some values of x, and solve for y ...
1
vote
1answer
39 views

Numerically solving a system of three nonlinear equations by predefining functions [closed]

I have three functions of three variables, f1(x,y,z),f2(x,y,z), and f3(x,y,z), and I'm ...
6
votes
1answer
178 views

Tremendous bug using EstimatedDistribution (using NMinimize) in v8.0 and v10.2

Let's define F4 and estimate the distribution of the data: ...
1
vote
3answers
138 views

How to extract variables with time subscript and their coefficients

I have a expression of the following form: $$x_{t}=a_{0}+a_{1}x_{t-1}+a_{2}y_{t-2}$$ where $a$'s are just coefficients and anything with time subscript is a variable. I would like to have list of ...
0
votes
0answers
46 views

to reduce the unknowns of a set of equations with several symbolic coefficients, e.g. using the GroebnerBasis

I have a set of $4$ equations with $4$ unknowns $\theta_1$ to $\theta_4$, and would like to eliminate the number of unknowns, to get a smaller set of equations, e.g. $n$ equations with $n$ unknowns, ...
0
votes
0answers
218 views

Extract fit error from parameter table to use as a variable

Is there anyway to extract the fit error and store it in a variable. I have done something similar to use actual fit results as ...
0
votes
0answers
29 views

function restorage problem [duplicate]

Code below f[1, 1] = 1; f[1, 2] = 2; f[1] = Min[f[1, 1], f[1, 2]] Outputs 1 However, the desired output is ...
0
votes
1answer
38 views

Taking variables from string

In a mathematica operation I am getting the o/p say, 1->2. For the next step, I want to use these two numbers as variables, say take them as 1 = m and 2 = n. How can I do it.
1
vote
2answers
86 views

variable dimension table

(A very simplified version of my code:) How can I create a Table[] with a variable number of dimensions, e.g.: ...