# Questions tagged [evaluation]

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

1,159 questions
Filter by
Sorted by
Tagged with
208 views

### Create local alias for variable

I have a function whose parameters are passed "by reference" Clear[foo] SetAttributes[foo, HoldFirst] foo[t_] := t = 10 Is it possible to create an alias for <...
204 views

### Safe alternatives to ToExpression

Background Conversion from string/boxes to expression is quite common. Very often the goal would be a simple switch from "1" to ...
60 views

### Table and evaluation order

I thought Table should not evaluate the inner code until it inserts the value. I'm confused by test1="a"; test2="b"; Table[DownValues[i],{i,{test1,test2}}] ...
30 views

### Computational discrepancy for plugging in equivalent forms into an expression

When the following 9th root of unity is raised to the 6th power a 3rd root of unity is returned. (Power[-(1/2) + (I Sqrt)/2, (3)^-1])^6 // N -0.5 - 0.866025 I ...
147 views

### Why is Mathematica not able to give out a simple integration result? [closed]

I am testing Mathematica to evaluate an innocuous integral - It is a straightforward integration but just involves a lot of constants. I do not understand - "why the computation has exceeded the ...
464 views

### How can I create a “Run all code” button in a notebook?

How can I create the "Run all code" button (at the top right corner) in Mathematica notebook? The current method I have is to save the .nb file into .wls (i.e. Wolfram Language Script), and then open ...
50 views

### Using List of Variables to construct Control[] within Manipulate[]

How can I use a list of variable names within Symbol[] inside a Manipulate[], specifically using ...
32 views

### Tracking System function (Get) calls, and Stack[_]

Consider the following attempt and variations thereof to track (nested) calls to Get (reasoning of this approach below): ...
54 views

### How to get a single evaluation of RandomReal in a Block

I want to generate (and eventually sample) a sine wave with a random frequency in the range [½, 1] (i.e. capture somewhere between half and one period of the waveform over the domain [0,1]). The two ...
50 views

46 views

### Recover result after “Set” error

I have a function someFunction[] that takes a long time to evaluate. I would like to run ...
79 views

### Listable function behaving in an unexpected way

For example, if I define a function like this: SetAttributes[func,Listable]; func@{{1,2},{3,4}} it gives the result like: ...
76 views

### Detecting transformation rules and removing them

Is it possible to detect the non-standard transformation rules (DownValues, UpValues, etc) that activate in an evaluation (and ...
94 views

### Possible bug in Refresh[x, None] on the very first x = val

Bug introduced in 8 or earlier and persisting through 11.3 [CASE:3995912] From Refresh docs: Refresh[expr,None] ...
148 views

### Suppressing the automatic newline in Print

Print automatically generates a newline at the end of the expression that is being printed. How do you suppress this automatic newline?
61 views

### OwnValues for Set and SetDelayed

I am unclear about the OwnValues for Set and SetDelayed. ...
106 views

### Replacements in Manipulate [duplicate]

I would like to understand why this is not working: replacement = {a[t] -> r}; Manipulate[Plot[a[t] /. replacement, {r, 0, 1}], {t, 1, 2}] But this does: <...
140 views

### Print generates a cell with style “Print”

The Wolfram documentation for "Print" says the following: In a notebook, Print generates a cell with style "Print". What does it mean by style "Print" since ...
397 views

### How to evaluate the trace of a product of sums of gamma matrices

I have a large expression of a sum of gamma matrices which resulted from using Casimir's Trick. It is quite tedious to evaluate so I thought about using Mathematica. However, I have no idea how, ...
66 views

### Compute and evaluate function of a function and keep the result a function

Let's assume I have a various functions for signal amplitudes, e.g. pulse[t_] = Sech[t]^2 and pulse2[t_]L = Exp[-2t^2]. What I'...
140 views

### Why does this system of PDEs take a long time to evaluate?

I am trying to simulate the growth of cell populations through a system of coupled PDEs. There are six equations in total but Mathematica takes a long time to solve the system (+6 hours running) and ...
288 views

### How to evaluate a notebook several times with distinct parameters?

I have a code, which is quite large. There, I consider parameters that are used inside series of procedures and numerically solved differential equations. At the end I plot the solution for those ...
50 views

### Delete Part of Deferred Expression

Szabolcs provided an elegant answer to my previous question about printing executable code that uses Defer: ...
70 views

### Calculation time for a limit, is my calculation still calculating?

I am calculating the limit of an eighth order derivative with ~700 terms. The notebook has been in the 'running' phase for a few days now. If it says it is still running, does this necessarily mean ...
37 views

### Reading out Manipulate controls dynamically generated in a list

I've been trying to dynamically generate Manipulate controls in a list, like so: ...
617 views

### Is it possible to construct a fullform trace function

Is it possible to construct a FullFormTrace function that takes an arbitrary expression and prints a sequence (or returns a list) of the evaluation steps in full ...