Questions tagged [expression-manipulation]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
58 views

Converting an equation to the form $ax+by=c$

I have a linear equation that comes as a result of applying orthogonality on a non-homogeneous boundary condition with two unknowns $C_1$ and $C_2$. Can someone help me to express this equation in the ...
1
vote
0answers
35 views

Simplifying the final coefficient expression of a PDE solution

I have been trying to solve a boundary value problem analytically which involves a three-dimensional temperature Laplacian over a parallelepiped. In the final step of my solution, using the two non-...
0
votes
0answers
29 views

Calculate density of states for 1D system

The density of states for a 1D system can be written as: $D\left(\omega\right)=\frac{L}{\pi}\frac{1}{d\omega\left(k\right)/dk}$ I have some expressions for $\omega\left(k\right)$: ...
1
vote
2answers
40 views

Substituting values from an association thread into a table of expressions

I have asked a question here. Yet I am trying to do the same procedure with AssociationThread Suppose I have the following function which is a normal distribution: <...
5
votes
1answer
45 views

Substituting elements of lists into an expression

Suppose I have the following lists, as = {1, 2, 3, 4}; bs = {10, 20, 30, 40}; and the following expression: ...
2
votes
1answer
43 views

Crown a list of two sublists with ErrorBar without losing list structure

I have a list with two sublists of numbers, e.g. Sigmaf = {{1,2,3},{3,4,5}}; ... and I would like to crown each number with ...
5
votes
1answer
64 views

Split Expression Into Constant And Non-Constant Summands

I have a partially t-dependent matrix which I want to split into its t-dependent and its t-...
5
votes
2answers
154 views

Replace a randomly chosen part of an expression

