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
0 answers
51 views

How to get rid of "/." in my result, when I evaluate a term containing ReplaceAll?

In the previous code I defined Bchoice and pchoice In one line I defined ...
user avatar
  • 111
-3 votes
0 answers
73 views

Mathematica vs other languages such as C or Python [closed]

I need your valuable opinion on a very controversial question regarding Mathematica versus other languages, in particular C or C++. For computation, analytical or numerical in physics or other areas, ...
user avatar
3 votes
2 answers
85 views

Understanding HoldAll?

Suppose I try to run the following code: f[x_] := Cos[x] F[X_] := Normal[Series[f[x], {x, X, 5}]] Plot[Table[F[n], {n, -5, 5, 1}], {x, -Pi, Pi}] Mathematica will ...
user avatar
  • 4,841
1 vote
0 answers
49 views

Plot functions don't allow postfix function execution?

I'm confused about syntax of using // for postfix function execution. It fails in some situations where I would expect it to work. For example, it works with both <...
user avatar
  • 11
5 votes
3 answers
199 views

How to automatically interrupt `Set` with conditions

Maybe this is a bad idea: I want to inject some conditions into Set associated to specfic symbols, like ...
user avatar
  • 322
6 votes
1 answer
125 views

How to stop opening of cell groups after evaluation of the whole Notebook?

Bug introduced in 12.3 or earlier and persisting through 13.1.0 I have a long notebook with Section, Subsection, ...
user avatar
  • 1,446
3 votes
1 answer
103 views

Evaluation sequence visualisation + timing = nice profiling?

There is a nice way to see the evaluation sequence of a code using the function made by @WReach in this answer (copy-pasted below). I do not understand the details of that code. Is it easy to include ...
user avatar
0 votes
0 answers
14 views

FunctionMonotonicity[] fails, leaving the input unevaluated but shows success in EvaluationData[]

My PC is a Win 10 with MMA version 12.3.1. Today I was thinking about writing a big method/function in which FunctionMonotonicity[] would be called to determine the ...
user avatar
  • 403
4 votes
2 answers
98 views

Evaluation of an iterator construct containing Sequence in Table

The following code: Table[i*j, Apply[Sequence , {{i, 1, 3}, {j, 1, 2}}]] returns the error: Table::nliter: Non-list iterator Sequence@@{{i,1,3},{j,1,2}} at ...
user avatar
  • 2,035
0 votes
1 answer
47 views

Error in evaluating a For loop

I defined an integral function and for solve it, I want to calculate it for some numbers and then plot its behavior. So I put the function in a For loop to automate this procedure and then plot the ...
user avatar
1 vote
0 answers
38 views

Manipulate reevaluate every time

my code is working, however I have a problem, every time I navigate to the pages of the dataset, the Manipulate performs a re-evaluation bringing me back to the first page of the dataset. I would like ...
user avatar
3 votes
1 answer
165 views

BUG - Different Cloud vs. Desktop Return behavior in V13.1 [duplicate]

After install V13.1 one of my scripts get broke in my Mac. Here is the bug: Module[{}, Return[1]; 2] Return[1] When I tested ...
user avatar
  • 25.5k
0 votes
0 answers
43 views

A way to tell mathematica to not alphabetically order second derivatives

I have a frame of vector fields $E_1 ,... ,E_6$ and it's convenient for me to write $E_1(f)$ as Dt[f,e1] where e1 is an ...
user avatar
0 votes
0 answers
18 views

Not getting evaluated output [duplicate]

I just started using Mathematica. When doing the matrix calculation I encountered some problem, output is not evaluated instead it just gives the input as the output. Example:
user avatar
0 votes
0 answers
30 views

Avoiding notebook re-evaluation after quitting Mathematica [duplicate]

I'm new here so I hope I'm not asking something already solved. I'm new to Mathematica and I need to manage lists created from files that usually spend a lot of time to be created. I noticed that ...
user avatar
4 votes
4 answers
182 views

Parts of a Piecewise Matrix Function in NDSolve

First time posting. Reproducing the Problem I'm relatively new to Mathematica (using v.12.3), and working on a project. My problem can be reproduced with this. ...
user avatar
7 votes
1 answer
204 views

How to remember evaluation across sessions?

