Linked Questions

16
votes
1answer
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 ...
23
votes
3answers
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: ...
6
votes
4answers
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 ...
15
votes
2answers
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: ...
5
votes
4answers
3k views

Replace symbols with values without evaluation

If I have assigned values to a, b and c: a=7; b=5; c=6; ...
7
votes
3answers
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 ...
8
votes
3answers
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 ...
16
votes
1answer
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 ...
6
votes
3answers
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 ...
3
votes
3answers
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 ...
4
votes
4answers
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 ...
10
votes
2answers
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 ...
7
votes
1answer
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: ...
8
votes
2answers
307 views

How to sort arguments of Times in nonstandard order?

Is there an elegant way to sort the arguments of Times in e.g. TraditionalForm so that factors go to the front and state ...
7
votes
2answers
361 views

Evaluate Only Part of a Function

I have a list of functions, each containing none or more of the functions Plus, Times, ...

15 30 50 per page