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
2answers
66 views

Simplifying Fourier transform of a complicated function

I would like to evaluate the following expression but takes too much time. I would be greatly appreciate for any comments to make it fast. ...
0
votes
1answer
86 views

Getting unevaluated function expression

Say I've got a function f[x_] := a x^2 + b*x + c; and later set for some other reason a=1; how can I get the expression of f in ...
0
votes
1answer
87 views

Why does evaluating an integral within a Plot expression take so long? [duplicate]

I want to evaluate Plot[Integrate[Sin[((1 + 1/2) x)] (1/(2 Sin[(x/2)]) - 1/x), {x, 0, t}], {t, 0, 5}] but it takes ages to load on Corei3 computer with ...
0
votes
1answer
93 views

Evaluate integral of a series

I want to evaluate this integral, but it won't work. Does anyone knows why? ...
0
votes
1answer
227 views

NumericQ prevents evaluation at a numerical value sometimes

I set up a symbolic integral, to be evaluated only when some of the symbols have been replaced by numbers. The evaluation after assigning numbers to the symbols is still symbolic for some reason. The ...
0
votes
1answer
383 views

Array of functions, evaluation in plot

I would like to create two arrays of functions yfunc[[i]] and tfunc[[i]], with each entry of those functions being a function ...
0
votes
1answer
95 views

Why does Evaluate fail? [closed]

If i use this code: ...
0
votes
3answers
62 views

Automatically evaluate next cell

I am new to Mathematica. I am trying to achieve the following: I need one input cell in which I set parameters, then another input cell where functions are defined and calculations are performed. ...
0
votes
2answers
52 views

Evaluate differentiation after replacement

The problem is Find two linearly independent solutions of $2x^2y'' -xy' + (-4 x + 1)y = 0, \, x>0$ of the form $y_1 = x^{r_1}(1 + a_1 x + a_2 x^2 + a_3 x^3 + \cdots)$ and $y_2 = x^{r_2}(1 + b_1 x ...
0
votes
3answers
77 views

Preventing evaluation until all undefined symbols are resolved

