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

learn more… | top users | synonyms

9
votes
0answers
66 views

Is there a way to TagSet a HoldAllComplete function?

Let's say I want to overload the built-in function Lookup, to handle my data wrapped in myObject. One would use ...
6
votes
0answers
67 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: ...
6
votes
0answers
46 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
171 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 ...
6
votes
0answers
125 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
183 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
127 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 ...
4
votes
0answers
118 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
81 views

Regarding Evaluated True

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

Is there a way to stop evaluation immediately?

Sometimes I'll have a loop that I accidentally made too big. I'll evaluate, and MM will try to run through the entire loop. The program itself doesn't actually seem frozen... I can go to Evaluation-> ...
4
votes
0answers
263 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 ...
4
votes
0answers
526 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
87 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
84 views
3
votes
0answers
75 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 ...
3
votes
0answers
54 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 ...
3
votes
0answers
90 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. ...
3
votes
0answers
173 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 ...
3
votes
0answers
114 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, ...
2
votes
0answers
45 views

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

I have an iterative matrix product of this type Since i didnt knew how to do it, I explicitly wrote the product as {Ayn + Bxn, Cyn + Dxn} and evaluated it with the NestList construct ...
2
votes
0answers
53 views

Estimating processing time for commands

I am trying to evaluate some equations by using Taylor series of expansion (Series[], ExpandAll[], and Normal[] command), and using n equation and n unknown (Solve). Following is not full command (if ...
2
votes
0answers
71 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
80 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
500 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
120 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
33 views

Prevent infinite product from trying to evaluate?

Consider an expression involving several infinite and non-infinite products, like ...
1
vote
0answers
104 views

Why this expression is not evaluated correctly?

Look at the following code: ...
1
vote
0answers
55 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 ...
1
vote
0answers
57 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 ...
1
vote
0answers
111 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 ...
1
vote
0answers
47 views

Unexpected order of evaluation in ForAll

I noticed that ForAll behaves rather unexpectedly when its first argument is a symbol which has been Set in an outer scope. For ...
1
vote
0answers
89 views

Smart pointer for Mathematica?

Would the implementation of the smart pointer idea be possible in Mathematica ? Let's say I have an object "o" of the form Class[object] where object is an Association, and Class has the HoldFirst ...
1
vote
0answers
56 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 ...
1
vote
0answers
72 views

Evaluation inside Compile

here's a simple question: I have a function: ...
1
vote
0answers
81 views

How to implement nested With as a single construct using functional programming (Fold)?

It is possible to define my own With construct where each local constant can depend on the previous defined local constants? I wish to replace something like this ...
1
vote
0answers
162 views

Expression for evaluating multiple functions?

I am constructing 3D data points for a plot and corresponding to specific conditions "manually". I define the values of five parameters [these I always have to define myself]. From those, I evaluate ...
0
votes
0answers
34 views

Creating a non-zeta-ified sum

The expression Sum[i^(-s), {i, 1, ∞}] evaluates to Zeta[s] But, of course, this is not strictly correct as ...
0
votes
0answers
41 views

Parallelization and efficiency improvement

Hey i am new to mathematica and at the moment i am writing some test code. It works but it is unrefined. I try to make it more efficient by using parallelization or other techniques. I wanted to ask ...
0
votes
0answers
29 views

Strange cell evaluation state

I have encountered a strange cell evaluation state (Shown in the image). It seems to be related with unknown variable a. What does this state means ? how it is different from simple error ?
0
votes
0answers
43 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 ...
0
votes
0answers
34 views

How to calculate a required definition only once for each iteration of NonlinearModelFit

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 ...
0
votes
0answers
43 views

Order of evaluation for numeric functions

I'm trying to plot a 3D vector field to illustrate an electric field of a uniformly charged disk, and I used Manipulate to change the radius R of the disk to see ...
0
votes
0answers
81 views

Skipping sections of a notebook automatically

I have a notebook which allows to set some parameters at the start, and then does computations depending on these parameters. It is a long notebook and for readability it is broken up into sections ...
0
votes
0answers
70 views

Memoization and upvalues

Can I store an algorithm to one variable and the result as an upvalue to another? With regard to the problematic code below (real algorithm and argument test omitted), I would like to store the ...
0
votes
0answers
53 views

What makes items with head `Function` different?

I apologize beforehand for the muddleheadedness of this question. It reflects the fact that I'm trying to interpret outward "behaviors" of Mathematica expressions without having any understanding of ...
0
votes
0answers
77 views

How can I solve this expression?

I'm trying to solve this expression for A, but I'm not sure how. ...
0
votes
0answers
84 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. ...
0
votes
0answers
110 views

How to speed up my code with constructing matrices

I have run this program for a long time to get the result for n = 2048(about 5hours) and no more result till now (can't run with n = 4096). I would know how to make it more efficient. Any help or ...