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

learn more… | top users | synonyms

5
votes
1answer
53 views
2
votes
1answer
121 views

How to properly define this function of function

I encountered real problem at first, and here is the toy example variable argument stored some expression that is generated from other parts of the program. I ...
1
vote
0answers
79 views

Meaning of Abs´? [closed]

A friend showed me the code below. r[i_] := {x[i, t], y[i, t], z[i, t]}; rji = r[i] - r[j]; solap = 2 a - Norm[rji]; FullSimplify[D[solap, t]] I'm unsure about ...
26
votes
4answers
1k views

Asynchronous evaluation: Is it possible?

Currently we have a limited number of ways to perform asynchronous evaluation. The most common is through Dynamic and Manipulate...
5
votes
2answers
108 views

Parallel function evaluation for minimal value

I am asking myself, if the evaluation of a function f looking for a minimal value over a discrete set of values can be parallelize (brute scan for a potential ...
1
vote
1answer
63 views

Resolving Error: Mathematica evaluation order on Lists

I have a table that is 27 x 27, each entry corresponds to an element from the periodic table. I use the replacement rules in element list to allow me to convert a list of elements into a list of ...
2
votes
3answers
6k views

Step-by-step definite integration

I am interested in obtaining the intermediate steps for rather straightforward symbolic definite integrations (e.g., from an elementary calculus text). As an example, for $\int_0^1 x\,dx$ I'd like ...
2
votes
3answers
122 views

Evaluation inside a Manipulate

Let's assume I have a symbolic expression, and inside a Manipulate I define the actual values: ...
1
vote
2answers
64 views

Plot of function-generated lists: Why does this workaround not work?

My problem is a classic one: I want to plot a function-generated list, and there's no way to pre-evaluate (because the actual function includes NMinimize and thus ...
0
votes
2answers
111 views
2
votes
1answer
84 views

Errors in plotting regular function

Suppose we want to define Tanh-function via exponent: th[x_] := (1 - Exp[-2 x])/(1 + Exp[-2 x]); FullSimplify[th[x]] Out[13]= Tanh[x] Then we define new ...
5
votes
2answers
287 views

Evaluate notebook from other notebook

I have a notebook ("notebook 1") which in the beginning sets some parameters, does something depending on their value and saves the result to a file, say: ...
1
vote
1answer
42 views

Aborting an evaluation automatically after a specified time elapsed

I use the following code to evaluate a series of notebooks: nb1 = NotebookOpen["C:\\Users\\....nb"]; SelectionMove[nb1, All, Notebook] SelectionEvaluate[nb1] ...
1
vote
1answer
52 views

How do I dynamically update “name” of Action Menu?

I have created an action menu that allows you to change the style of a cell. It works. However, I would like it to dynamically update the action menu "name". I can't get the name to refresh. ...
1
vote
1answer
67 views

Trace and SameTest in Union [closed]

This question is actually two question. First, I feel so stupid that I just don't understand the use of theSameTest option in ...
4
votes
0answers
90 views

Simple arithmetic with Irrationals fails [closed]

While solving a simple puzzle that asked for a few calculations in plane geometry, I ended up with this expression: $-\frac{55}{2}+\frac{\sqrt{27233}}{2}+\frac{1}{2}(55-\sqrt{27233})$ Or, in ...
1
vote
1answer
42 views

Unpacking NumberForm expressions

Given a NumberForm expression, e.g.: NumberForm[N[Pi], 10] How does one get the underlying numerical expression (short of ...
1
vote
1answer
42 views

How to enable automatic “grammar check” for MMA? [duplicate]

The special evaluation mechanism of MMA might make it more likely for MMA users (especially new users) to make mistakes and more difficult to find them. For example, one may have defined a function ...
1
vote
1answer
133 views

Why isn't Mathematica reducing my result to a number? [closed]

I do not understad why the program do not show the number values. Even when I use N[xx]. How can I simplify this?
5
votes
3answers
75 views

StepMonitor won't display Plot

This example is from the documentation under Monitor ...
7
votes
1answer
289 views

NMinimize with NIntegrate (crash in symbolic evaluation, memory leak)

This is a "common" problem from what I've seen, but with a different spin. I have a function I use often that finds a fit of an expression to another expression with some free parameters (e.g. for ...
3
votes
3answers
212 views

How to make a defined symbol stay in symbol form?

How to make a defined symbol stay in symbol form? w = 3; g = 4; {w, g}[[2]] 3 I want the output to be ...
0
votes
0answers
42 views
1
vote
1answer
157 views

Printing intermediate calculations in an external file, while suppressing the output in the notebook

I'm trying to construct a text-file that contains all the operations that Mathematica performs when evaluating an expression. However, i'd like to suppress all output in the notebook in which I'm ...
2
votes
2answers
80 views

Singleton pattern

How can I implement the singleton pattern in Mathematica in order to ensure that a symbol is not redefined if it's already defined ? This can be useful for example with global variables in packages ...
4
votes
1answer
389 views

mathematica does not evaluate without internet access? [closed]

I am watching the video Hands-on Start to Mathematica Basic Graphics and for about 15 minutes I was trying to evaluate $\frac{\sin x}{x}$ and each time I encountered errors like: The result can ...
2
votes
2answers
394 views

Get the approximate analytical solution to an algebra equation

Is there a way to get the analytical form to the root of this equation: 2 A e (-ArcTanh[smax/s0] + ArcTanh[(smax Cos[w ζ])/s0]) == F0 ...
3
votes
1answer
64 views

How to evaluate an expression via `LinkWrite` when the expression is only known at runtime?

*** Here's the original post... I'm setting up a secondary kernel in sandbox mode with LinkLaunch, and need to pass various expressions to it for evaluation. These ...
7
votes
1answer
154 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 ...
7
votes
1answer
143 views

How would one return from a place of a pure function's body using Return?

From previous answers, replies and discussions it is known, while not formally documented (even in the most recent Wolfram Language Documentation Center), that Return can be used in a two-argument ...
1
vote
1answer
115 views

Evaluate multiple notebooks sequentially and automatically

I know how to run multiple notebooks at once. But my problem is that due to the RAM capacity, I have to run these notebooks consecutively. Another problem is that since I may not be in my office all ...
0
votes
1answer
91 views

Special fractions generator

Note that 13/33, 1313 / 3333 , 131313 / 333333, ... They are always equivalent fractions Fraciones generate desire to have this property based arbitrary ...
5
votes
1answer
35 views

How could I set TimeConstrained globally?

I want to set TimeConstrained globally, I tried use $PrePrint as bellowed script: ...
1
vote
3answers
102 views

Keep leading/trailing zeroes (like Defer except with numbers) in a given number

I'm trying to write a function that counts the number of significant figures a given number has so I can ensure my calculations are rounded correctly; however, I am having a lot of trouble preventing ...
0
votes
0answers
158 views

How to determine how much time it will take to finish a cell expression?

I am trying to integrate a large matrix with elements that contain trigonometric expressions. The evaluation is taking a long time--4 days, and it is still running. Is there anything I can do to find ...
10
votes
1answer
458 views

A problem about the implementation of Bezier curve

I implemented the Bezier curve like built-in BezierCurve as follow: SplineDegree -> d specifies that the underlying ...
1
vote
1answer
49 views

problem about Root and Hypergeometric2F1

See these example, why does the output is different? ...
1
vote
0answers
40 views

Why does the same function defined by Set and SetDelayed look different? [duplicate]

I start with the following input: f[n_] = Sum[(1+x)^j, {j,1,n}]; g[n_] := Sum[(1+x)^j, {j,1,n}] When I try to evaluate the code above I get: ...
0
votes
1answer
195 views

Understanding output of multivariable integration

I'm new to Mathematica and I'm trying to integrate this function: ...
-2
votes
1answer
86 views

Why is my function returning 0 when when I try to give it arguments by replacement? [closed]

I tried running a function f with rules and calling it directly with arguments specified directly but the one with rules returns zero while the one with direct ...
3
votes
1answer
121 views

Strange integration

Bug introduced in 9.0 or earlier and fixed in 10.1 Note: Beginning with V10.1, this integral returns unevaluated but without error messages. I tried to evaluate this line ...
1
vote
1answer
55 views

How to achieve fun[Unevaluated[f][Unevaluated[x], Unevaluated[y]] in a more elegant way?

I have defined a function fun[f_[x_,y_]]. When I call it, I want to wrap everything by Unevaluated: ...
20
votes
1answer
643 views

Incorrect result from Integrate

Bug introduced in 8.0 and fixed in 10.0 I attempted to calculate the following integral: ...
6
votes
2answers
119 views

Force evaluation of the right-hand side of a local variable definition

One can do expression = a + 1; f[a_] := Evaluate[expression] but how would one do something like this ...
3
votes
1answer
65 views

SelectionEvaluate executes out of turn

I'm seeing some unexpected (to me) behavior from SelectionEvaluate. I've got a notebook with two sections. In section 2, I've got code that clears the notebook's ...
3
votes
2answers
151 views

Even with Evaluate[], Mathematica is plotting everything in the same color

The code evals[x_?NumericQ] := Eigenvalues[{{x^2, 2 x}, {x, 3 x^2}}]; Plot[Evaluate[evals[x]], {x, -1, 1}] gives both eigenvalues in the same color. I thought ...
15
votes
2answers
1k views

What happens when you divide by ##?

I've been playing around with sequences a bit. In particular with using ## with unary and binary operators. Let's start simple, the following all make some kind of ...
7
votes
2answers
110 views

Cannot Block Plus

It is customary to use the following idiom to partially evaluate something inside a held expression: ...