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
1answer
85 views

How to stop evaluation of Zeta with even arguments

It could be a duplicate question. However I could not find much after a huge searching. I have a huge expression in mathematica involving many Zetas. I want not to evaluate the even Zetas which ...
9
votes
3answers
259 views

HoldForm: Display exactly as entered?

Sometimes, Mathematica's internal representation of expressions can give somewhat surprising results. Specifically, I noticed this when I tried to preserve products of fractions for display. E.g. ...
0
votes
1answer
51 views

Why isn't my function evaluating to an explicit number?

I'm just wondering why my function is not evaluating as I think it should. I put in the following: ...
3
votes
1answer
45 views

How to evaluate limit of a user-defined function

Limit[(k/(k - 1)), k -> Infinity] Gives correctly: 1 But, ...
0
votes
2answers
55 views

Evaluation control - Hold (?) argument name not argument values

I wanted to produce a list of statistics labelled with the statistic name, for exchange with a database. I defined ...
5
votes
1answer
158 views

Inactivate all occurrences of a symbol

I would like to inactivate all occurrences of a symbol to prevent it from evaluating, regardless where in the evaluation process it appears. A minimal example: ...
3
votes
4answers
282 views

Basic substitution

I am relatively new to Mathematica, so I am sure this is basic, but I lack the basic terminology to be able to google it. How can I make this command work? ...
0
votes
0answers
14 views

Trouble with evaluation and Dynamic [duplicate]

I would like to evaluate the gradient of a certain function at position (x0,y0,z0) where x0, y0, z0 are global variables which can get altered in real-time later in the worksheet. The only way I know ...
6
votes
4answers
482 views

partial numerical evaluation

Context The following is an issue I have come across many times and still do not have a satisfactory solution for. The context of it is this. Let's say we have an equation, a linear ODE for the ...
2
votes
0answers
53 views

non listable plus and times [duplicate]

I am trying to create my own Plus and Times functions, which are identical to the built in ones with the exception that they are ...
0
votes
0answers
110 views

Problem with NIntegrate: it gets stuck when evaluating zero value

I have an integral with complicated function evaluated by MonteCarlo method (please find a folder with two files by the link below). Namely, a function ...
4
votes
1answer
54 views

Is it possible to write an expression A such that Evaluate[Evaluate[A]] is different from Evaluate[A]?

Mathematica is cool for all sorts of "magic tricks", but I'm trying to get an idea on how the core term-rewriting system works. Is it possible to make a term such that the output of its evaluation can ...
4
votes
3answers
191 views

Handling expression differently for display vs. calculation?

I have a function I wrap a lot of my numbers with to factor them and display them out a certain way. Usually I do this at the last step of a calculation, but sometimes it would be nice if I could ...
4
votes
1answer
81 views

Subtle order-of-evaluation issues when pattern-matching with attributes

Related question concerning unrolling the tests that are shown below: Big and Little surprises when unrolling tests of pattern-matching and attributes Questions researched before posting this one: ...
4
votes
3answers
43 views

Controlling HoldForm while mapping

If I execute A = {Sin, Cos, Tan} B = {ArcSin, ArcCos, ArcTan} #[[1]]@#[[2]]@x & /@ Transpose[{A, B}] the output is ...
5
votes
1answer
144 views

With vs. Block scoping of parameters for Plot

A very basic question.. Why does Block work, but not With, to specify value of a parameter for a function to be plotted? ...
6
votes
2answers
140 views

How to use ReplaceAll and RuleDelayed with an Association? [duplicate]

I expected that something like this ...
1
vote
0answers
17 views

ClearAttributes in ParallelDo

The following code ClearAttributes[Times, Orderless]; temp = b*a; Do[ Print[temp];, {i, 1} ] will print b*a However, the ...
3
votes
1answer
153 views

Can this power tower function be optimized to perform faster?

