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

learn more… | top users | synonyms

1
vote
1answer
21 views

Package function not evaluating

I have a short package like this: ...
-3
votes
0answers
46 views

Function Expectation

I want to have a function result from this expectation is it possible? ...
3
votes
3answers
86 views

ReplacePart equivalent for Associations

I have a fairly complicated Association. I wish to use/create a function such as ReplacePart to operate on certain Keys within this multi-level Association. Here's ...
0
votes
1answer
39 views

Aborting from a Dialog box

I'm trying to abort a While cycle, with a dialog box. I've tried the following: ...
-1
votes
0answers
57 views

How to find a function result from expectations functions [duplicate]

How to find a function result from expectations of this function: ...
0
votes
0answers
22 views

I am going mixed [migrated]

Why this is wrong ? $ -1=(-1)^{2/2}=((-1)^{2})^{1/2}=1^{1/2}=1 $ Then $1=-1$
0
votes
0answers
32 views

Order of evaluation when using Solve and Minimize

I have to solve numerically an integral, that ends up being more or less as follows: Solve[f[x]==a*Sum[Sin[x-i]*(f[i]-f[i-1]),{i,1,x}],f[x]] (not actual ...
0
votes
0answers
50 views

Evaluating Expectation [duplicate]

I would like to have a result equal to a function : ...
-3
votes
1answer
97 views

Integration with mathematica? [closed]

I am very new to Mathematica. I am trying to evaluate ∫ (1+lnx)Sqrt(1+(xlnx)^2) using Mathematica. I know a substitution must be done so I have set ...
2
votes
1answer
90 views

Mathematica displays the unevaluated expression Expectation function

The evaluation runs for a few seconds and then Mathematica displays the unevaluated expression Expectation function ...
1
vote
1answer
42 views

Getting Gamma as a result for integration [closed]

When finding the mean from the distribution, fx = 4*x^3*Exp[-x^4] meanx = Integrate[x*fx, {x, 0, Infinity}] I get Gamma[5/4] Could someone explain what ...
0
votes
1answer
48 views

Defining a function with algebraic parameters

I am trying to define and use a function to represent the eigenstates of a Quantum Harmonic Oscillator, which have the general form: $$\psi_{n}(x) = \frac{1}{\sqrt{2^{n} n!}}\left(\frac{m \omega}{2 ...
4
votes
2answers
97 views

Difference between Evaluation>>Quit Kernel and Quit[]

What is the difference between Evaluation >> QuitKernel and Quit[]? Both seem to quit the kernel (and clearing all ...
1
vote
0answers
34 views

Question on Function in Replacement Operation

I am trying to create a replacement function which, depending on the input, gives an additional minus. In my example I have an undefined function a with two ...
6
votes
2answers
455 views

How Can Notebook Know When it Called by Another Notebook?

I would like a notebook to behave slightly differently depending on whether it is evaluated from another notebook; i.e., ...
1
vote
0answers
71 views

Summing the probability distribution to 1 to convince myself

I have worked out a probability distribution and want to check its sum which is necessarily 1. First we write $$ r \triangleq \frac{(2 \lambda + \mu)^2}{2(\mu + \lambda)^2}, \quad s \triangleq ...
3
votes
0answers
54 views

Regarding Evaluated True

Done a bit of reading: Normal[Series[ ]] does not give a normal expression Regarding the Evaluated->True, consider: ...
0
votes
0answers
30 views

reloading previously evaluated inputs? [duplicate]

How do I avoid having to resend previously evaluated commands when I reopen my notebook? can't it just allow me continue my computation from where I stopped? Also, some inputs take forever to execute, ...
1
vote
1answer
46 views

How to abort silently?

I want to Abort[] an evaluation without generating this message: $Aborted Is there a way to do this? This messages modifies my notebook, and I don't want this to ...
2
votes
0answers
61 views

$Epilog does not work when exit

The following code does work: $Epilog := Print@1; Quit[]; But if I close the document and exit WM or click QuitKernel, it does not work. Why?
11
votes
1answer
2k views

A one line proof that one is zero using Mathematica 10

a = (Sqrt[2] + 1) (Sqrt[2] - 1) - 1; {a/a, Simplify[a]/a, b/b == Simplify[b]/b} {1, 0, True} This one line "proof" that ...
1
vote
2answers
49 views

Strange behavior of the Evaluate function

I am solving a system of differential equation whose unknown are saved under variable vec={C00,C01,C10,C11} and the solutions are saved under variable ...
1
vote
0answers
44 views

Is it possible to pipe the output of EvaluationMonitor to Excel?

I have an EvaluationMonitor setup to capture the points processed by NIntegrate. This is a case where the same function, integrated over the same region in cartesian coordinates yields a dramatically ...
4
votes
1answer
82 views

Slowdown of Flat attributed function

I was trying to write an associative function f using the attribute Flat. ...
3
votes
0answers
74 views

Dynamic and Refresh

If I am not mislead by my memory, in Mathematica 6 a function Refresh was introduced, having the options UpdateInterval and ...
3
votes
1answer
56 views

Defining a function that prints both the name and value of a variable defined locally within the calling function

To save time when debugging with Print statements, I'd like to define a function -- call it PrintVal -- that prints both the name and value of a variable defined locally within the calling function. ...
10
votes
1answer
240 views

Why does the documentation call functions “pure”?

Clearly, functions in mathematica are not pure functions according to the definition on Wikipedia (no side effects - basically implementabe with table lookups): ...
2
votes
1answer
42 views

Is there a simple function identify the sign of an expression given constraints

I'm looking to find a simple function that can identify the sign of an expression given a set of constraints. I have looked around and do see that there is a few threads on this but I'm not sure I ...
0
votes
1answer
29 views

How can I get numerical answers to integrals involving the error function?

This is the integral I am trying to evaluate in mathematica: Integrate[Exp[-p^2/(m w h)], {p, -Infinity, Sqrt[h m w]}] Can someone show me how to get a numerical answer out of this?
5
votes
1answer
81 views

How to track Part of Symbol or How to symbolize Parts of Symbol without copying data

Let's create simple function: SetAttributes[h, HoldFirst]; h[data_] := Dynamic[Grid[data], TrackedSymbols :> {data}] test = RandomReal[1, {2, 2}]; h[test] ...
1
vote
2answers
57 views

Assigning to the “local” version of a symbol

Compare Manipulate[c[1] = 1; c[1], {c[1], 0, 1}] with Manipulate[Do[c[i] = 1, {i, 1}]; c[1], {c[1], 0, 1}] The first case ...
0
votes
0answers
25 views

Expanding Function Based on Congruence Classes

I'm trying to get Mathematica to expand $\quad \quad \beta_n=\sum_{r=0}^{n}\frac{\alpha_r}{(q^4;q^4)_{n-r}(q^4;q^4)_{n+r}},$ where $\alpha_r$ is an integer valued sequence that is given by ...
1
vote
1answer
65 views

Strange integration

I tried to evaluate this line Integrate[((-I/2) (E^((-I) x) - E^(I x)) + ((E^((-I) x) + E^(I x)) x)/ 2)/((-1 + E^x) x), {x, 0, Infinity}] Then I get $14$ ...
3
votes
1answer
56 views

A problem about sorting final result

Three days ago, I asked a question about B-Spline Basis fuction here @Michael E2 given a solution to make the order of interval looks normal The easiest way would be to sort it afterwards: ...
1
vote
1answer
25 views

Expand Expression with Nested Special Functions [closed]

I am trying to study the following sequence for $a=1$, $n \ge 1$: $$\alpha_n=(1-aq^{2n})\sum_{j=0}^{n}\frac{(aq;q)_{n+j-1}(-1)^{n-j}q^{\binom{n-j}{2}}}{(q;q)_{n-j}(q;q)_j^3}$$ using Mathematica, where ...
2
votes
1answer
53 views

How can I set a RadioButton to invoke an action, like a Button can?

In Mathematica one can create a Button which, when clicked, invokes an action. For example... ...
0
votes
0answers
56 views

Mathematica not evaluating q derivative of Jacobi theta function

Jacobi theta functions, $\theta_a(u,q)$ for $a=1,2,3,4$ are defined in the unit disk $|q|<1$. For some reason that I would like to understand, Mathematica does not evaluate numerically the $q$ ...
0
votes
0answers
54 views
6
votes
1answer
77 views

Held keys in associations

Jacob Akkerboom commented: Note that PositionIndex does work correctly with held expressions, whereas this is a bit painful to implement using ...
9
votes
1answer
128 views

Tracking Initialization

How to track Initialization step by step? Any tricky solution is ok. One condition, x should be ...
6
votes
2answers
95 views

Showing “updating…” message while Manipulate is re-evaluating

Is it possible to show a fixed text such as "updating..." instead of the last result shown, when Manipulate is re-evaluating an expression (in a slow evaluation ...
0
votes
0answers
92 views

Mathematica not responding

I am working in the field of applied physics. Some body suggested me to use Mathematica for plotting graphs and programming. After going through some tutorials, I have written the following code but ...
3
votes
0answers
33 views

Use EvaluationCompletionAction to notify me only after long evaluation

Is it possible to use the option EvaluationCompletionAction to notify me (e.g. with a Beep[]) when an evaluation that took ...
0
votes
0answers
31 views

System of Nonlinear equations with Gamma and Incomplete Gamma function

The next two nonlinear equations are cumulative ratios of a production system. The mathematical model includes two essential parameters (n, tau) that can be obtained by solving this system. I'm ...
2
votes
1answer
56 views

Inactive derivative: extract constants

I have a problem with an unevaluated derivative. In the example code below, i need the integration wrt to y be evaluated, while the differentation wrt x needs to stay unevaluated. I see the point that ...
0
votes
0answers
53 views

kernel stops evaluation, clears variables

I am using the new Mathematica 10 student edition. As I am evaluating a table of integrals and calling NIntegrate repeatedly, the evaluation stops without error and the kernel clears all variables. ...
0
votes
1answer
49 views

What's the difference between this differentiation? [closed]

I've tried to evaluate a sum and get a result in terms of Zeta function. And I have results in two forms: ...
6
votes
2answers
154 views

Menu item “Interrupt Evaluation…” missing in V10

The menu item “Interrupt Evaluation…” seems to have disappeared in Mathematica 10 on OS X. Well, this is a bummer. I personally use Mathematica for very long calculations, and I was using this ...
5
votes
3answers
234 views

difficulty abstracting the OptionValue pattern

I am building lots of functions that use Options and OptionValue and wanted to reduce the redundancy in the expressions that ...
0
votes
1answer
40 views

Ivar error with Fit inside Plot

I'm trying to plot this Plot[Fit[med,{1,x},x],{x,0,10}] Why this doesn't work? I find out that if I do ...