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

learn more… | top users | synonyms

6
votes
1answer
46 views

Reading Cells or Boxes expression by expression

Let's say we have a cell: (*newline*) (*newline*) Plot[ x, {x, 0, 1} ] (*newline*) Plot[x, {x, 0, 2}] How to read it expression by expression? ...
2
votes
1answer
69 views

Replace pattern for exponentials

Ultimately, I want to replace every Exp[(const) w[i,j]] to T[i,j] and Exp[-(const) w[i,j]] to 1/T[i,j] in the following expression ...
3
votes
3answers
144 views

How to get the long logic expression with a terse method

I have a long logic expression (x==2||x==3||x==4)&&(y==2||y==3||y==4)&&(z==2||z==3||z==4)&&(m==2||m==3||m==4) How to get it by a terse ...
0
votes
0answers
44 views

Force expression in certain form

Is there a function in Mathematica to force an expression to be transformed into a given form. For example f[x] is a function of ...
4
votes
2answers
100 views

Efficiently strip off coefficients in front of variables?

I am working with multivariate polynomials and need a very efficient way to decompose monomials into coefficients and pure monomials. for instance consider variables ...
3
votes
0answers
67 views

Can Mathematica reliably determine the equality of any two constructible numbers?

A constructible number is any number which can be expressed with only natural numbers and the operators $+$, $-$, $\times$, $/$, $\sqrt{}$ (square root only). Is Mathematica's ...
2
votes
2answers
110 views

How to extract the structure of relationships amongst variables in a system of equations? [closed]

Mathematica being a CAS, I would have thought what I'm trying to do a natural task. But I have not been able to find any information on this in the Internet. Basically, I have a large collection of ...
6
votes
2answers
109 views

What is the Difference Between Rule (->) and RuleDelayed (:>)?

I am new to Mathematica so this question may seem rudimentary. Sorry for that! :) I want to implement the well-known property of Kronecker's Delta $$\Sigma_{i=1}^{n} a_i \delta_{ij}=a_j,\quad 1 \le ...
0
votes
1answer
41 views

Error: Recursion Depth of 1024 Exceeded During Evaluation

I wrote a function that exchanges integration and summation in an expression. ...
0
votes
1answer
82 views

Simplifying expressions

Let's define a function $\Omega(x,y)$ ...
4
votes
1answer
67 views

Problems with Displaying Output for Summation

Consider the following code. ...
1
vote
1answer
75 views

Deriving the Fourier Coefficients Formulas with a Manual Procedure

I already know that there are built-in functions to compute the Fourier coefficients but I want to derive their formulas manually. In fact, I want to obtain the final well-known formulas for the ...
0
votes
1answer
66 views

Replacing terms in a sum according to a condition

If I have a generic expression such as ...
3
votes
2answers
65 views

Creating Boolean expressions over a set of indexed variables

I've read lots of examples here on how to set one matrix Equal to another, but how do you nest And and ...
12
votes
1answer
135 views

A weird issue with Interval[$MaxNumber]

From the Interval documentation: For approximate machine- or arbitrary-precision numbers x, Interval[x] yields an interval reflecting the uncertainty in x. ...
1
vote
2answers
128 views

Express roots of quadratic equation in a specific form [closed]

By solving this equation, I got two roots as follows: Solve[1 + Subscript[a, 1]*s + Subscript[a, 2]*s^2 == 0, s] Is there a way to express it in the form below ...
0
votes
2answers
41 views

Substituting a Value into an Expression

I am new to Mathematica so pardon me for the elementary question. Can some one kindly explain that what is happening in the simple code below? The With command ...
1
vote
0answers
28 views

How can PowerExpand be made to evaluate the ArcTan form that takes two arguments?

Consider c = Cos[phi]; s = Sin[phi]; ArcTan[c, s] // PowerExpand ArcTan[s/c] // PowerExpand which yields ...
0
votes
0answers
70 views

Using Mathematica to derive an equation

My goal is to obtain Eq. (5) given in this Paper using Mathematica. First we need to define Eqs. (2) and (3) ...
1
vote
2answers
102 views

Extract all elements from a list that belong to a set or have a set element as an argument

EDIT: Added that I want to extract not only the variables from a specific set, but also functions involving variables from a specific set. Given the set ...
1
vote
1answer
39 views

Rearranging dynamic equations

I'm deriving dynamic equations for a simple system, this is what I get: How can I rearrange these 2 equations into the form like this: My code is: ...
2
votes
1answer
62 views

Separation of variables in an expression

I am looking for the function equivalent of Sympy's function: as_independent (*deps, **hint) in Mathematica. The function naively separates an expression into arguments that are not dependent on deps. ...
3
votes
1answer
31 views

Numerator not recognized

Here is a set of simple equations ...
3
votes
2answers
234 views

Is there a function in Mathematica which removes brackets wrapping an expression?

Is there a function in Mathematica which removes brackets from an expression? RemoveBrackets[ {3} ] 3 Note: inspired by @garej's answer to this question ...
6
votes
1answer
195 views

How to efficiently find all combinations of the letters in an alphabet given a condition