Take the following function defined in Mathematica: Itr[x_, p_, n_] := x^Nest[Power[p, #] &, 1, n]; Evaluating this function even for small values of ...
0
votes
2answers
80 views

Why doesn't Boole return 0?

I'm writing a code to evaluate if the Cauchy-Riemann conditions are satisfied for a given function. For example, for the function f[z]=Conjugate[E^(z)] it has to ...
4
votes
1answer
94 views

How to extract part of a held expression without evaluating it

How can I extract part of a held expression without evaluating it? Clear[w] Part[HoldForm[w = 3],1,1] (* w *) w = 4 Part[HoldForm[w = 3],1,1] (* 4 *) Here I ...
2
votes
1answer
90 views

Get the name of symbol inside a function [duplicate]

I have a list t1Funcsv0={0.10000000000, 1.00000*10^-7} and I have a function ...
2
votes
1answer
31 views

AssociateTo with a variable as an argument produces error

The following code: list=Table[<\"number"->i|>,{i,1,100}]; list[[20]]["number"] list[[1]] AssociateTo[list[[1]],"number"->101]; list[[1]] Results in....
5
votes
2answers
105 views

HoldAll Attributes and Delayed Evaluation: ContourPlot with solutions to NDSolve

This is a general question on evaluating functions that are defined to be evaluated with delay. In particular, I am having difficulties working with the ...
4
votes
1answer
61 views

How can I evaluate only the (bound) variables in an expression?

Given an arbitrary expression, how can I have Mathematica only evaluate the (bound) symbols, i.e. replace them by their respective values, but not do any further simplification/evaluation of the ...
11
votes
1answer
551 views

Stop the Zeta function from evaluating

I have a function F whose power series i want to find using Series. It gives me the result I want, except there is a term of $\...
1
vote
0answers
48 views

Problem during opening a second notebook [duplicate]

Suppose I have open a Mathematica notebook and I have evaluated several commands. Then if I try to open a second notebook, while the first is still open the following mesh occurs: (i) I get the ...
4
votes
2answers
216 views

Solve gives an incorrect answer

...
1
vote
2answers
96 views

Plotting equation of error function

I want plot $W$ vs $t$ ...
4
votes
1answer
187 views

Prevent Trigonometric simplifications from using double angle and half angle formulae?

Is there any way to force Mathematica to not use double and half angle formulae etc. when simplifying Trigonometric expressions? For example,...
0
votes
0answers
50 views

evaluation of a probability

Hy my program i running only for one value but i want to run this for several values By addind result of previous one at a same time.... my program is ...
0
votes
1answer
90 views

Evaluate an expression in terms other variables when lots of equations are involved

Unless I misunderstood something, this is different from a similarly worded question because I am not asking for the relationship between different variables here. I want to convert an expression ...
0
votes
0answers
63 views

Why won't Mathematica Conjugate this expression>

I've been trying to replicate the derivation of Bloch's equations in Mathematica and for the final substitution, it won't correctly conjugate the expression even though I specify that all of the ...
36
votes
3answers
1k views

Interrogating a running evaluation

Is it possible to find the values of variables of a running Mathematica evaluation, without interrupting it? For example, suppose I do: Do[Pause[1]; a++, {50}] ...
0
votes
1answer
100 views

Doesn't time out when using TimeConstrained with FindFit for some data [closed]

To summarize: My problem is that I have some code that won't terminate even when I use TimeConstrained to force it to terminate after 1 second. My question is whether there is an alternative solution ...
2
votes
3answers
80 views

Function of a function, both of a list of variables

I am trying to avoid dealing with long explicit lists of variables. What i do so far is the following: VarList={x_, y_}; ParList={x, y}; ValList={2, 3}; What ...
3
votes
0answers
86 views

Language`ExpressionStore and ParallelMap

Is there a way to access NewExpressionStore from within a parallelized calculation? I have tried variations of ...
6
votes
2answers
211 views

What makes a pattern more general?

This is a rewording of the question. The original post is below. How come that a pattern for an expression with a specific head is not more specific than a pattern for an expression with a generic ...
0
votes
2answers
50 views

Force a result from “Indeterminate” for single impulse?

The formula for a single impulse of amplitude $1$ at $x=r$ is given by $$\frac {\sin (\pi (x-r))}{\pi (x-r)}$$ (In MathJax because it's a math formula.) Formally, at $x=r$, this function evaluates ...
0
votes
1answer
64 views

How to delay a function definition in NestList [closed]

I have a code like this. The algorithm is that the original number, 2, has some chance to either be constant 3 or to be 10 times ...
1
vote
1answer
78 views

Evaluate arguments in a curried function left to right

I have an inner pattern f[g, n_] := inner and I want to define an outer curried pattern f[h, m_][f[g, n_]] := ... which ...
1
vote
1answer
26 views

Halt the computation when it encounters a Symbol?

Is there a way to stop the evaluation of an expression when the result of that expression would depend on the value of a Symbol? ...
1
vote
2answers
86 views

Using names of loop variables in output file

Consider a set of lists: lista={{1,2},{3,4},{3,5},{4,8}} listb={{3,5},{7,6},{2,9},{3,7}} listc={{1,23},{3,23},{34,56}} I want to do some operation on them and ...
4
votes
1answer
81 views

SetDelayed not working as expected

According to the manual, "A variable defined with SetDelayed is evaluated every time it is used". The code below suggests otherwise. ...
2
votes
1answer
74 views

Function not being evaluated inside NIntegrate [duplicate]

I am trying to integrate the difference in a stepwise function and a continuous function, but the value I am getting is as if the step-wise function were identically zero, which I know it is not. Here ...
6
votes
1answer
44 views

Trace and TracePrint are slow, How to Trace to a file for speed

Trace and TracePrint generates or prints a list of all expressions used in the evaluation of its argument. For complicated ...
5
votes
3answers
230 views

pure Function[ ] named formal parameters

I am trying to setup a bunch of pure Functions in particular with an identical rahter long parameter list. ...
2
votes
2answers
108 views

Parallel Evaluation of Multiple Functions and Return the First to Finish

I have two functions which calculate the same thing using different methods. Sometimes, the first method is much faster than the second method. Other times, the other way around. Just pretend this ...
0
votes
0answers
56 views

Button action evaluation [duplicate]

An example of the problem I am encountering: ...