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
4 votes
4 answers
164 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
6 votes
1 answer
194 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
  • 61
2 votes
1 answer
52 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
84 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
214 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,503
6 votes
3 answers
233 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,503
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
33 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
51 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
5 votes
4 answers
290 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
  • 289
2 votes
2 answers
143 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
  • 2,451
0 votes
1 answer
46 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
237 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
98 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
  • 1,750
0 votes
0 answers
61 views

Why does my function for LocalSubmit successfully create a TaskObject with no errors but ignores my simple Print task?

tldr: for lazy readers (don't blame you im sometimes that way too) or those who found my details below a little bit vague my question is: why is my Print not ...
user avatar
  • 1,787
2 votes
0 answers
45 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
  • 928
3 votes
1 answer
43 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
263 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
  • 17.6k
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,448
3 votes
1 answer
87 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
  • 57
3 votes
1 answer
73 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
182 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,365
1 vote
1 answer
91 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
42 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
40 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
53 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
  • 14.8k
3 votes
2 answers
104 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
83 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,648
0 votes
0 answers
40 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,721
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
  • 2,451
5 votes
1 answer
241 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
  • 2,451
3 votes
1 answer
64 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
66 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
91 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
71 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,787
1 vote
1 answer
83 views

Smart way to do a numeric integral of a recursive function defined by symbolic integration

I have a little question. I need a smart way to compute a numerical integral. The standard way to compute a numerical integral, in multiple variables, is, for example, the following: ...
user avatar
0 votes
1 answer
157 views

Numerical integration of a function with Dirac delta

I have a little question about the numerical integration of a function that includes a Dirac delta. I have the following function: ...
user avatar
3 votes
0 answers
144 views

Using new FoxH function to solve a trinomial equation. Possible issue?

There is a possible issue on solving the following trinomial equation $$x^\alpha+x=y$$ for real $x,y,\alpha$. From Belkic [1], it is known that for $\alpha>1$ a solution is found using the ...
user avatar
3 votes
0 answers
77 views

How to convert Graph atomic object back into unevaluated expression? [duplicate]

For the purposes of further development of my shortInputForm function, I wish to convert Atomic objects such as Graph into non-...
user avatar
0 votes
2 answers
36 views

Noncommutative multiplication with rational functions as coefficients

I am considering formal functions of lists and used ** to define the concatination product: bb /: bb[X_] ** bb[Y_] := be[Join[X, Y]]; So that for example bb[{a,b}]...
user avatar
3 votes
3 answers
106 views

Apply HoldForm on only a part of an expression

This expression: Det[Array[a, {3, 3}]] is evaluated as: $-a(1,3) a(2,2) a(3,1)+a(1,2) a(2,3) a(3,1)+a(1,3) a(2,1) a(3,2)-a(1,1) a(2,3)a(3,2)-a(1,2) a(2,1) a(3,3)+a(...
user avatar
5 votes
4 answers
159 views

Can I change the meaning of operators? For example ∈ as MemberQ

I spotted this under \[Element] in the Wolfram documentation: "x ∈ y is by default interpreted as ...
user avatar
  • 1,055
5 votes
2 answers
178 views

Table of functions

Why does Table[Function[{x}, x^m], {m, 1, 3}] produce {Function[{x}, x^m], Function[{x}, x^m], Function[{x}, x^m]} (i.e. with <...
user avatar
1 vote
0 answers
39 views

What is the difference between "SessionSubmit" and "LocalSubmit" in performance?

Does SessionSubmit forward the computation to the master thread and LocalSubmit to some other idle thread? By thread, I mean CPU ...
user avatar
  • 365
1 vote
0 answers
47 views

I want a symbol to be automatically converted to an expression on input but not on output

I want the symbol j to automatically convert to {-1,1} on input, but when seen in output stay intact. What can I do for that? I ...
user avatar
  • 2,721
3 votes
2 answers
132 views

How to make c[n_, x_, y_] := ToExpression["p" <> ToString[n]] = {x, y} work?

I am trying to do the following: c[n_, x_, y_] := ToExpression["p" <> ToString[n]] = {x, y} That is: Evaluating ...
user avatar
  • 4,801
0 votes
1 answer
109 views

Mathematica stuck on partial derivative calculation

I was experimenting polynomial gradient descent on Mathematica, but it got stuck on partial derivative calculation. Formula below: Traditional Form: $$ mse = \frac{\sum_{i=1}^{n}\left(y[[i]] - \left(a\...
user avatar
  • 119
3 votes
1 answer
156 views

Plot a double integral

I'm trying to plot the result of a double Integral Plot[ Integrate[Integrate[x^7 (x - 2)^4 (x - 3)^9, x], x] ,{x, -10, 10} ] Results in a 22-degree ...
user avatar
  • 389
5 votes
3 answers
278 views

Apply Plus as a new head to a list but prevent evaluation

I would like to illustrate to users the use of Apply with an example. Plus@@Range[5] (*15*) To display what is happening I'm ...
user avatar
  • 1,603
0 votes
0 answers
53 views

How to evaluate simplify an expression containing derivatives

I have an expression that is a derivative of order 2. I want to assign value to derivatives of orders lower than 2(e.g. the expression itself) which should cause the derivatives of higher order become ...
user avatar
  • 340

1
2 3 4 5
29