6k views

### Replacement inside held expression

I wish to make a replacement inside a held expression: f[x_Real] := x^2; Hold[{2., 3.}] /. n_Real :> f[n] The desired output is ...
• 61.9k
977 views

### When should I, and when should I not, set the HoldAll attribute on a function I define?

I have seen a number of examples on this site (such as in syntax highlighting and checking evaluation status) in which functions definitions are preceded with ...
7k views

### Derivative of the Absolute Value Function in Mathematica looks very different from the actual answer

Derivative of the Abs Function in Mathematica looks very different than the actual answer. Why? How to correct this? For example I entered ...
• 241
955 views

### Why is CompilationTarget -> C slower than directly writing with C?

Probably a hard question, but I think it's better to cry out loud. I've hesitated for a while about whether I should post this in StackOverflow with a c tag or not, ...
• 66.2k
265 views

### Apply central difference formula to a variable twice

I am working with finite difference methods analytically and I would like to be able to perform operations on subscripted variables. I would like to generate the following expression by applying a ...
• 437
355 views

### Is there a way to simplify this replacement rule

I have a rather big expression which contains many sums of form q x + w y. I know that y is much smaller than ...
• 542
353 views

### 2D Oseen equations

Background info: https://en.wikipedia.org/wiki/Oseen_equations ...
• 1,550
1 vote
319 views

### Solve PDE system with mixed parabolic–elliptic equations

I want to solve a mixed PDE Parabolic-Elliptic system, subject to initial conditions u(x,y,0)=1 and v(x,y,0)=2-0.5 cos[(Pi x)/5]. The respective code version ...
• 1,335
387 views

• 181