# Tagged Questions

Questions about how Mathematica evaluates expressions, tracing evaluation (Trace*), handling expressions in unevaluated form (Hold*, Unevaluated), nonstandard evaluation, etc.

198 views

### Why does Mathematica “sleep” when I don't work at computer? [closed]

I started using Mathematica few days ago. I'm running this code: ...
119 views

### Why the flat f[x] is treated as ghostHead_[f[x]]?

While reading this answer I feel confused. If we do not care any specific detail of the original question, then ybeltukov's answer essentially makes use of the following fact ...
325 views

### Output an Expression in terms of GoldenRatio

Sorry if this is a dumb question (I'm new). I swear I searched and read forums first! I'm trying to rewrite expressions in terms of the Golden Ratio. For example, I know 9+4Sqrt[5] is Phi^6, but can ...
433 views

### Can't inject EncryptedObject

Bug present from 10.0 to 10.3.1 and fixed in 10.4.0 !! Here are minimal examples: ...
149 views

### Coarse-graining in numerical integrations

I have been working recently in a coarse-graining problem I found when using NIntegrate: I am trying to evaluate the function $$f(a)=\int_0^{\infty}x\,e^{-(a^2+b^2)x^2}\text{d}x$$ numerically as a ...
266 views

### Evaluation of Derivative in a Module

Can someone help me understand the evaluation procedure in the following two pieces of code? ...
80 views

### Evaluating and Plotting Multiple Zero-Counting Functions

In work that I am doing, I am trying to plot multiple zero-counting functions, depending on how a parameter works. For example, if the zeros of one function are {1, 2, 3, 4, 5, 6, 7}, the zeros of ...
81 views

### A With and ContourPlot difficulty

Consider: sys = {u (1 - u + a v), r v (1 - v + b u)}; With[{a = 2, b = 3, r = 1}, Evaluate[Thread[sys == {0, 0}]]] Which gives the output: ...
134 views

### What is the difference between GenerateDocument and TemplateApply[NotebookTemplate[

Bug introduced in V10.0 and persisting through V10.4 Since V10.3 the bug still remains but additionally the Genarate and ...
153 views

### need help to price a european option using finite difference method [closed]

I am writing a function to price European option using backward induction finite difference method. The function is expected to price a European option taking Stock (stock_), age (time_), volatility (...
224 views

...
53 views

### Expand “hierarchical” system of equations

I have a system for equations that is structured hierarchically: - Level 0: these are base variables that I can measure from a process (e.g. a,b,c) - Level 1: these are variables derived from Level 0 ...
55 views

### Different behaviour of Map and Inner in replace rules

Why does x[{1, 2}] /. {x[l_] -> Map[func, l]} {1, 2} not behave as expected, while for example ...
78 views

### Why does Compile redo the calculation when overflow happens?

When implementing the Numerov method solving Schrodinger equation, I encountered this problem. In order to show the order of the evaluation, Print is added. ...
98 views

### How to Reap data from a ScheduledTask?

Here is an amusing little function mapped over a range just to iterate it. It ignores its argument and works entirely by side-effecting a global variable: ...
97 views

### How can I use L.Shifrin s code formatter package better [closed]

in the document of HoldAllComplete, it says: Evaluate cannot be used to override HoldAllComplete.. for example, when I'm ...
52 views

### Alter evaluation order when applying scalar multiplication to function

Consider the following program: g = 2f; g[x] (* (2f)[x] *) Is there any way I can change the above expression to have it return ...
319 views

### How is LHS = RHS; … ; LHS (nontrivially) different from … ; RHS

I'm trying to understand how Mathematica thinks about the results of Set. Suppose we perform LHS = RHS. I'm focusing on when ...
66 views

### Simplify with assumption of unknown function [duplicate]

I have an unknown multivariate function entry[x,y,z], which is positive. Then how to get FALSE and entry[1,2,3] in the following evaluations? ...
205 views

### Nested If statement with unevaluated arguments

I have a list of boolean functions {f1, f2, f3, ...} that take a value and return True or ...
74 views

### RunScheduledTask and return the result

I created a task that removes itself when an external variable x,is changed: ...
2k views

### What are the cool kids talking about when they use ##&[]? [duplicate]

All the cool kids are apparently using ##&[] for Unevaluated @ Sequence[] but I have no idea what either means. ...
2k views

### Recursion depth of 1024 exceeded during evaluation [closed]

This is my very first day using Mathematica, so please forgive me my complete ignorance... I fear that this might be one of those questions that gets rejected for being "easily found in the ...
65 views

### Coordinates of MeshPoints

The output of a set of differential equations solved with NDSolve produces a series of curves and I need to obtain the spacing between these curves at a given level ...
181 views

### How to apply list of values to a list of functions

I have the following: first= {1+a,2+a,3+a,4+a} and a list t={0,1,2,3} I want to evaluate the first element of "first" at ...
88 views

### Block assignments not quite sequential?

With scalars, Block acts like Scheme's let*, that is, the assignments (appear to) happen sequentially: ...
64 views

### Parallel evaluation hangs before doing anything

[I use Mathematica 9.0.1.0 on OS X Yosemite 10.10.2.] I am experiencing difficulty with parallel evaluation that I am finding extremely perplexing to troubleshoot. I define the following function in ...
77 views

### Show [In] and [Out] tags after quitting Mathematica

I cannot find a way to show [in] and [out] tags when evaluating cells after I close the application. Is there a way to keep these shown? I disabled the kernel in global options but cannot transfer ...
71 views

### How to see partial results during evaluation [duplicate]

I am computing a long Table[], but the computation of the last few elements is taking too long, and I am afraid I will never converge. I would like to access the ...
80 views

### I have several functions and how I know which one is the maximum in a certain range?

What I did are the followings These lines will generate a piecewise function pw which tells me the corresponding variable given an interval as follows: Now, I want to get: names of variable ...
98 views

### Prevent evaluation of certain cells / code segments

I´m not quite sure if I ask a stupid question but I could not find an appropriate answer in the forum... I have a variety of cells (= code segments) in my notebook which I would like to evaluate in ...
208 views

103 views

### Strange behavior when setting NumericQ of a symbol

It happens both in v9&v10. If you try this a^0 a^0 (1/a)^(3/2) a^0 (1/a)^(5/2) Mathematica returns 1 (1/a)^(3/2) (1/a)^(5/2) It's trivial. However,...
156 views

### Why can't I abort main evaluation from ScheduledTasks (Service Link)?

FrontEndExecute[FrontEndToken["EvaluatorAbort"]] is equivalent of the menu item: Evaluation >> Abort. It works with ...
74 views

### function definition with a given list of parameters: how to use Evaluate[] properly?

given a list of variables variables = {a, b, c}; I want to automatically define a function f[{a_,b_,c_},x_] := g[a,b,c,x] (...
95 views

### How to make strong assumptions?

Or put in another way, how to make a variable behave as it belongs to a specific domain, even outside the use of simplify or other commands alike? For example: ...
126 views

### How to prevent long evaluation and infinite loops [duplicate]

I'm new to this, so sometimes I accidentally ask Mathematica to do calculations with numbers so big that it can't handle it and it immediately freezes my laptop to the point where there's nothing I ...
221 views

### There is an issue with Manipulate in which it updates its argument twice in V10

I have asked this question before (here) and I thought that the issue is only when moving the Notebook window. It appears that Manipulate is working in weird manner. ...
209 views

### How to evaluate some parts of an expression inside Hold? [duplicate]

I want to return a Hold expression but with some parts pre-evaluated. The easiest way to explain this is probably through code example. Here is what I have ...
281 views

### How to abort running evaluation?

I would like to implement a "Stop" Button into a program that basically consists of a loop. Unfortunately I do not how to interrupt the running evaluation. Minimal Example: ...
90 views

### Creating a lazy evaluator of the lambda calculus

I have a sub project in my research to write a lazy evaluator of the lambda calculus. How should I approach this problem? I already have a implementation of the lambda calculus in another language. ...