How to manipulate expressions structurally, not necessarily complying with the rules of algebra.

learn more… | top users | synonyms

-2
votes
4answers
82 views

Converting an expression to function

I have the following problem. I current can automatically create the variable positionPayload, for instance: ...
1
vote
1answer
64 views

Simplifying Expressions for FindMinimum

I am currently trying to apply the FindMinimum function to find the lowest energy of an expression. My current expression as of now is relatively complicated. It is the summation of 48 similar terms, ...
2
votes
0answers
51 views
-1
votes
1answer
44 views

Position not working? [closed]

I have the list: myList={0,0,0,a,b,c,0,0,d} I need to find the positions of all elements that are non-zero. I do like this: ...
0
votes
0answers
49 views

How to replace element by element in a list? [closed]

I have the list: myList={{a,b,c},{d,e,f},{g,h,i}} I need to transpose every element individually, so I do: ...
3
votes
2answers
73 views

Find sub-sets of vanishing additions or subtractions from a list?

Let's say I have a list L containing n numerical numbers. Now I want to find all sub-sets of ...
0
votes
0answers
35 views

Binomial decomposition of a list? [closed]

Given a list L with n elements, I would like to generate all possible unordered subsets of ...
2
votes
1answer
43 views

Dropping rational coefficients

I have a list of expressions (they all are exact numeric quantities, not containing any variables), some of them have integer or rationals coefficients, or complex coefficients with rational or ...
2
votes
2answers
66 views

Trouble simplifying using Replace

I have the following expression: w.a.b.r+w.c.d.r I want to get: w.(a.b+c.d).r So far I used ReplaceRepeated: ...
3
votes
1answer
170 views

Derivatives of functions with arbitrary number of variables?

I am trying to define a function f[x1,x2,...,xn] with n integer but not specified. And then I would like this funktion to behave ...
-2
votes
0answers
45 views

Find list element matching pattern

I have the following list: {A , B.C , B.C.S[d].S.F} I need to find the index of all elements containing S[d].S, i.e. an ...
2
votes
1answer
87 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: ...
1
vote
0answers
44 views

How to remove parts of an expression

I have an expression where terms Transpose[R].R appear. R is a matrix with the property Transpose[R].R=IdentityMatrix[3]. How ...
4
votes
3answers
263 views

How to get a list of monomials of a polynomial without coefficients?

Giving a polynomial, say a x^2 + b x y + c y^2 MonomialList[a x^2 + b x y + c y^2, {x, y}] just gives ...
12
votes
3answers
1k views

How can I transfer mathematical expressions between Mathematica and Maple?

Is there a simple way to copy mathematical expressions between Mathematica and Maple (or at least in one direction)? I mean only expressions built from numbers and predefined mathematical functions, ...
4
votes
1answer
50 views

Boundedness of an expression

First post on this part of the stackexchange network, I was just wondering if Mathematica allows one to quickly see if an expression is always within a certain range given values for the parameters it ...
2
votes
4answers
201 views

Is there a way to use array of data as a function variable?

I have a data that looks something like. {{1,1},{12,1},{7,9},{10,14}, ...... } I want to see if there is an easy way to apply this array of data into a ...
3
votes
2answers
59 views

Factor a specific sub-polynomial?

Consider the following example for a polynomial in several variables: ...
1
vote
0answers
53 views

Sequence of arbitrarily many variables separated by commas? [closed]

I am wondering if it is possible to produce an input such as x[1],x[2],x[3],...,x[n] for an arbitrary but fixed amount of n ...
3
votes
3answers
140 views

How I can count multiplications in an experssion?