FixedPoint[If[# <= 0, 0, # - 1]&, 2 x] Causes an infinite loop because of 'x'. How do i automatically prevent evaluation until ...
0
votes
1answer
84 views

Plot producing many error messages when given complicated function

I'm new to Mathematica and am running in to all sorts of silly difficulties with coding in it. I'm trying to calculate a function f[x, k], normalise it with another ...
0
votes
1answer
102 views

Can I force a function to quit and return some value after a certain amount of time has passed during its evaluation?

Imagine I provide some random input to function like FindInstance[], and I observe that, despite the existence of good solutions, the function will, with some ...
0
votes
1answer
175 views

Why won't ContourPlot accept a variable argument? [duplicate]

I have a list of linear inequalities which describe a (polygonal) region. I can use RegionPlot to visualize this region; but I'd also like to overlay this plot with ...
0
votes
1answer
263 views

Make Mathematica wait before replacing?

How can I force Mathematica to completely evaluate a subexpression before using a replacement rule? For example, consider the following definition (for the series of ...
0
votes
1answer
67 views

How can I restrict a notebook to evaluate only if I am user 'root'?

I am playing with openCL on Linux with an AMD gpu, and due to a glitch in the driver, I need to be 'root' to get stuff to work. Installation question here.
0
votes
1answer
123 views

Slow Dynamic Button Does Not Print [duplicate]

Possible Duplicate: Why do buttons with ChoiceDialog freeze the front end? Why is SystemDialogInput failing to return a save file path? Evaluation inside Button stops after some seconds I ...
0
votes
1answer
42 views

Resolving Error: Mathematica evaluation order on Lists

I have a table that is 27 x 27, each entry corresponds to an element from the periodic table. I use the replacement rules in element list to allow me to convert a list of elements into a list of ...
0
votes
1answer
57 views

Symbolic integral including Hermite polynomial does not evaluate

I am trying to evaluate the following integral: Integrate[HermiteH[n, Sqrt[a]* x] * Exp[- (c/2)* (x^2 + y^2) + b* x * y - (a * x^2)/2], {x, - Infinity, Infinity}] ...
0
votes
2answers
72 views

Defining Piecewise Functions in Modules

In short, my question is the same as my previous one except that everything is now wrapped up in a module. The relevant code I'm working with is: ...
0
votes
1answer
98 views

Symbolic vs. numeric evaluation is incorrect [closed]

In Mathematica 9: I have two functions f[v] and g[v]. When I do f[g[0]], I get the correct ...
0
votes
2answers
184 views

Defining a function in terms of matrix elements

Currently trying to use elements from a matrix in defining a function however having some trouble. This is a somewhat simplified version of the problem. Say I have the matrix ...
0
votes
1answer
97 views

Solving NLODE with substitution

I am trying to get a solution to a non-linear ODE, below is the code that works for my problem. ...
0
votes
1answer
93 views

Order of evaluation in nested expression

I am trying to make a function that works as follows: Integrate 1 for all t in the interval $ [0,1] $ such that the first element of function vstar is positive. ...
0
votes
1answer
118 views

Understanding output of multivariable integration

I'm new to Mathematica and I'm trying to integrate this function: ...
0
votes
1answer
190 views

Pull Constants outside of integrals

I would like Mathematica to pull constants outside of an integral: e.g., $\int_0^t f[t] g[s] dt \to g[s] \int_0^t f[t] dt$ This has previously been discussed at replacement rule to pull independent ...
0
votes
0answers
37 views

Scoping problem with Manipulate [duplicate]

Consider the following simple code: f = Sin[a x]; Manipulate[ Plot[f, {x, 0, 10}], {a, 0, 10}] Manipulate takes f to be ...
0
votes
1answer
48 views

Optimizing repeated function calls

Easiest way to keep my library nice, is to naively call some functions many times with same parameters. Doing so prevents from zoo of (library-)global variables and complicated initialisation ...
0
votes
0answers
46 views

Numeric function not fully evaluating

I'm running into an issue where it seems Mathematica is not fully evaluating the output of my function h[t_]. I included the definition of phi[t_] just to demonstrate that it is a numerically defined ...
0
votes
0answers
30 views

RandomReal behavior in Block environment [duplicate]

I ran into an unexpected behavior of RandomReal function inside the Block environment. If I simplify my problem: I wanted to use two random local variables, such that the second one would be less that ...
0
votes
0answers
38 views

Notification when evaluation completes [duplicate]

I thought it would be fun to see a list of ways to have Mathematica notify you when a long evaluation completes. There are a few posts up already that address specific methods, given below, but not ...
0
votes
0answers
36 views

Number precision in a list [duplicate]

I have list with elements: ...
0
votes
0answers
88 views

How to modify the file “KeyEventTranslations.tr” to use Enter to evaluate the current cell? [duplicate]

I asked the following question before, but I do not think it has been fully answered. By default, we use Shift+Enter to evaluate the current cell, and use Enter to get a new line. Is there a way ...
0
votes
0answers
47 views

Dynamically Update Inset within Graphics with RunScheduledTask

I followed the instructions given below to play with RunScheduledTask within DynamicModule. ScheduledTask with scoped ...
0
votes
0answers
37 views

Faster evaluation of an expression for brute force optimization [duplicate]

I'm trying to bruteforce an optimization problem and I want to generate roughly a million function evaluations. I was wondering what would be the best for me to do in terms of having the expressions ...
0
votes
1answer
173 views

Pass unevaluated function with evaluated arguments

I am almost sure that this question has been asked somewhere. I found similar ones, but I cannot find exactly what I need, which might mean that I am on the wrong track. I search a method to pass an ...
0
votes
0answers
52 views

Evaluation - separate Output window + not evaluate particular cells

is it possible to avoid that mathematica writes the output into the nb file? I would prefer that mathematica writes the output into a separate file. If it writes into the notebook (I usually use: ...
0
votes
0answers
13 views

Evaluating a String that is a Variable [duplicate]

I have a Variable assigned a value, say ImportantDocuments=1 How do I make N["ImportantDocuments"] evaluate to be 1 instead of ImportantDocuments I found that ...
0
votes
1answer
72 views

Evaluate outer function first

I'm new in Mathematica so this is maybe super easy to do, but I can't figure out how. I've got a function plus[a,b] that sums two numbers and I need to implement a ...
0
votes
0answers
47 views

CreateDocument using a specific Evaluator (Kernel)

I was trying to build a button to create a new document that contained a dynamicaly changing table. In the parent notebook i am using another kernel - not the usual "Local". The problem is that in the ...
0
votes
0answers
161 views

Select and plot real positive solutions for a sixth order parametric equation

I need your help in order to solve the following problem: I have a sixth order equation: $ax^6+bx^5+cx^4+dx^3+ex^2+fx+g=0$ and I solved it using Solve[] command, ...
0
votes
0answers
107 views

How to evaluate only arguments, but leave topmost expression unevaluated? [duplicate]

I want to represent expressions mostly in unevaluated form, but being able to evaluate it's subparts. For example, how to evaluate only arguments, but leave topmost expression unevaluated? For ...
0
votes
0answers
115 views

Integrating and plotting pde system solution

I have a trouble with plotting a pde system solution. I'm solving a PDE system in 2-dimensional space and then I want to integrate the solution along one dimension and build a log plot along the ...
0
votes
0answers
33 views

Define a Plot3D function with custom options [duplicate]

I am trying to define a Plot3D function with custom options, following (this previous SE question), but I'm running into a brick wall. I've narrowed the problem to the following 'toy' code: ...
0
votes
0answers
48 views

How to ContourPlot a Table? [duplicate]

Possible Duplicate: Why is ContourPlot not displaying this curve? Why do I have to put Evaluate[] here I'm trying to plot certain contours of a function $f:\mathbb R^2\to\mathbb R$. What I ...
-1
votes
1answer
109 views

How does Mathematica interpret a expression?

I'm a beginner to Mathematica. I'd read several document. But I still have a problem. For example, every expression in Mathematica are of the form ...
-2
votes
1answer
192 views

Why doesn't Mathematica evaluate this limit?

I am trying to evaluate a few limits in Mathematica, and I can only get it to evaluate them in certain cases. I don't fully understand the evaluation order and when it substitutes numerical values in ...
-3
votes
1answer
65 views

Why does the function Evaluate speed up one function by orders of magnitude and another function not at all?

I've got two functions, one sample function (function 1) i've created for demonstartion purposes here, and my actual function. The function Evaluate speeds up the sample function by orders of ...
-3
votes
2answers
90 views

Find the value by using FindRoot command [closed]

The equation x^4-3 x^3 = cos(3x)+3 has two real solutions on the interval from -10 to 10. Lets call these two solutions r and s. Use Mathematica's FindRoot command to find r and s. Now let M equal the ...