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
1
vote
1answer
92 views

How to obtain non-trivial solution?

I have the following system of equations. $ quad\quad\quad\quad u+\alpha v+v+e^{\frac{i \alpha }{2}} (\alpha -1) x=\alpha u+e^{-\frac{1}{2} (i \alpha )} (\alpha +1) z, +u+v=\alpha (v+w)+w+y, (\...
0
votes
0answers
58 views

Using an if statement to assign a value to a variable

New Mathematica user here. I'm using some code from a colleague and editing it to give me more specific results in finding the zeros of a complex polynomial. I am attempting to find a way to assign a ...
3
votes
2answers
57 views

Better way for constant expressions in functions than storing as global variables?

For example, I wrote a function like this: inversions[list_] := Complement[ Subsets[{1, 2, 3, 8, 4, 7, 6, 5}, {2}], Subsets[list, {2}] ] But as you see, ...
0
votes
0answers
27 views

Simplifying the following equation in variable power [closed]

I have been trying to solve this functional equation for $a_F$ in terms of $\mu$ and the other variables. But for some reason either Mathematica is taking too long of a time to solve, or it just ...
4
votes
1answer
47 views

Name of patterns cast as expressions from strings

I'm trying to match a part of a string while imposing conditions on the patterns, e.g.: StringCases["223", a: DigitCharacter ~~ b: DigitCharacter /; Unequal[a, b]] ...
0
votes
2answers
71 views

Integration result depending on variable name

From previous threads I have read on the subject, it seems that Mathematica is known to simplify expressions to varying degrees depending on alphabetical order of chosen variable names. But none of ...
1
vote
0answers
33 views

How to return a variable name and value from within a self-contained function block?

Abstract: I have viewed other solutions on StackExchange but none actually address using a fully self-contained function to return name and value of a variable. The only function that works requires ...
3
votes
3answers
333 views

Creating a List of Symbolized Indexed Variables

I am trying to creat a list of indexed variables (symbols) using the Notation package and Symbolize command. As an example, ...
1
vote
2answers
65 views

Getting the name of a variable instead of its value [duplicate]

I want to get the name of a variable instead of its value in output. Say I have a function in which I have vectors e={1,0,0,1} and ...
4
votes
1answer
54 views

Computing Higher Order Tensor of Variable Rank

The following code takes a vector x of variable length, computes the outer product of the vector with itself to form the matrix $\rho$ of dimension $2^n \times 2^n$....
3
votes
1answer
82 views

Again about Module inside other Module

Let me start with a short preamble. I have a large function (defined through other functions) which I need to integrate numerically. This works. Trying to speed up the process, I played with ...
0
votes
0answers
22 views

How to retrieve variables in the Manipulate's 'dynamic' controller environment

I'm trying to code to generate 'dynamic' controllers and to set initial values (initStart and initEnd): ...
0
votes
1answer
55 views

How to get a function from a numerical integration?

I wold like to know how to get a function from a numerical integration. Here is an example: h[y_?NumericQ] := NIntegrate[y*Sin[Sin[x]], {x, 1, 2}] h[2] Then my ...
0
votes
1answer
31 views

Plot any parametrization (pure function, numbered variables)

I'd like to write a function plot[reg_,f_] that takes as input any product of intervals (list of pairs of reals) reg$\subseteq\!\...
6
votes
4answers
183 views

Assigning a string to variables names

I have the list n1 = {{REL1, "REL.csv"}, {RAND1, "RAND.csv\"}}. That is {{variable name, string}, {name, string}}. I want ...
0
votes
1answer
38 views

Assign variable to solve [duplicate]

I would like to assign my result from equation. I tried /. and := but it gives me empty variable. How can i fix it?
2
votes
1answer
37 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 *?
1
vote
1answer
32 views

Getting a stored variable from its value

Given a numerical value, is it possible to check whether that value is stored in (or defines) some variable in the notebook? Maybe if I could list all of the defined variables, then I could simply ...
0
votes
0answers
4 views

Assigning a solution to variables [duplicate]

I have solved my solution and it has been appeared, it is C1, C2, C3, C4 but when I call C1 again (%13), program shows me that C1,... is not assigned. How can I reapair that ?
2
votes
1answer
39 views

Assign variable array as function input and generate slider inputs for Manipulate

New to Mathematica. I want to be able to input some parameters, do some calculations, and end up with some output in a functional form such as: ...
1
vote
0answers
84 views

Defining a variable to be greater than zero [closed]

I am trying to do some integrals over a region , however this region is going to depend on parameters $ \alpha , \beta $ and when calculating these integrals they give multiple values depending if $\...
1
vote
1answer
56 views

Table of Variables within Manipulate

Given a certain number n, I want to define n controls within Manipulate with the correct ...
2
votes
1answer
63 views

separation of variables in case of vector components

I have a function f in two variables y and theta, where y=z^2+x^2. There are numerical values for x,z,and theta ( x and z are the dimensions),I have to do calculations to obtain the velocity, so I ...
2
votes
1answer
55 views

Store boolean expression into a variable

My purpose is to use a boolean expression as a requirement that a pattern must comply. The requirement is c1 == "a", and I am using it to select a string from a ...
5
votes
4answers
259 views

Name a list with Table

I am struggling to find a way to assign a value from a list to names from another pre-defined list with Table[]. names = {first, second, third} ...
0
votes
2answers
84 views

Use Alphabet[] as a variable in a function

I'm trying to figure out if I can use the letters contained in Alphabet[] as variables for a function. As a simplified example, I'd like to do something like: ...
0
votes
0answers
50 views

Variables for multiple data files plotting using same Mathematica notebook

I am not an expert in mathematica, I have this following code. As you see I import a text file under the name "MyPoint1", plot with "pAll" then I do some more calculation with more variables and ...
0
votes
1answer
31 views

Reading and re-assigning variable

I am trying to create a table by iteratively calculating its values using a temporary variable accu: ...
0
votes
0answers
36 views

ReplaceAll Not Working Correctly

I'm trying to use replaceall to redefine my expression in terms of a separate variable.. ...
0
votes
0answers
38 views

How to restrict the use of variables to the notebook? [duplicate]

I am solving two problems simultaneously in which the variable x is defined. To the left of the image, i'm solving shape functions and matrix operations. But to the right i'm solving Green's function. ...
1
vote
3answers
54 views

Redefine function after change of coordinates (variables)

I wish to define functions of (possibly) several variables and then apply variable transformations in order to obtain a more comfortable expression. But I run into trouble because I need to redefine ...
0
votes
1answer
35 views

Extract variables from sum of unevaluted functions

I have sums of the form sum = a f[1,1,0] + b f[1,2,0] + c f[1,2,1] + ... It is always linear in f[a,b,c]. I would like a ...
0
votes
1answer
45 views

Reversing the flow of the equation sign. Compacting an equation. Choosing which variables to show

Here's a simple example of what I'm trying to get at with that mysterious title. I start off with a Hermitian matrix that I derived analytically ...
1
vote
2answers
584 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 ...
0
votes
1answer
37 views

remove one of the column in the output of Solve command

I would like to remove one variable in the output of the "Solve" command without changing the rest. For instance, in the following code ...
3
votes
2answers
87 views

From f[g[x,t]] to f[g]

How can you change f[g[x,t],t] to f[g,t] ? I have differential equations ...
6
votes
3answers
463 views

How to transform a function from f[#1] to f[x]

So I have this function : Sqrt[-1 + Tanh[#1 - #2]^2] & How can I transform it into f[x_,y_]=Sqrt[-1 + Tanh[x - y]^2] ...
0
votes
1answer
41 views

Functions with Variable Numbers of Arguments: Outer Vector Product

I am trying to write a function that takes a column vector of variable dimension as an input and returns the outer product matrix as an output. What I have tried: ...
3
votes
1answer
589 views

General::ivar 0 is not a valid variable when using Series in Plot

I have been having some trouble graphing a Taylor series approximation (Series). ...
5
votes
1answer
91 views

Make assumption for function with variable argument

I would like to assume that a>t[b_] for any b, such that e.g. Simplify[a>t[c]]==True. ...
2
votes
1answer
83 views

How to read in and assign values from a txt file?

I have a text file that I would like to import into Mathematica - after searching around the internet, I can't seem to find any pages that explain how to do this: The text file containes these four ...
0
votes
1answer
70 views

Table and FindRoot of a 2 variable function of x and t : cos(x + 3t)

I am trying implement mathematica commands: Table and FindRoot, of a 2 variable function <...
1
vote
2answers
67 views
0
votes
1answer
61 views

Five equations to solve 6-variables question, is it possible?

I was given a task to find the value of variable a,b,c,d,e and f. But I'm not sure it is even possible, given that only 5 equations are available. Can anybody point out how to solve these: ...
1
vote
1answer
66 views

How to use a table with two variables as the values for a function with two variables (x and y)? [duplicate]

I'm sorry if this is a dumb question. I am a student and have 0 prior experience with Mathematica or any sort of coding and I have looked at various resources trying to figure it out myself but still ...
0
votes
0answers
33 views

Bounding Solve results to named variables

How can i bound results of my Solve function to variables properly? This metod works but causes unexpected troubles i struggle to resolve ...
2
votes
1answer
138 views

How do I create a variable that uses I?

I'm planning on working with a set of non-linear differential equations. A few of the equations look like: Mathematica tells me that I is protected. Is there any ...
1
vote
3answers
35 views

Simple question about variables into functions

Im trying to write a very simple code that will solve an equation. total = 800; side1 = x; side2 = total - 2 x; f[x_] := side1*side2 f[x] f'[x] Solve[f'[x]==0] ...
1
vote
1answer
30 views

How to define a function, that generates matrix of variables, which can be later used in Reduce?

My goal is to generate matrices, on which I will put different constraints in Reduce funcion, e.g.: ...
0
votes
2answers
71 views

Separating variables in a set of equations

I have a very large set of equations eqs with variables denoted by capital letters like PVA[2], QA[2], etc. and small letters like ica[1,2], tr[2,3] etc. And I have ...

1
2 3 4 5