Skip to main content

Questions tagged [replacement]

3 votes
1 answer
156 views

I am trying to understand the function of KeyValuePattern. According to the documentation, KeyValuePattern[{patt1, ...}] is a ...
Andrew's user avatar
  • 10.6k
1 vote
0 answers
81 views

Let $f(x) = A \exp(i k x) + B \exp (-i k x)$. If we replace every $i$ by $-i$, we are supposed to get $g(x) = A \exp(-i k x) + B \exp (i k x)$. However, the Mathematica code does not work as expected. ...
rasi's user avatar
  • 73
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
3 votes
1 answer
113 views

How can be a fraction inside Hold replaced? Nothing of the following works: ...
azerbajdzan's user avatar
  • 32.8k
2 votes
0 answers
92 views

I don't use Mathematica as much and only use it for some specific tasks from time to time (mostly simplifying expressions and calculating integrals and derivatives). Lets say I have an large ...
Gabriel de Castro Biage's user avatar
1 vote
0 answers
46 views

I found a confusing thing about Rule. (*code 1*) (a^2 /. i_^2 :> i) -> b gives ...
Crack-Hu's user avatar
  • 165
6 votes
2 answers
230 views

After switching from 13.2 to 14.3, I noticed that some behavior of Association has changed: ...
Acus's user avatar
  • 3,877
4 votes
3 answers
395 views

Evaluating <|"key" -> {<|"key" -> "val"|>}|> /. {<|stuff__|>} :> <|stuff|> Produces ...
Tapiocaweasel's user avatar
3 votes
2 answers
214 views

With a naive thought, it seems that rule as below can match in expr. However, it does not match. Could I know what mistake I ...
Soon's user avatar
  • 1,484
0 votes
0 answers
130 views

I have an expression e[x,y,z] and like to see all results when picking all independent variables from a fixed set of constants ...
Hauke Reddmann's user avatar
2 votes
2 answers
147 views

This is similar to the how-to-replace-variable-with-power question, but here it involves two variables with different power combinations. This quesion arises from paper forward kinematics of the 6-6 ...
eason's user avatar
  • 403
2 votes
3 answers
194 views

I'm doing some heavy symbolic calculations and for preliminary simple tests I need to replace all coefficients except some choosings, e.g.: ...
eason's user avatar
  • 403
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
5 votes
1 answer
294 views

Following Shifrin's "Mathematica Programming: an advanced introduction", pp. 93-94, I entered {{{a}}} /. {x_} :> q[x] and I got, as expected by the ...
bobina bidon's user avatar
1 vote
2 answers
138 views

f'[x] /. f -> (f[g[#]] &) adopts the chain rule. Now I need df(r,$\theta$)/dr in x and y coordinates, hence transforming from polar to Cartesian coordinates,...
feynman's user avatar
  • 451

15 30 50 per page
1
2 3 4 5
115