Problem: I want to find all unique expressions with n number of terms that contain all the digits (or characters) in alphabet. ...
2
votes
2answers
71 views

intermediate steps of simplification of algebraic expression without evaluation [closed]

I am using MMA do do some algebra and I need to do some simplification. For example, I have the following expression $$ x^2 \left( \frac{6 \left(2 c_1 x^6+c_2\right)}{x^4} \right)-x \left( 4 c_1 ...
1
vote
2answers
79 views

What's the easiest way to remove overall factors from polynomials?

I have code that outputs polynomials (in #1) such as the ones below (note that the trailing Function character ...
11
votes
4answers
191 views

Evaluation of Alternatives

I recently stumbled upon a few examples that suggest patterns containing Alternatives do not evaluate for individual alternatives. For example: ...
0
votes
1answer
48 views

Simple grouping equations [closed]

I'm new in the Mathematica world. A very basic question. I have been using the command Eliminate on a set of equations as follow: ...
0
votes
1answer
56 views

Eliminate variable on multiple equations [closed]

I'm pretty new with Mathematica. I have to perform a really simple operation, but I'm really struggling with that. I have a set of 4 equations, for example (they can also be more complex): $ AA = 2 ...
4
votes
1answer
147 views

How do I disable that Mathematica orders terms in lexicographic order?

I have matrices with entries where the order of the entries is important. Unfortunately Mathematica resorts terms in products in a lexicographic order. For example, ...
1
vote
1answer
46 views

Formatting the prime factorization of expressions

I have a series expansion in $x$ and $a,b$ are constants which I want to type in $\LaTeX$. But the numbers/integers are pretty large (have a lot of digits) so it becomes a bit messy in $\LaTeX$. ...
5
votes
1answer
70 views

Display position of expression as Tooltip

How could we display the position of any sub expression in an expression using Tooltip? This would be useful for example in order to locate the position of an ...
4
votes
2answers
55 views

Is it possible to match a sequence with multiple heads without using Condition

Suppose I have: expr = Times[2, a[x,r], a[y,1], c[z,0,0], d[w,m]]; If I want to match a sequence of expressions with the same head ...
3
votes
5answers
188 views

Finding coefficient in expression

I have expressions like these: ...
5
votes
1answer
75 views

Custom rules for expressions in export to HTML(Fragment)

ExportString[Grid[{{a, b}}], "HTMLFragment"] ...
2
votes
1answer
64 views

Is there some way to implement automatic TimeSeries extrapolation or series continuation?

I am working with a large number of TimeSeries of irregular length. This means that if I sum them, or compute the mean, it cuts off at the terminus of the shortest ...
3
votes
0answers
84 views
5
votes
2answers
148 views

How to name a repeated pattern sequence inside Plus?

Here is a sample expression that contains a bunch of f and some other stuff: ...
0
votes
0answers
57 views

How do I use Replace All? [duplicate]

I have an expression: a + b 2^(1/2) + (c + d 2^(1/2))*I I want to replace each occurrence of 2^(1/2) with ...
7
votes
3answers
90 views

How to organize expression by symbols (like Collect), but apply different functions to each coefficient

I want to mimic the functionality of Collect[expr, {vars}, func], but with the following modification: The function f that is ...
0
votes
0answers
36 views

Replace function and its derivatives [duplicate]

When I have a complicated expression that depends on some variable, say, $f$, the following usually works ok: Expression ./ { f-> x^2 } But if $f$ is a ...
0
votes
1answer
43 views

Solving a trigonometric equation for all $x$ using constant coefficients

I want to find the coefficients $a$, $b$, $c$, etc. that make an equation like $a+bx=x$ true for all $x$, but for trigonometric functions of $x$. For example ...
1
vote
1answer
68 views

Count number of summands?

Consider fun = a+b+c+d/e If we want to get the number of summands, we can use Length[fun], which properly gives ...
0
votes
1answer
50 views

Misunderstanding of Replace code

I am looking for the right way to replace $\delta \, \, \text{by} \, \, 0.05 \, \, \, \beta \, \, \, \text{by} \, \, \, 1.77 \, \, \, \text{and} \, \, \, n \, \, \, \text{by} \, \, \, 12$ in this ...
2
votes
2answers
86 views

How to update values of nested association using AssociateTo?

Saying we have an association: asc = <|"A" -> <|"a" -> 1, "b" -> 2, "c" -> 3|>|>; I want to updated values of ...
0
votes
1answer
49 views

How can I prevent exponents from appearing in an expression?

I've found posts dealing with showing/hiding exponents for numbers, like in scientific notation. But what if I have a general expression? I have an expression like this, ...
1
vote
0answers
36 views

Factoring rationals from equation based on digit complexity?

Consider an equation of the following type: ( poly = (3 x)/35 + (6 y)/7 ) == 0 If we apply the command Factor to this ...
2
votes
1answer
45 views

How to label outputs from Print [closed]

I have problem with Print in Mathematica. The data that I get from it, is not labelled so that I can use it elsewhere, therefore I have got to label them manually. ...