Tagged Questions

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
28 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
23 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?
4
votes
1answer
63 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
50 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
22 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
64 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
46 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
23 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
50 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
23 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 totally weird reason that I would like to understand, Mathematica do not evaluates the $q$ ...
0
votes
0answers
53 views
6
votes
1answer
66 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
121 views

Tracking Initialization

How to track Initialization step by step? Any tricky solution is ok. One condition, x should be ...
6
votes
2answers
90 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
73 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 ...
2
votes
0answers
30 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
26 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
50 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
41 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
46 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: ...
5
votes
2answers
133 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
219 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
39 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 ...
3
votes
5answers
151 views

Algebraic expressions on pure functions

I would like to know how to perform algebraic operations with pure functions. Simple version: Here's a silly toy model: I want to transform the algebraic expression Sin*Cos into the function ...
6
votes
1answer
104 views

Functional-Style Partial Application and the Accumulator Pattern?

Following up on Functional-style Fixed-Length Queue Object?, I want to generalize it to a functional-style accumulator pattern. Lots of things look like accumulators, loosely defined as binary ...
2
votes
0answers
55 views

Functional-Style Fixed-Length Queue Object?

Following up on question Side-effecting an array in an association? and @Mr.Wizard's answer in there, I'm modernizing and tweaking Daniel Lichtblau's efficient queues and ran into a little roadblock. ...
3
votes
2answers
85 views

Side-effecting an array in an association?

I'm working on some classical data structures (stack, queue, etc.) and want to mimic oo style in MMA. As a first attempt, I want to store an array in an Association, like this: ...
0
votes
3answers
145 views

Avoid creation of OwnValues when inserting transformation rules into Experimental`OptimizeExpression

I have a large list of transformation rules that I want to simplify. I find Experimental`OptimizeExpression works as it gets me the answers. My question is: **I can only get this to work when I ...
2
votes
1answer
95 views

How to explain the behavior of Rule inside these functions [duplicate]

I'm trying to define a function that takes an expression and spits out a pure function involving a replacement rule of that function's variable. An example would be a function ...
2
votes
1answer
130 views

kernel Local crashes during the course of a For loop

I want to find the minimum of the function r[x,p] subject to the constraint w[x,p,t]==0 (t ...
4
votes
1answer
122 views

Can $\it{every}$ usage of While be changed into NestWhile?

Ok, I think this problem is more close to philosophy. :P I've some idea now. But I'm not sure whether it's correct. For the purpose of convenience, I will use some C-like code instead of MMA's. A ...
1
vote
0answers
123 views

Memory problem in Mathematica 10

I'm having a problem with memory. I'm doing nonliner fits of several data lists to a system of differential equations. When I evaluate the "Do" cycle the memory grows with the iteration step up to my ...
3
votes
2answers
50 views

Mathematica automaticly evaluates some cells

Is there a command or a trick to tell Mathematica to not automaticly evaluate some cells? I use the NMinimize function to calculates some coordinates and then use ...
0
votes
0answers
45 views

Evaluation inside Compile

here's a simple question: I have a function: ...
6
votes
2answers
187 views

Why does Mathematica appear to change the head of certain expressions?

I don't know if the question trivial or not (if so I will delete it), but here is what I have: I know that x x (* x^2 *) Looking at the full form gives ...
1
vote
2answers
124 views

Higher derivative [closed]

Is there more efficient way to rewrite this code in order to compute 2nd and higher derivatives of r=sqr{x^2+y^2+(z-a)^2}? ...
0
votes
1answer
61 views

Simplifying a symbolic product of rational powers

I'm trying to symbolically evaluate a lot of equations that can consist of up to 10 parameters. The form of these expressions is a product/quotient of rational powers of the mentioned parameters, ...
0
votes
0answers
31 views

Expressions to functions, and evaluation [duplicate]

When calculating derivatives a expression is the result: in:= f[x_,y_]:= 1 + 2 x + 3 x^2 y + 4 x y^2 in:= D[f[x,y],x] out= 2 + 6 x y + 4 y^2 how do i make this ...
2
votes
2answers
56 views

Order of Evaluate for Map

I would like to get a list of variable names as strings. For example, x = 1; y = 2; Map[SymbolName, Unevaluated /@ Unevaluated@{x, y}] {"x", "y"} This works ...
15
votes
4answers
518 views

HoldForm doesn't hold form

Bug introduced in 10.0.0 and fixed in 10.0.1 In Mathematica version 10, HoldForm no longer produces the same results as in version 8 (edit: I only have versions ...
9
votes
3answers
126 views

Implement settable properties

I am looking for advice on implementing the following. (It is possible that the answer is that it is simply not a good idea to do this.) I would like to have an object similar to ...
11
votes
2answers
216 views

Why doesn't a Composition[] hold its arguments and what can be done about it?

Now that Composition (also RightComposition) has shorthand syntax I am more inclined to use it, however what I feel should be ...
3
votes
1answer
102 views

ExampleData menu view

I'm trying to build an ExampleData browser, so that the "collection"/"type" is selectable in a drop down menu, and the "name" is selectable in another drop down menu. What I have so far: ...
1
vote
2answers
163 views

How to get the absolute difference between two angles

I need a function that will give me the shortest separation between angles that range from -pi to pi. For example if I have two angles 3pi/4 and -3pi/4, I would like a function that will tell me pi/2 ...
8
votes
3answers
634 views

Why are functions called first-class objects in Mathematica?

I've heard lots of people say a function is a first-class object in Mathematica. "Everything is an expression, including function." "There is no distinction between functions and data." Having read ...
3
votes
1answer
163 views

Gateaux (directional) derivatives and higher order differentials of a functional

I would like to calculate the Gateaux derivative of a functional (i.e. a function depending on functions). A simple example for the Dirichlet functional: $L(u(x))=\int_0^1 \frac{1}{2} (u'(x))^2 dx$ ...
1
vote
0answers
72 views

How to implement nested With as a single construct using functional programming (Fold)?

It is possible to define my own With construct where each local constant can depend on the previous defined local constants? I wish to replace something like this ...
1
vote
1answer
94 views

Generate conditions seems to not work [closed]

I am trying to compute the following integral Integrate[E^(I*k*Omega*t), {t,0,T}, GenerateConditions->True] for which Mathematica returns ...
-3
votes
1answer
82 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 ...
0
votes
1answer
110 views

Why does Evaluate fail? [closed]

If i use this code: ...