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
0 votes
0 answers
49 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,391
2 votes
1 answer
160 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
7 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
  • 66.8k
3 votes
1 answer
106 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
87 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
42 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
136 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
  • 542
0 votes
0 answers
22 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,491
1 vote
0 answers
40 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,491
0 votes
0 answers
61 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
155 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
  • 189
4 votes
1 answer
104 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
34 views

Unexpected function evaluation result in Plot [duplicate]

I find some strange behaviors of Plot. The code is: ...
Ming's user avatar
  • 91
0 votes
0 answers
45 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
237 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,253
1 vote
0 answers
46 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,211
2 votes
0 answers
71 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
  • 499
3 votes
2 answers
135 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,827
1 vote
0 answers
108 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,295
0 votes
1 answer
99 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,295
5 votes
2 answers
488 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,315
1 vote
0 answers
57 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,295
7 votes
1 answer
284 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,223
0 votes
0 answers
70 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,585
1 vote
1 answer
144 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
  • 815
1 vote
0 answers
55 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
0 votes
0 answers
67 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,827
3 votes
0 answers
75 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
  • 18.8k
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,728
0 votes
0 answers
89 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
  • 105
2 votes
3 answers
261 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
134 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
  • 348
4 votes
2 answers
348 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
34 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,699
1 vote
0 answers
74 views

Elliptic theta function wont evaluate [closed]

It appears that Mathematica wont evaluate the Jacobi theta functions when the last argument has a magnitude greater than 1, for example: EllipticTheta[1, 1.5, 0.9] ...
Matt Majic's user avatar
1 vote
2 answers
83 views

SortBy does not work correctly when nest in Evaluate in With in Block

I have got some formula in Mathematica, then I want to pass value to verify them. full code ...
eason's user avatar
  • 197
2 votes
3 answers
172 views

How to maintain the input form of InputField?

I created a Manipulate with InputField: ...
Milk's user avatar
  • 1,718
0 votes
2 answers
82 views

Same code behaves differently as a pure function and a function, and insider another function

I have a rule-transformer that takes a list of rules (and a list generator = {σ[z], σ[-1], σ[1]}) ...
Lelouch's user avatar
  • 543
2 votes
1 answer
51 views

How to apply a transformation to a total derivative?

I want to transform total derivatives into normal derivatives: Dt[r, t] == -r*Dt[v, x] - v*Dt[r, x] /. Dt[f_, s_] :> D[f[x, t], s] To get: ...
user6552's user avatar
  • 363
2 votes
1 answer
108 views

How to force evaluation of RuleDelayed?

(I'm not sure if the title of this question is appropriate, sorry!) After defining selfApply function that resolves the mutual references contained in Association, I wrote the following code: ...
user14061's user avatar
3 votes
4 answers
389 views

Eigenvectors are divided by zero depending on evaluation, 6x6 matrix

I calculated the Eigenvectors of the $6\times 6$ matrix $m$ with parameters $(a,b,c,d,e,f)\in \mathbb{R_{\ge 0}}$. If I set e.g. $b\rightarrow 0$ after calculation, then 4 of the 6 Eigenvectors are ...
granular_bastard's user avatar
4 votes
3 answers
447 views

Eigenvectors are divided by zero depending on evaluation, 4x4 matrix

I calculated the Eigenvectors of the $4\times 4$ matrix $m$ with parameters $(a,b,c,d)\in \mathbb{R_{\ge 0}}$. If I set e.g. $b\rightarrow 0$ after calculation, then some of the Eigenvectors are ...
granular_bastard's user avatar
0 votes
1 answer
52 views

Evaluation gives different results before and after simplifying expression

I am trying to evaluate $h(z)=\frac{f(z)}{g(z)}$ at points $z$ close to 0. Here I have taken an example value of $z=\texttt{z1}=10^{-7}$ for demonstration. I notice that evaluating the fraction before ...
sai's user avatar
  • 121
2 votes
2 answers
100 views

How to prevent evaluation without simplification?

I am trying to compute a sequence of terms, which have a form similar to $g(z)$ at different points $z$. For $z$ close to 0, I have observed that the terms are evaluated as 0/0 (indeterminate form) ...
sai's user avatar
  • 121
0 votes
0 answers
48 views

Passing an unevaluated test

I want to write a function (in a package) that takes a boolean test as an option. Here's a toy example to illustrate what I have in mind: ...
Chris K's user avatar
  • 20.3k
1 vote
1 answer
151 views

Newton Raphson 0th order with gauss elimination error

I'm trying to do a Newthon Raphson with 1st order continuation to solve a problem with 4 variables (fix 2 and obtain the results of 2 (x and Chi). ...
Larissa Santos's user avatar
1 vote
1 answer
61 views

`FindMinimum` can't evaluate `Nearest` numerically

I'm trying to use Nearest as a function to minimize over: a toy example is ...
Adam's user avatar
  • 3,956
0 votes
0 answers
62 views

Automatic evaluation of a function for variable values defined from different data tables in the attachments

I want to evaluate a function whose variable values are defined in different data files. I want to know that how can I write code such that when the function's evaluation is exhausted for one table, ...
SciJewel's user avatar
  • 432
0 votes
0 answers
49 views

How to find a positive minimum of a function?

How can I find a positive minimum of f and its corresponding R0? ...
Math_student's user avatar
1 vote
1 answer
43 views

How to clear all definitions/symbols declared in all sections with the given tag?

Consider a list of chapters/sections etc. that have the same tag, say, "evaluation". Could you please tell me how to clear all the functions/symbols/definitions etc. that have been defined ...
John Taylor's user avatar
  • 5,827

1
2 3 4 5
32