Questions tagged [evaluation]

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

104 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
19
votes
0answers
187 views

Status of all Evaluators?

Since I have 4 cores on my machine I typically have 4 notebooks open each with their own kernel evaluator. I'd like to construct a dynamic pane similar to the parallel kernels status window: But that ...
10
votes
0answers
117 views

'Visibility' of Dynamics in TabView with respect to SynchronousUpdating

Bug introduced in 11 or earlier and persisting through 12.0.0 CASE:4076464 Example 1 ...
9
votes
0answers
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] ...
9
votes
0answers
321 views

Built-in symbols which are more close to the root/core of Wolfram Language

Seeing the vast scope of science covered by the Wolfram Language (WL) and the large amount of built-in symbols (functions), I am curious to know which built-in symbols are more close to the root of WL,...
8
votes
0answers
134 views

Relation between the syntactic and evaluated Association

This question is inspired by this answer and related to unsolved post "Association's Attributes change between 10.3.1 & 10.4"...
8
votes
0answers
174 views

Regarding Evaluated True

Done a bit of reading: Normal[Series[ ]] does not give a normal expression Regarding the Evaluated->True, consider: ...
7
votes
0answers
82 views

How useful is $SynchronousEvaluation?

Example SessionSubmit @ Print @ $SynchronousEvaluation Will print False even though ref/SessionSubmit/Details last point: ...
6
votes
0answers
159 views

Can we change a pattern once we throw them into pattern matcher?

Main Problem Mathematica's pattern matching mechanism seems fairly well in most cases but in some situations, I would like to ask for a bit more freedom. We can easily call for extra evaluation ...
6
votes
0answers
131 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......
6
votes
0answers
327 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....
6
votes
0answers
211 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 ...
5
votes
0answers
35 views

Plotting a NumericQ-protected function with the attribute HoldAll fails

This works: ClearAll[f1]; f1[x_] /; NumericQ[x] := x; Plot[f1[x]^2, {x, 0, 5}] This does not: ...
5
votes
0answers
100 views

Dynamic evaluation of Histogram

Can someone explain the following behavior exhibited by a combination of SetDelayed, Dynamic and ...
5
votes
0answers
72 views

Sequence in Association

Inspired by this question Association's Attributes change between 10.3.1 & 10.4? I have been feeding a variety of strange expressions into Association. ...
5
votes
0answers
239 views

Can I define an axiomatic (Boolean algebra) system and prove theorems using Mathematica?

The general question is Can I define an axiomatic system and prove theorems using Mathematica? The more concrete one is about Boolean algebra. I consider this axiomatic Boolean algebra system (...
5
votes
0answers
143 views

Are there any videos that show how different Mathematica expressions are evaluated?

Are there any videos that show how different Mathematica expressions are represented internally as object graphs and demonstrate how they are transformed during an evaluation? I am asking because I ...
5
votes
0answers
760 views

A is fast, B is fast, but together they're Mathematica-crashing slow?

I'm trying to do something with finding solutions to a quantum mechanics problem with n wells. If there are 40 wells, I need to find the solution to an equation in the form: ...
4
votes
0answers
47 views

Run computation in separate process and kill it after a time limit

I am looking for a solution to run a Mathematica calculation in a separate process (separate kernel) and cancel the computation after a given time. If it cannot be cancelled, then just kill that ...
4
votes
0answers
80 views

ScheduledTask DateObject pattern to evaluate at same time everyday

I would like to create a ScheduledTask that evaluates at the same time everyday. Such as, evaluate function at 1:00 am everyday. The "Daily" timespec in ScheduledTask doesn't allow me to control the ...
4
votes
0answers
111 views

Why does x++ behave strangely under Defer?

Bug introduced in 10.4.1 or earlier and persisting through 11.1.0 or later Using x++ or x=x+1 inside ...
4
votes
0answers
65 views

Why does FreeQ seem not to work with complex numbers?

I guess I do not understand how Mathematica evaluates this simple expression inside FreeQ ...
4
votes
0answers
132 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 ...
4
votes
0answers
126 views

Functional-Style Fixed-Length Queue Object?

Following up on question Side-effecting an array in an association? and @Mr.Wizard's answer in there, I'm modernizing and tweaking Daniel Lichtblau's efficient queues and ran into a little roadblock. ...
4
votes
0answers
203 views

Memory problem in Mathematica 10

I'm having a problem with memory. I'm doing nonliner fits of several data lists to a system of differential equations. When I evaluate the "Do" cycle the memory grows with the iteration step up to my ...
4
votes
0answers
391 views

DynamicModule, SaveDefinitions and global functions

Unfortunately, I had not checked stackoverflow, because there, the exact same behavior was already reported. Please see the Q&A "SaveDefinitions considered dangerous". Up-front, I'm on Ubuntu 12....
4
votes
0answers
97 views

Problem with inequality using refine

I am using inequalities to follow some line of reasoning in Mathematica and I came across a problem I can not explain to myself. Does from a>=0 and b>=0 not follow a+b >= 0? How does Mathematica ...
3
votes
0answers
65 views

How to plot function with pattern-matched argument and catch-all definition that throws

Consider the following function: f[n_?NumericQ] := n; f[args___] := Throw[{args}]; Then try to plot it: ...
3
votes
0answers
86 views

Language`ExpressionStore and ParallelMap

Is there a way to access NewExpressionStore from within a parallelized calculation? I have tried variations of ...
3
votes
0answers
62 views

Understanding the difference between EvaluationNotebook and ButtonNotebook (and their FrontEnd` versions)

