61 questions linked to/from Replacement inside held expression
1k views

### How to solve the tsunami model and animate the shallow water wave?

Backslide introduced in 9.0, persisting through 11.3. Recently when I was learning differential equations, I noticed there is a shallow water wave equation to model the tsunami propagation. How to ...
565 views

### Why x = x doesn't cause an infinite loop, but f[x_] := f[x] does?

If I execute: In[1] := x = x Out[1] = x and then I evaluate the symbol x: ...
483 views

### partial numerical evaluation

Context The following is an issue I have come across many times and still do not have a satisfactory solution for. The context of it is this. Let's say we have an equation, a linear ODE for the ...
474 views

### Why can't I inject expressions in Compile using (only) With

Generally speaking, With can be used to inject into arbitrarily held expressions, for example: ...
3k views

### Replace symbols with values without evaluation

If I have assigned values to a, b and c: a=7; b=5; c=6; ...
447 views

### Obtaining the number of iterations used in ReplaceRepeated

ReplaceRepeated has an option MaxIterations which indicates Mathematica is keeping track of the number of iterations. Is there ...
386 views

### How can I break through Function's HoldAll attribute to force evaluation of a body element?

The question concerns creating a function. Let consider the following code With[{f = Function[t, Cos[t]]}, {First[#], f'[#]} & ] which returns ...
276 views

### Pattern matching to a function evaluation inside an Association

I find the following behaviour deeply counter-intuitive: <|1 -> 123.456 |> /. {x_?NumericQ -> Round[x]} (* <|1 -> Round[123.456]|> *) That ...
240 views

### why does Function have the HoldAll attribute?

Consider the following: f = 2 # & OwnValues[f] g = f[#]/2 & OwnValues[g] Since Function has the ...
227 views

### Apply function to nested associations

This seems like it should be easy but I am trying to concisely enhance some nested associations with Mathematica objects (e.g., convert things to matrices, etc) but I'm having a bit of difficulty with ...
214 views

### How to Force Evaluation of Derivative in a Pure Function Definition

Let's say I have a function f1 = #^2 &; I want to calculate its derivative, perform some manipulations and make the result a pure function. I try ...
417 views

### How to copy formatted numbers as MathML without quotation marks?

I have the following code: a = 6.08717*10^6; b = a/3; c = a*1.5; d = a^2; matrix={{a, b, c, d},{b, c, d, a},{c, d, a, b},{d, a, b, c}}; matrix // EngineeringForm ...
675 views

### Free Convective Heat Transfer of Non-Newtonian Power Law Fluids from a Vertical Plate

I am trying to solve a set of PDEs mentioned in this paper with NDSolve but facing quite a few issues. The PDE system is: ...