Skip to main content

Questions tagged [rule]

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

1 vote
1 answer
102 views

I am introducing a rule: $Post = # /. x_?NumericQ FiniteField[q_?PrimeQ] [s_] :> FiniteField[q] [x] FiniteField[q] [s] &; But for some reason, upon ...
Anixx's user avatar
  • 3,862
0 votes
2 answers
130 views

I'm pretty new to Mathematica and I have a question about how to deal with replacement rules in presence of function definitions. Basically I want to implement a mean/covariance calculator, in the ...
TheFox's user avatar
  • 1
4 votes
1 answer
268 views

My goal is to count cases of {"Yes", _, _} -> "Yes" and {"Yes", _, _} -> "No" in the set below using HoldPattern to treat the rule itself as a pattern. ...
Soon's user avatar
  • 1,484
3 votes
2 answers
192 views

I have expressions of the general form as in an example below (\[Pi]^10 T[4]^2)/9240 + (\[Pi]^10 T[3] T[5])/4620 Here T[n] is ...
Anton's user avatar
  • 33
4 votes
7 answers
543 views

Given ...
user57467's user avatar
  • 3,150
1 vote
0 answers
79 views

Suppose I have a rule in Mathematica: x -> x[a] defined under some variable. Is there a way I can use the reverse of the rule ...
codebpr's user avatar
  • 3,028
2 votes
0 answers
89 views

I made the following code: L={{1,2},{2,3},{2,4}}; R:=(L=(L/.{x_,y_}:>Splice[{{x,y},{x,x},{y,y}}]/;MemberQ[L,{x,y}])//Union) When I run R three times, I get: <...
Red Banana's user avatar
  • 5,613
3 votes
2 answers
204 views

I want to divide a product into two pieces, one is the terms of form f[x, _], the other is the leftover factors free of x: ...
Crack-Hu's user avatar
  • 165
7 votes
3 answers
412 views

Given a relation L, we can make the symmetric closure using rules as follows: ...
Red Banana's user avatar
  • 5,613
0 votes
0 answers
66 views

I am working with a complex expression, $L_0$, which I need to simplify iteratively using a series of dependent replacement rules. Here's the structured approach I am trying to implement: Start with ...
Charmbracelet's user avatar
2 votes
0 answers
170 views

I work with perturbations in FLRW metric with arbitary curvature. I'm following Weinberg's book. In modified gravitation theory there is additional tensor S and I need to find it's perturbation in the ...
Heckfy's user avatar
  • 21
0 votes
1 answer
74 views

I am trying to generalize the condition Derivative[1, 0][ℒp][t, ϕ] -> Derivative[0, 1][ℒp][t, ϕ]/l for $\ell$ a constant, through the following rule ...
hyriusen's user avatar
  • 173
4 votes
1 answer
161 views

Consider the following rule: $rule={"Period ID"|p:"Period":>p}; This rule will match ...
user13892's user avatar
  • 10.4k
2 votes
1 answer
116 views

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] == _ ...
Gert's user avatar
  • 1,783

15 30 50 per page
1
2 3 4 5
25