# Tagged Questions

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

68 views

### How to force evaluation inside the body of a pure function?

For example, I'm writing a function to scale my list of numbers into a specific range. It goes like ...
59 views

### How to plot a function, that is not properly defined in mathematica? [closed]

After rather long and relatively complicated calcuations, I finally got to a point where all my $x(t)$ functions are ...
147 views

### What is the Difference Between Rule (->) and RuleDelayed (:>)?

I am new to Mathematica so this question may seem rudimentary. Sorry for that! :) I want to implement the well-known property of Kronecker's Delta \Sigma_{i=1}^{n} a_i \delta_{ij}=a_j,\quad 1 \le ...
189 views

### Expand series unevaluated

I'm newbie in Mathematica. I'd like to obtain nice and verbose output for any series calculation. For example, given a simple sequence n*(-1)^(n-1) and ...
71 views

### Why Unevaluated doesn't work on unheld side of Rule/RuleDelayed?

Unevaluated is a function that I never truly understand, and here's one of the cases confusing me: ...
148 views

### Why one needs two Unevaluated to show 1+1 correctly in TreeForm?

The task sounds simple, give the tree plot of 1+1. However, after some trying, I can only make this possible by using two Unevaluated. ...
60 views

### Convert an evaluated in place code to original

I like "Evaluate In Place," because it hides code and works well. However, I can't figure out how to return to the original code when I want to modify it. I'm sure there is an easy way, but I can't ...
470 views

95 views

### Evaluation of a Notebook

I am new to Mathematica so I do apologize if my question is too elementary. In the start of my notebook, I want to make sure that any previous definitions are wiped out so I use the ...
97 views

### Map works but Thread doesn't

This question may be trivial, but I can't get past it for the life of me. I have $n$ matrices of dimension $p_i \times N_i$, with $i$ indexing the $n$-set. I also have $n$ vectors of the appropriate ...
152 views

### Evaluate numerically an extremely small number

How to evaluate numerically $e^{-4 \cdotp 10^{35}}$ in the form $0,a_1a_2...\times 10^{-n}$ ...
52 views

### An issue regarding the use of CopyToClipboard with dynamic content

Please, consider the following code: ...
50 views

### Recognition Power Head for numeric value

We know: Map[Head, {a, a^2, a^3}] (* {Symbol, Power, Power} *) and Map[Head, {2, 2^2, 2^3}] all of them will be known as <...
43 views

### How can I use x->Root outputs from Solve? [duplicate]

Do not understand the meaning of the output given by Mathematica to this equation: ...
45 views

### EvaluationMonitor and variables with indices + subscripts

I have encountered the following problem while using EvaluationMonitor with NMinimize: variables that have both a subscript and an index, e.g. Subscript[x,y][1] do ...
51 views

### Manipulate curves [duplicate]

I want to draw curves with manipulation. When I use the following code, I receive nothing. ...
49 views

### How trap expression that doesn't evaluate?

If evaluating an expression produces an error, it's easy to trap that using Check or Throw......
37 views

### Access variable middle of the run [duplicate]

I execute a Table[] that need large time to be finished. If I abort it I loose what evaluated until now. Does it possible to stop running and save what evaluated ...
892 views

### Why is this 2D plot so slow?

I first do a 3D Plot of four surfaces (eigenvalues of a $4\times4$ matrix) over $kx,kz$ (setting $ky=0$ all along). And then I try to give a 2D plot along three connected particular lines in $kx,kz$-...
42 views

### Substitute arguments before evaluating variables in Block [duplicate]

Suppose I have f = x^2; mod[x_] := Module[{}, f] Then mod[3] returns x^2. Is there any way to tell Mathematica to treat the "x" inside of f as the same "x" as ...
83 views

### Unexpected behavior of Set [closed]

Set doesn't work in some conditions. ...
199 views

### Evaluation of Alternatives

I recently stumbled upon a few examples that suggest patterns containing Alternatives do not evaluate for individual alternatives. For example: ...
59 views

### Solving a polynomial equation with an approximate constraint is slower than the symbolic solution

Why do these two operations have such different timing, when the only difference is specifying r as approximate $0.1$ vs arbitrary-precision $1/10$? Here are the ...
89 views

### How can I draw truth tables using Mathematica [duplicate]

For instance, the given expression p ⊕ (p v q) In the problem I'm trying to solve. There's a Mathematica answer to this: ...
40 views

### Why doesn't Grid evaluate when I wrap all its arguments in Dynamic? [duplicate]

Here is a small program involving Dynamic: ...
106 views

### Clearing a global variable from inside a Module

This is a highly simplified version of a initialization problem I have with a complicated program with many (about 100) modules. If one enters: X=42; Clear[X]; the ...
72 views

### Evaluation of a list

I'd like to assign to $a[1],\ldots,a[m]$ ($m$ being defined beforehand) zero values. I tried Table[a[i], {i, m}] := Table[0, {m}]; but got an error message <...
62 views

### Controlling evaluation in a custom summation function

I'm doing some computations that involve summations with many indices over the same range - consider the simplified example Sum[a[i,j],{i,1,2},{j,1,2}]. To prettify ...
308 views

### How to inject unevaluated list of Unique into a RuleDelayed?

I am writing a function that constructs a rule which has Unique[] in the RHS. Here is a simplified segment of code ...
456 views

### Order of evaluation - does Mathematica evaluate variables before or after substitution?

Let's say I write y = x^2; x = 10; z = y + y^2 + y^3 Does Mathematica internally evaluate y before or after substituting it into z? I.e., does Mathematica ...
152 views

### Evaluation inside Inactivate

The documentation for Inactivate makes the function sound really powerful because it gives granular control over which kind of expressions specifically not to ...
35 views

### How to calculate a required definition only once for each iteration of NonlinearModelFit [closed]

This is my first post here. I've been using Mathematica for about 4 years now to analyze data, but am still very new and have no background in formal programming. This is the first question I couldn't ...
78 views

### Append fixed value to random selection of list

(This question might be an application of this other question, but there might be another solution specific to this application that I'm not aware of.) I am currently in a situation in which (in a <...
73 views

### Strange behavior of ArcTan [duplicate]

I've noticed a strange behavior of Mathematica's ArcTan function with two arguments. If both arguments are 0 or ...
122 views

### Working with ScheduledTasks inside DynamicModules

I have a question - is it possible to run ScheduleTask[] inside DynamicModule[]? What I have tried so far: ...
91 views

### Check an Option without Evaluation

Consider the following: ...
55 views

### How to avoid 0 OverVector[F] to be evaluated as 0?

I am fairly new in Mathematica and I am trying to work with scalars and vectors. I decided to denote vectors using OverVector (as example, ...
258 views

This is probably a very simple question, but I couldn't find a duplicate. As everybody knows, {x, y} + v gives {x + v, y + v}. ...
102 views

### Derivative before Numerical Integration

I need to take the derivative of a function that have a numerical integration on it. The variable in which the integration will be taken is not the same as the one in which the derivative will be ...
922 views

### How to restart computation when kernels die?

When an important process needs to be kept alive, there are monitoring tools to restart them if they die (e.g. god tasks in ruby), in my case I have an overnight scraping task that I need to have done ...
90 views

### Is there an analogue of Evaluated->False (in FindRoot) for FindMinimum?

I guess functions like FindRoot, FindMinimum, etc puts the estimation number into the expression, and then do other calculations....