Skip to main content

Questions tagged [evaluation]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
39 views

Unevaluated indexed variable in the events when using Table or Array generating a list of events [duplicate]

I want to use Table or Array to generate a list of events for NDSolve, but the variables (<...
xinxin guo's user avatar
  • 1,467
0 votes
0 answers
35 views

SetAttributes on second set of arguments [duplicate]

I am applying functions with the postfix operator syntax (expr//function), and sometimes I add in my definitions some configuration argument (...
Albercoc's user avatar
  • 1,112
4 votes
1 answer
168 views

Why is {_Integer..} matching {_Rule..}?

Why is this getting stuck in a loop: ...
user13892's user avatar
  • 9,661
2 votes
1 answer
96 views

Is it possible to prevent side effects? opposite of Scan [closed]

Suppose I have a function that returns an output, and also does a side effect, such as writing a new cell to the notebook. I would like to use the function but prevent its side effects. Essentially, I'...
Tapiocaweasel's user avatar
10 votes
2 answers
202 views

Evaluation leak in Derivative[]

Bug introduced in 4, persisting through 14.1. I usually only report bugs, but in this case, two reason prompted me to post this: Given that derivatives are computed internally by various commands, ...
Michael E2's user avatar
  • 241k
0 votes
1 answer
36 views

Mysterious evaluation inside DiscretePlot

I'm trying to solve a mystery, I made the following code: ...
Red Banana's user avatar
  • 5,441
0 votes
0 answers
49 views

Modeling distributed computation with Wolfram MultiwayFunctionSystem. How to set priority for certain rules?

I am modeling distributed computation using Wolfram Physics project. I have actors with memory, which compute their state and send messages to each other. All of this represented by a directed graph. ...
Vladimir Gordeev's user avatar
1 vote
0 answers
80 views

How to use the tedious definitional results to make a next definition for FindRoot?

I am trying to use a designed function to find the quasi-normal modes. ...
Robert Xu's user avatar
0 votes
0 answers
55 views

Inconsistent Function Evaluation with FunctionExpand

I'm pretty new to Mathematica and I came across the following apparent inconsistency which I am not able to explain. I'm using Mathematica 14.1.0 to evaluate the Jacobi polynomial $$P_{(n-1)}^{(-n,n-j)...
mARvel00s's user avatar
2 votes
1 answer
81 views

Evaluate section in a loop

I would like to evaluate a section several times for different values of some variables. I can evaluate it once with a simple command, but not in a loop. To evaluate it only once, this code works <...
Albercoc's user avatar
  • 1,112
0 votes
1 answer
70 views

Function thinks it has poles until you expand

Below I have a function func, which I have to evaluate thousands of times for various values of l,m,x. At the value x=0, the ...
A P's user avatar
  • 225
0 votes
0 answers
58 views

How to evaluate Ginsh in Plot3D

I have a function F[x,y] containing multiple polylogarithms $G$ that can be evaluated numerically via GiNaC within the command Ginsh. If say (toy example), ...
CAF's user avatar
  • 510
2 votes
1 answer
233 views

Why does FindInstance[x>0,x] give 27? [closed]

Why does FindInstance[x>0,x] give 27? I would think it would give 1… maybe 2 or some small positive decimal.
Just Some Old Man's user avatar
1 vote
3 answers
58 views

How to programmatically wrap an output expression in a function

When I execute: Audio["ExampleData/rule30.wav"] I get an Audio Object. How can I programmatically wrap the output in another function (without ...
Conor Cosnett's user avatar
2 votes
2 answers
131 views

Force Mathematica to simplify a function to avoid infinities

I am doing some evaluations which return functions of three variables similar to the following: ...
JohnnyB's user avatar
  • 115
2 votes
0 answers
50 views

Evaluation break in WolframScript

Astonishingly, I couldn't find this either by googling or tag search here. CTRL-C completely closes WolframScript (on my Windows 10). But I just want to break the evaluation (if it takes too long). ...
Hauke Reddmann's user avatar
0 votes
0 answers
53 views

How to list all the procedures Mathematica uses when doing some computation and how to control it?

If I compute: Factor[x^3 + x - 2] It will give me the expected result: $(x-1) \left(x^2+x+2\right)$ But if I try the following: ...
Red Banana's user avatar
  • 5,441
2 votes
1 answer
174 views

How to get the output of evaluating in place and append the output to the place

I am trying to use MMA for some engineering calculations, and the text cell contains both descriptive text and mathematical formulas. The example is as follows: ...
Yao Li's user avatar
  • 111
9 votes
3 answers
1k views

Why doesn't b = a; f[a_] := b; f[2] return 2?

As the title asks, why does b = a; f[a_] := b; f[2] evaluate to a rather than 2?
xzczd's user avatar
  • 67.7k
3 votes
1 answer
112 views

What does this statement about "Block" mean in the official documentation?

Initial values specified for x, y, ... are evaluated before x, y,... are cleared. It's from the Details in The reference to Block. And I can't understand it. When are the local variables cleared and ...
Yuehkai's user avatar
  • 33
2 votes
3 answers
93 views

Clearing a list of variables: Problems trying to control the order-of-evaluation [duplicate]

I am having trouble controlling the order of evaluation of mathematica expressions. What I would really like is a general solution, in the form of a pair of functions ...
J Tyson's user avatar
  • 132
0 votes
0 answers
48 views

Solve in solving equation system

I have the following problem: I have a system of equations specifically consisting of 56 equations, with 34 coefficients to be determined, in simplified form: ...
iron's user avatar
  • 1
6 votes
1 answer
142 views

Help in understanding the evaluation inside Plot

My colleague sent me this surprising example of code today (this is after stripping everything unrelated to the evaluation): ...
And R's user avatar
  • 544
0 votes
0 answers
24 views

Keep list of user-definitions

Is there some easy way to keep track of user defined definitions. Or perhaps even better definitions made while some definitionRecordingFlag==True. This is prompted ...
Kvothe's user avatar
  • 4,651
1 vote
0 answers
41 views

Avoiding ugly errors in Manipulate (and alike functions) on start up of Notebook [duplicate]

When there are Cells containing Manipulate this often leads to Errors in cells right at startup. Say I write willReceiveValue={1,2} in one cell and in another <...
Kvothe's user avatar
  • 4,651
0 votes
0 answers
74 views

Wolfram Cloud does not evaluate cells using Shift+Enter

When one clicks Shift+Enter on or evaluates a cell, it prevents you from typing/editing it, so it was thought How can I prevent SHIFT-ENTER moving the editing cursor? would stop this, but it did not....
Тyma Gaidash's user avatar
5 votes
3 answers
157 views

Evaluation control of nested With, If and Integrate

Can you explain the behaviour of the following? The first With outputs unevaluated If. So in the second ...
three777's user avatar
  • 187
4 votes
1 answer
132 views

Functions, Speed, and Evaluate[]

This is a question about how Mathematica works, rather than how to solve a specific instance of an issue, so apologies in advance if this isn't admissible for this StackExchange. I've noticed some ...
ScienceSnake's user avatar
1 vote
0 answers
35 views

Unexpected function evaluation result in Plot [duplicate]

I find some strange behaviors of Plot. The code is: ...
Ming's user avatar
  • 305
0 votes
0 answers
54 views

How to convert LaTeX to expression without interpreting variables as products?

I need to convert some LaTeX code to mathematica expressions. So far I have used ToExpression["ab", TeXForm] yielding ...
Suppenkasper's user avatar
4 votes
3 answers
241 views

Converting to a scalar pure function without getting the warning messages

I am using this from the function repository for which I need to convert one of my functions into a unique form. A simple example is like this: Suppose I have, ...
codebpr's user avatar
  • 2,553
1 vote
0 answers
49 views

Unexpected recursion when enumerator (like Table) uses variable also non-atomically in value list

Consider expression Table[k, {k, {a, b, k}}] which correctly evaluates to {a,b,k}. The duplication of the enumerated variable <...
Anti Earth's user avatar
  • 1,261
2 votes
0 answers
73 views

Changes in the kernel across versions

I was going through the Power programming book by David Wagner, and I tried: ...
Felipe's user avatar
  • 669
3 votes
2 answers
138 views

Different behavior of Clear in different versions of Mathematica

Consider the following code: list1 = {1, 2, 3}; m = 17; {list1, m} // Clear In Mathematica 13.2, this syntax with Clear works ...
John Taylor's user avatar
  • 5,923
1 vote
0 answers
113 views

Save as custom folder in menu bar in 1 step

I found the solution for myself. For some reasons I decided to write the updated content(=solution) at the top. One important reason is.. that you almost don't need to read after the solution. ...
imida k's user avatar
  • 4,325
0 votes
1 answer
104 views

Command to press a button

Under normal circumstances, giving a command to press the Button is stupid. Because we only need to execute the button action of that ...
imida k's user avatar
  • 4,325
5 votes
2 answers
492 views

How to convert this logarithm into this form? [duplicate]

How to convert this logarithm: Log[Log[2]]/Log[2] into this form: Log[2, Log[2]]
csn899's user avatar
  • 4,844
1 vote
0 answers
59 views

Initialization Cell evaluation warning : turned off but still [closed]

I have a two .nb files, MyStart.nb and MyDoing.nb in c:\testfolder. My intention is that if ...
imida k's user avatar
  • 4,325
7 votes
1 answer
297 views

How to condition all cells of a notebook to a specific SeedRandom?

Is there a way to fix SeedRandom[.] for an entire notebook? If I carry out many calculations using random numbers, I need to give a separate code ...
Tugrul Temel's user avatar
  • 6,263
0 votes
0 answers
71 views

Integral evaluates to zero when it should not

I have the following code: f[x_, y_] := KroneckerDelta[x, y] g[x_, y_] := x*y r[x_, y_] := Integrate[f[x, t]*g[t, y], {t, 0, 1}] Now I query ...
Anixx's user avatar
  • 3,692
1 vote
1 answer
147 views

Numerical optimization yields strange result with imaginary number

Edit: I changed the range for $r$ to $d/s \leq r \leq 1/2$ from the original one, $0 \leq r \leq 1/2$ and now it works! But there has emerged another issue, which is presented below. Consider the ...
ppp's user avatar
  • 765
1 vote
0 answers
57 views

Is there an easy way to make built-in functions do a replacement before throwing an error message?

Many built-in functions throw errors before executing a ReplaceAll. The functions still execute the ReplaceAll as intended, but ...
crabtree's user avatar
  • 153
0 votes
0 answers
69 views

Any way to eliminate evaluating cells except for "Abort evaluation"?

I have a notebook with many cells, one of which contains an evaluation of some condition. If it is False, I want to have an automatized way of the "Abort ...
John Taylor's user avatar
  • 5,923
3 votes
0 answers
76 views

PrimeZetaP evaluation in different versions of Mathematica

PrimeZetaP was introduced in version 7.0. I suspect there were made some changes in the definition of this function in subsequent versions. Is there any user that ...
azerbajdzan's user avatar
  • 21.3k
1 vote
1 answer
58 views

How to simplify expression depending on former definition?

If a = x + y b = x - y u = a + b v = a This gives me for u/v the expression (2 x)/(x + y)...
user57467's user avatar
  • 2,788
0 votes
0 answers
90 views

FindRoot + NDSolve + List? [duplicate]

I've noticed that FindRoot fails when its argument involves a component of a list, to which a substitution rule from NDSolve has ...
phonon's user avatar
  • 205
3 votes
3 answers
271 views

How to define a root that is obtained by FindRoot as a variable? [closed]

Given some function I want to find a root around some value $x=x_0$ so I use FindRoot, for example: root = FindRoot[Exp[x]+Sin[x],{x,0}] But I want the root to be ...
Daniel Vainshtein's user avatar
1 vote
2 answers
141 views

Should expression evaluation depend on the choice of a variable name?

I am verifying the series representation of the Sonine polynomial or the associated Laguerre polynomial, which is $$ L_m^{(n)}(x)=\sum\limits_{l=0}^n\left(-1\right)^l\binom{m+n}{m-l}\frac{x^l}{l!}=S_{...
houzw's user avatar
  • 1,204
4 votes
2 answers
358 views

Is it possible in Mathematica to get a step-by-step evaluation of the following?

Is it possible in Mathematica (or WolframAlpha["...]") to get a step-by-step evaluation of the following? ...
1_student's user avatar
  • 635
1 vote
0 answers
35 views

Monitor inside core function

I like DistanceMatrix: its performance is surprisingly high, even for a big data. However, for a huge arrays and custom ...
lesobrod's user avatar
  • 1,904

1
2 3 4 5
33