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

learn more… | top users | synonyms

0
votes
1answer
24 views

Output an Expression in terms of GoldenRatio

Sorry if this is a dumb question (I'm new). I swear I searched and read forums first! I'm trying to rewrite expressions in terms of the Golden Ratio. For example, I know ...
10
votes
2answers
149 views

Can't inject EncryptedObject

Here are minimal examples: ...
4
votes
2answers
81 views

Coarse-graining in numerical integrations

I have been working recently in a coarse-graining problem I found when using NIntegrate: I am trying to evaluate the function $$f(a)=\int_0^{\infty}x\,e^{-(a^2+b^2)x^2}\text{d}x$$ numerically as a ...
0
votes
1answer
51 views

to find limiting value of function at large N i.e. N->infinity

Is it possible to find the limiting value of function at large N ...
3
votes
1answer
64 views

Evaluation of Derivative in a Module

Can someone help me understand the evaluation procedure in the following two pieces of code? ...
1
vote
2answers
33 views

Evaluating and Plotting Multiple Zero-Counting Functions

In work that I am doing, I am trying to plot multiple zero-counting functions, depending on how a parameter works. For example, if the zeros of one function are {1, 2, 3, 4, 5, 6, 7}, the zeros of ...
2
votes
0answers
39 views

What is the difference between GenerateDocument and TemplateApply[NotebookTemplate[

Abstract GenerateDocument[ _NotebookObject ] seems to do the same what TemplateApply[ NotebookTemplate @ _NotebookObject ] ...
-1
votes
1answer
92 views

need help to price a european option using finite difference method [closed]

I am writing a function to price European option using backward induction finite difference method. The function is expected to price a European option taking Stock (stock_), age (time_), volatility ...
0
votes
2answers
33 views

Expand “hierarchical” system of equations

I have a system for equations that is structured hierarchically: - Level 0: these are base variables that I can measure from a process (e.g. a,b,c) - Level 1: these are variables derived from Level 0 ...
0
votes
2answers
38 views

Different behaviour of Map and Inner in replace rules

Why does x[{1, 2}] /. {x[l_] -> Map[func, l]} {1, 2} not behave as expected, while for example ...
0
votes
1answer
58 views

Why does Compile redo the calculation when overflow happens?

When implementing the Numerov method solving Schrodinger equation, I encountered this problem. In order to show the order of the evaluation, Print is added. ...
1
vote
1answer
62 views

How to Reap data from a ScheduledTask?

Here is an amusing little function mapped over a range just to iterate it. It ignores its argument and works entirely by side-effecting a global variable: ...
0
votes
0answers
70 views

How can I use L.Shifrin s code formatter package better

in the document of HoldAllComplete, it says: Evaluate cannot be used to override HoldAllComplete.. for example, when I'm ...
0
votes
0answers
25 views

Alter evaluation order when applying scalar multiplication to function

Consider the following program: g = 2f; g[x] (* (2f)[x] *) Is there any way I can change the above expression to have it return ...
5
votes
1answer
122 views

How is LHS = RHS; … ; RHS (nontrivially) different from … ; RHS

I'm trying to understand how Mathematica thinks about the results of Set. Suppose we perform LHS = RHS. I'm focusing on when ...
3
votes
2answers
47 views

Simplify with assumption of unknown function [duplicate]

I have an unknown multivariate function entry[x,y,z], which is positive. Then how to get FALSE and entry[1,2,3] in the following evaluations? ...
2
votes
1answer
77 views

Nested If statement with unevaluated arguments

I have a list of boolean functions {f1, f2, f3, ...} that take a value and return True or ...
26
votes
2answers
2k views

What are the cool kids talking about when they use ##&[]? [duplicate]

All the cool kids are apparently using ##&[] for Unevaluated @ Sequence[] but I have no idea what either means. ...
-1
votes
1answer
56 views

Recursion depth of 1024 exceeded during evaluation [closed]

This is my very first day using Mathematica, so please forgive me my complete ignorance... I fear that this might be one of those questions that gets rejected for being "easily found in the ...
1
vote
2answers
56 views

Coordinates of MeshPoints

The output of a set of differential equations solved with NDSolve produces a series of curves and I need to obtain the spacing between these curves at a given level ...
2
votes
2answers
60 views

How to apply list of values to a list of functions

I have the following: first= {1+a,2+a,3+a,4+a} and a list t={0,1,2,3} I want to evaluate the first element of "first" at ...
2
votes
1answer
83 views

Block assignments not quite sequential?

With scalars, Block acts like Scheme's let*, that is, the assignments (appear to) happen sequentially: ...
0
votes
2answers
34 views

Parallel evaluation hangs before doing anything

[I use Mathematica 9.0.1.0 on OS X Yosemite 10.10.2.] I am experiencing difficulty with parallel evaluation that I am finding extremely perplexing to troubleshoot. I define the following function in ...
2
votes
1answer
56 views

Show [In] and [Out] tags after quitting Mathematica

I cannot find a way to show [in] and [out] tags when evaluating cells after I close the application. Is there a way to keep these shown? I disabled the kernel in global options but cannot transfer ...
0
votes
1answer
40 views

How to see partial results during evaluation [duplicate]

I am computing a long Table[], but the computation of the last few elements is taking too long, and I am afraid I will never converge. I would like to access the ...
0
votes
0answers
21 views

Cell editing blocked after output generation

when I evaluate an editable cell and get an output cell with the result, then it is no longer editable until I delete the output. This seems to be a new feature in Mathematica 10 or do I simply need ...
-1
votes
1answer
75 views

I have several functions and how I know which one is the maximum in a certain range?

What I did are the followings These lines will generate a piecewise function pw which tells me the corresponding variable given an interval as follows: Now, I want to get: names of variable ...
4
votes
1answer
56 views

Prevent evaluation of certain cells / code segments

I´m not quite sure if I ask a stupid question but I could not find an appropriate answer in the forum... I have a variety of cells (= code segments) in my notebook which I would like to evaluate in ...
1
vote
2answers
95 views

Evaluate a list

I have a function $f(x_1,\cdots,x_n)$ that takes $n$ arguments, and I would like to evaluate it using a list of lists $\lbrace\lbrace x_1,\cdots,x_n \rbrace,\cdots,\lbrace x_1',\cdots,x_n' ...
1
vote
1answer
66 views

Working with derivative of conjugate of a complex number

I have a complex function, lets say $g(x)$. I want to take its and its conjugate's derivative. I need the solution of derivative which must be symbolically and computationally efficient. Lets take an ...
1
vote
3answers
142 views

How can I make a summary of all the commands of Mathematica?

I would like to have a simple way to get summary information about all the many commands built into Mathematica. How could I do this? Is there a site I may refer to?
1
vote
1answer
48 views

How can I force an installed, user-created palette to automatically evaluate?

I have created a palette in Mathematica v10.0.2, and used the Menu-->Palettes-->Install Palette functionality to successfully install it. When I choose my palette (from the dropdown menu), rather ...
0
votes
0answers
73 views

How can I solve this expression?

I'm trying to solve this expression for A, but I'm not sure how. ...
12
votes
7answers
544 views

How to properly inject iterators into table? [duplicate]

Goofing off on a prior question, I was fiddling with other methods, which led me to the need to inject a constructed set of iterators into a table construct. Now, ...
2
votes
1answer
147 views

Is there a way to simplify a symbolic expression at assignment, once-for-all?

I have a series of symbolic function calls that could be greatly simplified using some assumptions. I think I would like for these assumptions to be used in the definition of the function so that they ...
4
votes
2answers
55 views

Automatically scroll along with currently evaluating cell?

If I'm evaluating an entire large notebook, I usually just press Alt-V Y to find the currently evaluating cell. Is there a way to keep the currently evaluating cell automatically in focus so that the ...
1
vote
3answers
103 views

How I create a 'TraditionalForm' expression in which only parts are evaluated?

I have an expression for the form Subscript[W, f[a, b]][c] = ρ^f[a,b]ω[c]ρ^-f[a,b] that I want to render in TraditionalForm ...
0
votes
0answers
53 views

Calculating the rank of an abstract matrix

I'm trying to compute the rank of a 4x4 matrix with 4 parameters and 2 variables. I tried to calculate its rank under some assumptions on those conditions and I kept getting rank 4. So I did an ...
0
votes
1answer
74 views

How to make Mathematica show intermediate steps in integral [duplicate]

I want to know how Mathematica evaluates this integral: $PV \int _ {0} ^ {i \infty} d \tau \, \frac{e^{-\frac{\tau^2}{2 M^2}}(b^2 - 3 τ^2)^2 (|b^2+\tau^2|-(b^2-\tau^2))}{\tau (\tau^2 - b^2)}$, where ...
6
votes
1answer
90 views

Strange behavior when setting NumericQ of a symbol

It happens both in v9&v10. If you try this a^0 a^0 (1/a)^(3/2) a^0 (1/a)^(5/2) Mathematica returns 1 (1/a)^(3/2) (1/a)^(5/2) It's trivial. ...
7
votes
1answer
86 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 ...
1
vote
2answers
51 views

function definition with a given list of parameters: how to use Evaluate[] properly?

given a list of variables variables = {a, b, c}; I want to automatically define a function f[{a_,b_,c_},x_] := g[a,b,c,x] ...
1
vote
1answer
51 views

How to make strong assumptions?

Or put in another way, how to make a variable behave as it belongs to a specific domain, even outside the use of simplify or other commands alike? For example: ...
0
votes
0answers
68 views

How to prevent long evaluation and infinite loops

I'm new to this, so sometimes I accidentally ask Mathematica to do calculations with numbers so big that it can't handle it and it immediately freezes my laptop to the point where there's nothing I ...
6
votes
2answers
170 views

There is an issue with Manipulate in which it updates its argument twice in V10

I have asked this question before (here) and I thought that the issue is only when moving the Notebook window. It appears that Manipulate is working in weird manner. ...
1
vote
1answer
58 views

How to evaluate some parts of an expression inside Hold? [duplicate]

I want to return a Hold expression but with some parts pre-evaluated. The easiest way to explain this is probably through code example. Here is what I have ...
2
votes
1answer
72 views

How to abort running evaluation?

I would like to implement a "Stop" Button into a program that basically consists of a loop. Unfortunately I do not how to interrupt the running evaluation. Minimal Example: ...
0
votes
0answers
38 views

Creating a lazy evaluator of th lambda calculus

I have a sub project in my research to write a lazy evaluator of the lambda calculus. How should I approach this problem? I already have a implementation of the lambda calculus would that be of help?
0
votes
1answer
32 views

How to force numeric evaluation?

I need to evaluate the PolyLog function at some points, but I'm interested in numeric values. E.g. PolyLog[3, 2.7] works fine, but PolyLog[3, e] just prints the same PolyLog[3, e]. I somehow need to ...