The Documentation for ButtonNotebook says: ButtonNotebook[] gives the notebook, if any, that contains the button which ...
3
votes
0answers
80 views

Optimization for iterating and plotting a matrix product and its elements?

I have an iterative matrix product of this type $$ \begin{pmatrix}y_{n+1} \\ x_{n+1} \end{pmatrix} = \begin{pmatrix} A & B \\ C & D \end{pmatrix} \begin{pmatrix}y_{n} \\ x_{n} \end{pmatrix} $...
3
votes
0answers
121 views

Check an Option without Evaluation

Consider the following: ...
3
votes
0answers
274 views

How to Implement a “Function Object” suitable for NDSolve and Finite Element Method?

I have a bunch of methods that shoud return an expression that behave like a function, i.e. an expression that, when supplied with suitable arguments, evaluate to something. A simple ...
3
votes
0answers
127 views

Assign variables from list inside With or Module

I have found that it is possible to assign variables from lists, as follows. r = {1, 2, 3}; {a, b, c} = r; b 2 However, if ...
3
votes
0answers
1k views

Lazy evaluation/loading of parts of an expression

Is it possible to have an expression x such that its elements are only evaluated when they are individually accessed, for example when evaluating statements like <...
2
votes
0answers
31 views

Do not evaluate function inside of another function for simplification

Consider the simple example : ff[x_] := x^2 gg[x_] := (ff[x] - ff[-x])^2 Let's assume I would like to expand g[x_] as a polynome of ff[x] and ff[-x], but I don'...
2
votes
0answers
65 views

Wrong result using “numeric” symbols

Recently I stumbled upon a weird bug when I used a package that sets the NumericQ result of symbols you are feeding into a certain function to true. Here is a minimal working example of what I mean: ...
2
votes
0answers
53 views

Problem with PopupMenu: Its values don't update dynamically

I have a problem with PopupMenu inside DynamicModule, its values don't update dynamically as they supposed to. The example below ...
2
votes
0answers
78 views

Calling a notebook from a different notebook

Basically I have a notebook (let's call it nb1) that when evaluated yields one number when I specify some parameter $\alpha$ (in nb1). I want to call nb1 in a different notebook (nb2) using for ...
2
votes
0answers
140 views

Formal Power Series and 0^0

I'm having the following problem: I define series = Exp[Sum[Subscript[J, n]/n t^n, {n, 1, \[Infinity]}]] and it's all fine. Also when I ask Mathematica ...
2
votes
0answers
56 views

Parallelize evaluation of initialization cells

I have a notebook with about 20 initialization cells. Evaluating all of them takes a few minutes. Mathematica uses only one core for this. In my case, the cells are all independent so it should be ...
2
votes
0answers
84 views

$Epilog does not work when exit

The following code does work: $Epilog := Print@1; Quit[]; But if I close the document and exit WM or click QuitKernel, it does not work. Why?
2
votes
0answers
85 views

Is it possible to pipe the output of EvaluationMonitor to Excel?

I have an EvaluationMonitor setup to capture the points processed by NIntegrate. This is a case where the same function, integrated over the same region in cartesian coordinates yields a dramatically ...
2
votes
0answers
109 views

Assign a value to a variable without using Set or SetDelayed?

I supose probably yes, but at the end I assume that internally mathematica has to use Set or SetDelayed. Am I right? Background: I am developing a super simple phraser that takes a code description ...
2
votes
0answers
125 views

Strange double evaluation using MorphologicalGraph

(MMA 9.0.0 on Mac OS/X 10.8) Please consider the following snippet (this is as SMALL as I could make it -- my attempts at making a smaller repro-case eliminated the effect that I am investigating) <...
1
vote
0answers
31 views

Changing machine precision notebook-wide leads to peculiarities

For a project of mine it is preferrable to set notebook precision globally. I have done so by using the answer in Global precision setting. The idea is to dynamically create a ...
1
vote
0answers
36 views

How to speed up the evaluation of a sum of incomplete Gamma functions?

We need to do a ContourPlot for the following function $H[x,y,n]$: ...
1
vote
1answer
62 views

How to get ReplaceAll to happen before function call

I have a problem I am attempting to solve with NMinimize. I have a scoring function, which will give me a final score. The problem has many variables, so instead of having them as parameters, they ...
1
vote
0answers
43 views

Differentiating functions of Set expressions

There are so many things in Mathematica I think I will never understand. Perhaps today there will be one fewer... B'[y]/.B->Function[y,y^2] Outputs ...
1
vote
0answers
98 views

Why is my Mathematica notebook resetting all my previous computations after some hours?

I am using Mathematica 11.1. This morning I started some calculations in the hope that when I come back from work, they will be finished and I can get on with the rest of my project. Indeed, when I ...