Given an arbitrary Mathematica expression, how can I choose a random part of the expression and replace it with another symbol of my choosing? For example, given $a x^3 +2y\cos(x)- \tanh(x^{y+3})/(x^...
1
vote
1answer
74 views

Fixed Point Iteration - Finding Iteration Functions

When we use Solve, it attempts to solve the system for the variables, for example Solve[x^3 + 4 x^2 - 10 == 0, x] If we want to use Fixed Point Iteration to ...
2
votes
1answer
51 views

Extracting coefficients from a sum of exponential functions

I'm dealing with a sum of exponential functions with different exponents ...
2
votes
1answer
29 views

Problem with recursive relations

Continuing the topic of my previous questions (link1 and link2), let me ask one more question. I have problems with the following code: ...
0
votes
0answers
53 views

check if one expression can be transformed into another

My question is how to use Mathematica to check if one expression can be transformed into another: Example 1: $ax^2+bx+c$ into $K\cdot(x+\alpha)^2+\beta$, and then show me $K(a,b,c)$ and so on. ...
2
votes
1answer
53 views

Replace a family of coefficients by a function in a sum

I would like to do something very simple, i.e. replace the coefficients in a sum by a function: c[1] + c[2] + c[3] /. {c[s] -> (s + 1)/(2 (2 s + 1))} ...
2
votes
2answers
60 views

Symbolic nest expressions

I'm trying to understand how to use symbolic expressions as arguments. The following example represents my problem: ...
0
votes
1answer
31 views

using pattern matching to separate coefficients and functions

I want to find out the coefficients and functions from an expression and possibly save them in separate files with same order. I have the following toy example: ...
2
votes
2answers
76 views

Collect with linear combinations

Is there a way to collect coefficients on specific linear combinations of variables? Consider the example below: ...
0
votes
0answers
32 views

Expanding complex expression and replacing variables in the result

When I'm finished expanding my expression I would like the result to be expressed again in terms of the original variables (like α, S1, T1, T2). I've tried replace, ...
2
votes
0answers
27 views

Computations with OptimizedExpressions without completely expanding them

I have to manipulate huge expressions that are rational functions of many (∼30) variables with integer coefficients. Storing them just as a ratio of two polynomials would be impractical. But they can ...
0
votes
0answers
38 views

Rearranging expressions by DragAndDrop

I see that the DragAndDrop option for editing is not supported anymore. However, I think this could be a really useful feature, for instance to rearrange the terms of an expression in the form we ...
0
votes
1answer
29 views

Applying function to both coefficients and variables in Collect

I am dealing with expressions schematically of the form expr = c[1] G[1] + c[3,8] G[3,8] + ... + c[3] G[1] + ... where the Gs are fixed objects, and the cs some ...
1
vote
0answers
49 views

Fast way to apply permutations in large list?

I have one Polynomial in the form of FF[x1,x2,x3,x4,x5,x6,x7,x8], where xi pick numbers from ...
1
vote
1answer
44 views

Optimizing an equation - show the length of an equation, including operators

A simple, but I think useful question to know the answer for. How can I quickly count the length in my equation, including +,-, and so on? For example, $x^2+1$ has a length of 4.
2
votes
3answers
70 views

How to hold the expression when using ToExpression with TeXForm

I know {1, 1} // Apply[Defer@*Plus] can return 1+1 But if I want hold the form from TeXForm,what should I do? ...
1
vote
0answers
28 views

Lexicographical Search and Conjugate

I bid you a good day. I want Mathematica to plug this assumed solution into the left hand side of a differential equation. Then collect terms of powers of $\alpha$. $\psi (x,y)=\alpha f_1(y)e^{i x}+...
0
votes
1answer
24 views

Testing expressions with === (SameQ) between original expression and after Factor[], Expand[] and FullSimplify[] [closed]

a=16x^4 y^5 (81-z^4)-54xy^2 (81-z^4) Out[30]= -54 xy^2 (81-z^4)+16 x^4 y^5 (81-z^4) b=Factor[a] Out[31]= 2 (27 xy^2-8 x^...
2
votes
1answer
61 views

How do I apply complicated algebraic/trigonometric manipulations to nested expressions?

Consider the expression $$ a\sin(x)-a\sin\left(\frac{x}{a}\left(a+\frac{ay}{x}\right)\right) \label{a}\tag{1} $$ which can be rewritten as $$ \sin(x)-\sin\left(x+y\right) \label{b} \tag{2} $$ and ...
4
votes
1answer
57 views

How do I build a position index of a general held expression to arbitrary depth?

I have an expression which I would like to make a position index of, which for sake of argument will be this: expr = f[q + g[x, y, z]]; Since it's not a list, ...
1
vote
1answer
34 views

Extracting argument of a specific functions in a large expression

I have a large expression, for example Cos[x]Sin[y]Sqrt[1+z]/(1+x^2)-1/(1+y) I wish to extract the argument inside Sqrt ...
1
vote
0answers
55 views

Finding a selected expression

How can I find all expressions matching the one I am selecting? This features exists in Matlab and is quite helpful: Just trying to make my debugging easier. Thanks!
2
votes
0answers
54 views

How to do an arbitrary expression growth in Mathematica?

I want to write a function that can be used to grow an expression from a seed or another existing expression based on part specification. ...
6
votes
3answers
227 views

Split expression into list of terms

I'm looking for a nice way to split an expression into a list of the terms (i.e. the addends). The desired behavior in: ...
0
votes
0answers
18 views

Comparing fractions by using partial fractions or a specific factorisation?

Trying to reproduce the results of a paper I had to solve a difficult integral. I obtain: \begin{equation} A=-N\left ( \epsilon r+\log(1+r) +\frac{rx^2(1-r\tau + \tau r^2 (\tau +1))}{1+r}+\frac{ry^2(-...
1
vote
0answers
38 views

Canceling factors from numerator and denominator with complex number

I have the following expression: $\text{expr} = i \frac{\sqrt{a-b}}{\sqrt{b-a}}x$. Clearly simplifying expression gives $\text{expr}=x$ by cancelling the numerator and denominator. However, I am not ...
7
votes
1answer
72 views

Any differences between Activate[…] vs ReplaceAll[…,Inactive[f_]-f>]?

I can activate an expression with Inactive objects such as expr = Inactive[f][Inactive[f][x], y] + Inactive[f] by applying <...
0
votes
1answer
55 views

Manipulate MeshRegion as normal Mathematica expression

A MeshRegion seems to function quite differently from any other Mathematica expression. One cannot take a Part of it. Nor can I ...
1
vote
1answer
65 views

How can I show that the equation holds?

Suppose we have the following data: $ r=\frac{vk}{h^2}$ $u[i,j]$ is a function of two variables with $i,j$ integers. $\frac{u[i,j+1]-u[i,j]}{k}=v\frac{u[i+1,j]-2u[i,j]+u[i-1,j]}{h^2}$ Then I would ...
6
votes
2answers
85 views

Assert no unevaluated function applications

Background Suppose I have begun a fresh kernel session, and I have defined the following function alone: F[x_, y_] := x + y; One expected use of ...
0
votes
1answer
32 views

Making substitution to an expressions with a list of numerical data [closed]

Suppose I have an expression similar to this: y=23.23*(h[x]^2)*(D[h[x],x])*(D[h[x],{x,3}])/(13.2+Cos[0.245x]) The actual expression is a lot more complicated, but ...
2
votes
3answers
76 views

Select variable and its derivatives

A simple question: I have this equation: ...
3
votes
3answers
130 views

isolating a specific variable to one side in an equation

I am trying to do a simple operation of manipulating an equation of multiple variables (say, $x,y,z$), so that I can get one of the these variables on the LHS and everything else on the RHS. It should ...
1
vote
3answers
60 views
16
votes
7answers
1k views

Which operation combines {f,g,h,…} and y[u,v,w,…] to get y[f[u],g[v],h[w],…]?

I have a list of functions myFuncs = {f,g,h} which I'd like to map over an expression expr = y[u,v,w] to obtain ...
13
votes
3answers
291 views

How to make arbitrary transpositions of associations and datasets

Is there a general Transpose for Dataset/Association that will transpose arbitrary levels, ...
4
votes
4answers
97 views

ReplaceList doesn't apply rules down to subparts

Somewhat related to a previous question, I'm experimenting with ReplaceList to get the list of all possible transformations we can obtain by applying a rule to an expression. But I don't manage to ...
1
vote
1answer
61 views

How to test if $ⅈ$ is in an expression?

From this answer https://mathematica.stackexchange.com/a/9773/68791 and according to the documentation: FreeQ[list,form] test whether form occurs nowhere in ...
2
votes
0answers
52 views

General rule to rewrite function and argument into a new symbol

I am trying to convert Mathematica output into equations I can plug into C. I am presently trying to convert expressions of the form Derivative[1,0,0][f][t,x,y] ...
0
votes
1answer
63 views

Collect integer and non-integer powers at the same time

Imagine we have an expression that contains both integer ($y$, $y^3$, $y^8$ etc.) and non-integer powers ($y^{1+\alpha}$, $y^{2\,\alpha}$, $y^{2+3\,\alpha}$) of the variable $y$, where $\alpha\in\...
0
votes
2answers
109 views

Expand in series an equation of two variables

I am sorry if this has been asked, I don't really know how to formulate the search to find it. We have some system of equations (that are equal to zero), for example (not sure how to enter ...
1
vote
0answers
52 views

How can I force the output of a computation to be as compact as possible, yet complete, by using functions?

I am computing some derivatives in Wolfram Mathematica 11.3. The functions that I have to differentiate (with respect to the state variables) are the equations of motion of a rocket in the atmosphere. ...
0
votes
0answers
20 views

Evaluating meta expressions of (partial) derivatives

I have created some meta expressions for many derivative calculations such as ...

1
2 3 4 5
12