# Questions tagged [rule]

Questions about transformation rules in Mathematica--constructs that let you set, or programmatically modify, local values for expressions.

355 questions
Filter by
Sorted by
Tagged with
77 views

### Removing circular rules'

Say that I have a huge list (>300.000 elements) of polynomial equations and I want to simplify these by looking for some simple equations of the form x[i] == _ ...
• 1,580
1 vote
48 views

### Problem with using RuleDelayed (:>) [closed]

I have defined a rule using rule delayed function as follows: innerWithDxU = (f1_ D[f2_[x,y],x]f3_[x,y] :>-f2 [x,y]D[f1 f3[x,y],x] ); ...
514 views

### Isomorphic lists

Is there a function that outputs True if lists are isomorphic (there exists a rule that changes the first list into the second one and inverse of the rule changes ...
• 19.5k
31 views

### Question about rule syntax/format for CellularAutomaton function [duplicate]

I am trying to understand how to use CellularAutomaton function. For example, I am interested in the Game life and I found a working example here. However I cannot understand or find a detailed ...
• 531
1 vote
64 views

### Rules Being Ignored by Mathematica

Can someone explain to me why Mathematica is ignoring the replacement rules in the following code: ...
• 243
175 views

### Replacing the heads of an expression in left to right order

I would like to replace the occurrences of the head f in an expression. The expression only contains two possible heads: f and g. These heads are applied to exactly two arguments. Example: ...
• 1,688
1 vote
51 views

### How to make the following replacement?

Consider the following symbolic expression: expr=mon[m,b]*kd[m,d]+band[a,c]alc[b,c]kd[a,d]+func[a,c]dum[a,c]kd[b,d] + f1[b,c]f2[d,c] It has three types of summands:...
• 5,849
725 views

### Manipulating rules

I tried searching in the docs in "Transformation Rules and Definitions", however there wasn't anything of help. So imagine I have these two rules: ...
1 vote
59 views

### Rearranging expression

My goal is to place the terms related to q and r in Expression 1 in one place as much as possible, like Expression 2.(Alpha and beta in the expression are constants, and q and r are variables.) How ...
• 648
91 views

### How to directly convert the solution of a recursive equation into a function expression? [closed]

Clear["Global*"] RSolve[{p[i] == 2/5 p[i - 1] + 1/2 p[i] + 1/10 p[i + 1], p[0] == 0, p[8] == 1}, p[i], i] // FullSimplify According to the above ...
• 4,333
139 views

### Using patterns in ReplaceAll to match different symbols

I have an expression expr = kb.kpb+kb.kb+knb.knb+kpb.knb+kd.kpd+kd.kd+knd.knd+kpd.knd; and I want to make replacement rules as: ...
202 views

### How can I convert a list of rules to a list of numerical values?

NSolve gave this list of rules: ...
• 71
41 views

### Reuse RHS of rule with conditions

I need to create rule2 with the same right hand side of rule1. This RHS contains If ...
• 998
1 vote
44 views

### Delayed rule at StringReplace

In the StringReplace example(chaging two letter to uppercase) below, delayed rule is used. However, the result is the same even if rule is used. 1)The delayed rule must be uesd in this case? 2)In what ...
• 648
40 views

### Simplifying symbolic expression using replacement rules

I am trying to carry out a linear stability analysis of a two PDE system. I start by defining the equations and then define the perturbation along with the replacement rules required. I then use a ...
• 243
84 views

### Same code behaves differently as a pure function and a function, and insider another function

I have a rule-transformer that takes a list of rules (and a list generator = {σ[z], σ[-1], σ[1]}) ...
• 543
140 views

### How to force Mathematica to simplify in terms of half angles?

By basic trigonometric identities, the expression $\frac{\sinh(x)}{\sqrt{2}\sqrt{1+\cosh(x)}}$ simplifies to $\sinh(\frac{x}{2})$. But Mathematica seemingly don't perform this simplification. I tried ...
• 173
59 views

### Syntax error trying to rewrite expression using rules

I want to use Mathematica to calculate derivatives of some long, complicated expressions. I have an integral with integrand $I_*$ which is a functional that depends on $h(x,t)$ and $\phi(x,t)$. The ...
• 243