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.

211 questions
Filter by
Sorted by
Tagged with
30 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 ...
41 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 ...
33 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$....
344 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 ...
35 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 ...
81 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 ...
451 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] ...
34 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: ...
424 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). ...
79 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. ...
29 views

Saving variable inside Manipulate command

I have been working in a plotter using "manipulate", I let the code below. However, I would like change between different kind of "options" that I will add them after, the problem is when I change to ...
70 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 ...
64 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 <...
83 views

Problem with fitting

So I have a very simple question related to a simple topic, but also directly related to a fitting problem. I see that my question is related to this question but I don't manage to make the bridge ...
54 views

I have ...
59 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: ...
37 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 ...
31 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 ...
129 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 ...
34 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] ...
22 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.: ...
70 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, QA, etc. and small letters like ica[1,2], tr[2,3] etc. And I have ...
911 views

Get all variables in an expression with Variables[] [duplicate]

"ϕ" <> "1"; Variables[%] Exp["ϕ" <> "1"]; Variables[%] Exp[Subscript[ϕ, 1]]; Variables[%] Say I have lots of variables used for construct an ...
47 views

Apply different PlotStyles to functions with functions as variable [closed]

I have a function func[expr,var] with which I want to plot the list expr[var] and have different styles applied to it. When ...
4k views

Extracting variables from an expression

I'm looking for a way to extract a list of variables from an expression, for example with an input like: ...
52 views

How to show the answer in terms of another variable

if we have A = 1; B = 44 + 1 output :: B = 45 how we can show B like this output :: B = 44 + A
47 views

Rearranging similar terms in an equation

In a piece of code I am writing, I run into an equation of the form ...
47 views

57 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 ...
26 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 ...
38 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 ...
333 views

53 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 ...
33 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 ...
120 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 ...