I am performing a very time-consuming symbolic calculation. When I reopen a saved Mathematica notebook, it takes quite a long time to evaluate. Is there an option to tell Mathematica to remember the ...
user avatar
  • 71
2 votes
1 answer
56 views

Wierd problem with Table and Evaluate

I have a very unpleasent problem with Mathematica, precisely with Table and/or Evaluate. After solving a parametric system with ParametricNDSolve, I'd like to collect the values of the solutions $f_3(...
user avatar
1 vote
0 answers
85 views

Why Mathematica don't set \$RecursionLimit and \$IterationLimit very big by default? [closed]

For my current program in Mathematica, sometimes I will encounter an error regarding \$IterationLimit and \$RecursionLimit. So I always set these two numbers to very large at the starting of every ...
user avatar
3 votes
3 answers
218 views

Different evaluation control inside of `Integrate` than outside of it

I want to keep inside of a integral evaluated after some replacement inside it, but at the same time the integral itself unevaluated. I start with: ...
user avatar
  • 2,842
6 votes
3 answers
240 views

HoldForm is not working as I would expect

Why HoldForm do this? HoldForm[a/b \[Integral]f[x] \[DifferentialD]x] Output is this ugly looking formula: $$\frac{a \int f(x) ...
user avatar
  • 2,842
0 votes
0 answers
56 views

Can I load a notebook without evaluating it?

I have a long notebook with a lot of definitions, calculations, etc. If I want to open the notebook on a new computer, or even on my computer after it has been shut down; then in order to make use of ...
user avatar
1 vote
0 answers
36 views

How to derive the integral of a first kind zero-order modified Bessel function multiplied by a Rayleigh distribution?

I input the result into Mathematica and get the following result In: $\int_{0}^{\infty} \operatorname{BesselI}[0, \epsilon] * \frac{\epsilon}{\rho^{2}} * e^{\left(\frac{-\epsilon^{2}}{2 * \rho^{2}}\...
user avatar
  • 11
0 votes
0 answers
64 views

Variation with respect to inverse metric in a Lagrangian density

I am trying to vary the following Lagrangian density with respect to the inverse metric appearing in the equation, but I am having trouble with how to write the right code in Mathematica. I have ...
user avatar
  • 1
6 votes
4 answers
308 views

How can I efficiently define functions with different names but doing the same stuff?

Recently I have met with with this interesting question:How can I efficiently define functions with different names but doing the same stuff? Somebody may want to ask me why I want to do things like ...
user avatar
  • 403
2 votes
2 answers
148 views

Double quotes as a 'function' (verbatim ToString?)

Can we construct a function F such that F makes any typed text into a string. Just like double quotes. ...
user avatar
  • 3,063
0 votes
1 answer
49 views

How to construct the local variables for Block automatically (somewhere in the code)

I am working on the fancy abstraction for Block function. The idea is to use rules to specify which local variable will be used, even if it already defined in the global context like this ...
user avatar
3 votes
3 answers
238 views

Seemingly identical expressions, only one evaluates! [closed]

I am having difficulty using NMaximize with a user-defined function that involves NSolve. Stack Trace shows trouble at the ...
user avatar
  • 131
1 vote
3 answers
111 views

How to return unevaluated variable?

I'm not sure if this problem has been asked before as I don't know the keyword to search for it. I have a function where return result contains variable b (just ...
user avatar
  • 2,392
2 votes
0 answers
47 views

Division by 0 Error when checking whether something is equal to zero

I was running a program and suddenly got Divide::infy messages coming from the following (rather ugly) expression. ...
user avatar
  • 1,032
3 votes
1 answer
47 views

Trying to add up values into a matrix

first post here. I'm currently completely stuck and frustrated with mathematica. In retrospective, it might had been a mistake to use it for this, I'm actually considering to somehow export the ...
user avatar
  • 33
4 votes
3 answers
270 views

Expectation of a Sum

I'm using Expectation to calculate the Gaussian integral of a user-supplied function. The following works well and fast (< 1 second): ...
user avatar
  • 18k
0 votes
0 answers
34 views

Define a new rule to take precedence over the others in a symbol's `Downvalues` list [duplicate]

I have a symbol that has a very large list of Downvalues. One of the rules in this list should be applied before the others because it simplifies many expressions, ...
user avatar
  • 1,478
3 votes
1 answer
92 views

how to split indices for a Spinor object?

I am wondering if anybody can help me with my question. My main relation is from gravity and is known as self-dual Riemann. When it is written in the Spinorial form it is like: $$G_{\mu \nu \alpha\...
user avatar
  • 91
3 votes
1 answer
74 views

Replace previous equations into the current one in a recurrence relation

I have a recurrence relation given as follows: f[k + 1] == 1/a[k, k + 1] Sum[a[k, k - k1] f[k - k1], {k1,0,k-1}] Evaluating it for ...
user avatar
6 votes
1 answer
185 views

Getting terms and only evaluate specific parts of a series

How to write the first five terms of this series in the following form by MMA code? $\sum_{n=1}^{\infty} \frac{1 \cdot 3 \cdot \cdots \cdot(2 n-1)}{2 \cdot 4 \cdot \cdots \cdot 2 n}= \frac{1}{2}+\frac{...
user avatar
  • 1,407
1 vote
1 answer
107 views

Evaluating a mathematica notebook via the command line and saving the evaluated file

I am attempting to evaluate a notebook with the following code via the command line ...
user avatar
0 votes
1 answer
43 views

Multivariate function won't evaluate

When I define the following variables and function and then evaluate that function at given values: ...
user avatar
0 votes
0 answers
41 views

How to stop annoying notifications sound when using "Remove from Evaluation Queue" shortcut?

I have Mathematica 13.0 Student Edition for Windows 10 and whenever I use " Shift + Alt + / " I get this annoying "Windows" notifications sound. There has to be a way to stop it, ...
user avatar
0 votes
0 answers
56 views

Logical functions with no arguments

I am trying to understand how logical functions are evaluated if no arguments are passed to them. {Or[], Nor[], And[], Nand[], Xor[], Xnor[]} {False, True, True, ...
user avatar
  • 16.3k
3 votes
2 answers
105 views

Integration of differential given as one-form

I would like to use the integration symbol in more general way, that means to integrate any differential, like \[DifferentialD]y = a x^2 \[DifferentialD]x and then <...
user avatar
  • 577
2 votes
1 answer
84 views

Activating part without resolving [[1]]

I'll try to make this question more clear in a little while. In the mean time, I'll ask directly the question which motivated it: Latin Square from submatrix Original Question I want, for instance, ...
user avatar
  • 2,762
0 votes
0 answers
42 views

How do I make divergent integrals to be automatically evaluated?

As a first step I want the divergent integrals to be evaluated to their Laplace transform, like this: $\int_0^\infty \sin x dx\to 1$ because ...
user avatar
  • 2,911
1 vote
2 answers
74 views

Theoretical Timing possible? (not changes for each evaluation)

Is there a method to measure theoretic time load (hope +theoretic memory load) of an evaluation? They should not change - always generate same value after pressing Enter key(=evaluation). Hope they ...
user avatar
  • 3,063
5 votes
1 answer
259 views

Lazy vs strict evaluation approaches - performance comparison

In general, I think there are two methods of evaluating a variable in Mathematica. My question is about performance of the two methods. Suppose that our final goal is to evaluate ...
user avatar
  • 3,063
3 votes
2 answers
172 views

Construct table from list of strings

I have data in this form: ...
user avatar
  • 327
3 votes
1 answer
70 views

Compile function dynamically

To optimize a brute force algorithm on graphs I want to compile dynamically a list of functions for a list of graphs. (The representation I'm using for a graph is a list of pairs of integers: integers ...
user avatar
1 vote
0 answers
68 views

Why does Plot function have HoldAll attribute?

I had an odd issue where my plot wasn't drawn correctly when I called it via Plot[Join[fs,gs], (*..*)]. However, these two versions worked: ...
user avatar
0 votes
0 answers
141 views

Help with Error: Recursion depth of 1024 exceeded during evaluation

I am quite new to Mathematica. Please excuse my mistakes. I would appreciate if you could help me with the following set of commands. ...
user avatar
  • 1
0 votes
1 answer
72 views

How to count Kernel evaluations then call a function on every nth evaluation

On every nth (2) evaluation autoEval should invoke a function check[]. The thing which is supposed to listen for all ...
user avatar
  • 1,861

1
2 3 4 5
29