Skip to main content

Questions tagged [semantic-matching]

Posts about semantic pattern matching rather than syntactic pattern matching (which is the built-in pattern matcher of Mathematica) e.g. "Why x^3 /. x^2->a doesn't work!"

2 votes
1 answer
134 views

The goal is to substitute m2/m1 in expr with k. Code1 does not match the pattern, but if it is pre-processed with Expand like in code2, it matches the pattern. Could I know why there is this ...
Soon's user avatar
  • 1,484
1 vote
4 answers
236 views

For example, I define some quantities here $$ \gamma=\frac1{\sqrt{1-\frac{r^2}{c^2 t^2}}}, \qquad \mbox{with} \; r^2=x^2+y^2+z^2. $$ Now I want to calculate some expressions. Let's say, $\partial_t \...
Curious Cat's user avatar
2 votes
2 answers
216 views

I have an old reference text with tables of solid spherical harmonics expressed in cartesian coordinates. (Edit: Here's a digital version of said table, for the curious.) In an attempt to replicate ...
sbernierjhu's user avatar
3 votes
5 answers
274 views

I am quite new to Mathematica. I have a text file that upon importing has a repetitive structure with characters included. I need to extract only the following in numbers only (no letters, dash lines, ...
LollyPop's user avatar
3 votes
2 answers
109 views

I want to do replacement of products (because I am dealing with abstract projectors), but Mathematica seems to fail understanding this toy example replacement : ...
Adrien Martina's user avatar
5 votes
1 answer
252 views

In Mathematica, how can I replace instances of delta t in an expression with a, while keeping instances of ...
Tokubara's user avatar
  • 215
0 votes
3 answers
110 views

We know that the value of this equation is 0 x2 y1 - x1 y2 == 0 For the following equation, there is a correlation between the polynomial parts of the known ...
csn899's user avatar
  • 1
1 vote
1 answer
176 views

I konw: $$ a_0=\frac{4 \pi \epsilon_0 \hbar^2}{m_e e^2} $$ and $$ \alpha = \frac{m_{\mathrm{e}}^2 e^4}{18 \pi^3 \epsilon_0^2 \hbar^4} $$ So we can use $a_0$ for $\alpha$,like this: $$ \alpha=\frac{m_{\...
我心永恒's user avatar
  • 1,630
0 votes
0 answers
110 views

Good morning everyone. I have a large dataset of photographs similar to the one attached. It would be my intention to train a neural network to recognise water and "non-water" zones. How ...
Ramiro dell'Erba's user avatar
4 votes
4 answers
283 views

I have a named expression: expr := a + b. a and b are also named expressions. Let's say <...
Borislav Stanimirov's user avatar
2 votes
1 answer
244 views

It seems that a/b is always replaced with the form: a * b^-1, Times[a, Power[b, -1]]. I ...
Borislav Stanimirov's user avatar
4 votes
3 answers
318 views

For example I have this equation,I want to use c->a/b ,but it can not work $$ \frac{a^2}{b^2}+\frac{b^2}{a^2}+\frac{a}{b}+e^{a/b}+\frac{b}{a}+\log \left(\frac{a}{b}\right) $$ ...
我心永恒's user avatar
  • 1,630
2 votes
2 answers
181 views

So I don't mean something like this f[x_] = x^2 f[x] /. x^2 -> y But what I mean is something like this: where the variables I want to change to are defined ...
Student's user avatar
  • 177
5 votes
2 answers
333 views

I have tried like Replace[something, {2*π -> HoldForm[τ]}] Although it works well where a lone 2 π symbol, it fails to ...
George Rey's user avatar
3 votes
1 answer
256 views

If I run the following code: a^2/b^2 /. {a/b -> c} I'm getting output: a^2/b^2 How can I obtain ...
Mieczmik's user avatar

15 30 50 per page