Next task to complete: Count *-symbol in such expression as a + s^2*b - c/y + o^3 + n*m*u (in this case count of ...
4
votes
1answer
77 views

What options need to be set for Simplify to perform a certain manipulations similar to FullSimplify?

Simplify performs algebraic transformations and is fast, while FullSimplify tries a wide range of transformations involving ...
0
votes
1answer
31 views

How can I manipulate a long expression to order it by factors/derivatives of a particular function?

I have a Mathematica notebook that generates a linear expression involving derivatives of a given variable. Expanded (and simplified for our purposes), it looks something like this: \begin{equation} ...
1
vote
1answer
48 views

2D plot using Manipulate command [closed]

Can anyone tell me what the problem is with the following code: y[x_ a_] := Sin[x (1 + a x)] Manipulate[Plot[y[x a], {x, 0, 6}], {a, 0, 2}] However, the ...
5
votes
1answer
271 views

Embedding StreamPlot in Graphics3D

I am trying to visualise the action of the infinitesimal generator of a Lie group on the solution of a 2-ODE system drawn in the 3D space (t,y1,y2): t is time and y1,y2 are the two dependent ...
12
votes
1answer
160 views

Is there a way to control which special forms Normal converts?

Normal documentation reads: Normal[expr] converts expr to a normal expression, from a variety of special forms. But is there a way to control which special ...
1
vote
0answers
48 views

Analogue of Maple's `identify` command in Mathematica [duplicate]

In Maple there is a useful command identify that tries to find a closed form expression based on its numeric approximation. As far as I know there is no built-in ...
1
vote
2answers
74 views

Extracting subtree for a TreeForm

How can I extract an entire subtree from a TreeForm starting from a specific point of the tree? Because with Extract or Part you can take only that specific point...
6
votes
1answer
44 views

How to force evaluation of an expression with Part left unnevaluated?

My goal is to minimize a real valued multi-variable function averageFreeEnergyDensity. The function accepts an integer argument ...
2
votes
4answers
213 views

Print all numbers from a sequence which don't contain the digit 7

so i have this: Cases[RecurrenceTable[{a[n + 1] == 7 a[n] + n, a[1] == 1}, a, {n, 7}], Except[7]] But i noticed that it will only exclude numbers that are 7, and ...
0
votes
0answers
61 views

Loop in a loop, or how to evaluate complex expressions

I need to find $h_{0j}$ for every $1\leq j\leq300$, where \begin{multline*} h_{0j} = \sum_{q=1}^{Q}g_qe^{-\lambda_q j\Delta}\frac{e^{\lambda_q\Delta}-1}{\lambda_q} + \sum_{p=1}^{P}\frac{e^{-\alpha_p ...
18
votes
2answers
1k views

Scan vs. Map vs. Apply

I cannot understand the difference between Apply, Scan, and Map. I have tried to play with ...
16
votes
1answer
305 views

Why is ReplaceAll behaving like this?

I'm learning to use the ReplaceAll function and I found the behavior of which is quite confusing. For Sqrt[f[x, y]] /. f[___] -> u Mathematica returns ...
8
votes
3answers
969 views

How to manipulate gauge theory in Mathematica?

I want to know if there is a way of typing into Mathematica an expression like the following, $$\epsilon^{\mu \nu \lambda} f^{abc} A^a_\mu A^b_\nu A^c_\lambda + g\epsilon^{\mu \nu \lambda} A^a_\mu ...
1
vote
1answer
83 views

Work around bugs in Summation, Hypergeometric function?

I'm so confused I don't even know how to phrase the question, so here's what's happening: I need an analytic form for this: ...
0
votes
2answers
94 views

Get constant term with `Coefficient` for a non-polynomial

Take a nonlinear equation such as exp = (x + 3)/4 + Exp[x] + 1 + (c + x) Note that this is not a polynomial. Now, I want to extract the coefficients of this. ...
4
votes
1answer
65 views

Factoring out parts of an expression

I'm looking to factor out the parts of a multiplication type of expression. For example for the expression: $$20 e^{-t^2}\frac{t^2}{\sqrt{t^2+a}} erf(b+t)$$ I'd like to get a list in the form of: ...
18
votes
1answer
499 views

List of atomic expressions

I was surprised to see Graph objects are atomic. Is there a way (through documentation or programmatically) to find all atomic heads? The ones I know of are: ...
1
vote
3answers
198 views

How to manage list of list of rules?

Considering we have a list: str = "{1 -> {a -> aa, b -> bb}, 2 -> {2a -> \"{b -> bb}\"}}" Bringing this to expression gives: ...
1
vote
2answers
54 views

Subsituting expressions for expressions

I'm trying to define functions using other functions, like so: f[a_, b_] := a/b; a[c_] := c; b[d_] := d; Now what I want to be able to do is two things: ...
1
vote
2answers
174 views

Extract data from DateListPlot, limited by PlotRange

Extracting the points from a line in a ListPlot in this answer uses points = Cases[Normal@plot, Line[pts_] :> pts, Infinity]; This works in DateListPlot ...
3
votes
2answers
74 views

Mathematica: Extract the piece that contains x=0 from within a piecewise function

In mathematica, I have a piecewise function similar to: Piecewise[{ {x^2 + 2*x - 4, 0 <= x <= 1/4}, {0, true} }] I don't ...
20
votes
3answers
6k views

Is it possible to change the color of plot in Show?

For example: p = Plot[Sin[x], {x, 0, 1}] Is it possible to write options in Show to change the curve's color for example into ...
2
votes
1answer
113 views
2
votes
5answers
88 views

How to convert string to integer list?

Saying we have a string: "1 2 3 4 5 6" I want to convert this to integer list. First I do: ...
1
vote
2answers
60 views

How to list variables given equation? [closed]

Given an expression, is there any means to list variables? Example: a^3 + b^2 + c -> a,b,c I need this functionality because I am manipulating large expressions of many variables (20) and would ...
11
votes
1answer
409 views

How to convert a notebook cell to a string retaining all formatting, colorization of identifiers etc?

I have an opened Mathematica notebook containing several cells. Suppose, I am interested in one of them -- it may contain a complete or incomplete expression (e.g. with syntax errors, highlighted ...
27
votes
8answers
1k views

How do I get my equation to have the form $(x-a)^2 + (y-b)^2 + (z-c)^2-d = 0$?

I want Mathematica to express the equation $$-11 - 2 x + x^2 - 4 y + y^2 - 6 z + z^2=0$$ in the form $$(x - 1)^2 + (y - 2)^2 + (z - 3)^2 - 25=0$$ How do I tell Mathematica to do that?
0
votes
0answers
27 views

Find out domain after change of variable in integral of d dimensions

Is there a way to tell Mathematica the change of variable you want to do and getting back the corresponding domain? The specific problem I am trying to solve is $\quad \quad\int_{-1}^0 ...