# Tagged Questions

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

104 views

### Defer parts of the expression

Is there a way to Defer only parts of the expression? For example, I have a=1; and then I want the expression to be shown as...
212 views

### Wrapping at evaluation for inline cell

I've been playing with inline evaluation and I've came to the conclusion that it's most convenient to put the Dynamic@ inside the inline cell, so I've started to ...
84 views

### Can I have Mathematica show intermediate forms before final evaluation?

If I have x = 2 and I want to evaluate y = x^2 I would like to the output to show ...
114 views

### Manual CellGrouping option causes crash at cell evaluation

Update: Try to reproduce this behaviour with CellGrouping set to manual. To do that: either evaluate ...
310 views

### Why is this expression being held, and how can I evaluate it?

I can't figure out why an expression isn't evaluating, even though there's no Hold* in its FullForm: ...
9k views

### Evaluate an expression at a specific point

In Maple, you right click and can evaluate an expression (whatever it is) at a specific point say: Expr.= abcddafjosjfoj, then right click and simply evaluate at c=-34 say. But how does one do the ...
455 views

### Evaluate Numerator and Denominator Separately

I have this function. ...
160 views

### Function to preserve evaluation on display?

I'm looking for a function that applies the following behavior to an expression: -When the expression is given as the full input, or as part of a function that cannot be evaluated, it remains in ...
55 views

### recursively structuring a multivariate numerical optimization

Suppose that I want to partition the unit interval [0..1] into four subintervals whose max length is as short as possible. I can ask Mathematica to: ...
170 views

### Why does Mathematica not evaluate the difference recurrence using RSolve or RecurrenceTable?

Mathematica does not evaluate the following recurrence of two variables using RSolve and only echoes the input: ...
169 views

### How can I partially evaluate a function?

I have a multivariable function, from which I'd like to define a marginalization: f(a,b,c,d,...,z) ---> g(a,1,c,d,...,z) Generally, g will have fewer argument than f, possibly none (full evaluation)....
91 views

### How to get Mathematica to abort the current evaluation if an assertion fails?

I can turn on assertions, but they don't terminate the current evaluation. For example: ...
181 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 ...
68 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 ...
110 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 ...
262 views

Why does Map[Unevaluated, Table[PauliMatrix[i], {i, 1, 3}] give {Unevaluated[{{0, 1}, {1, 0}}], Unevaluated[{{0, -I}, {I, 0}}], Unevaluated[{{1, 0}, {0, -1}}]...
446 views

### GraphPlot only working when I evaluate twice

I have some code that builds a graph and some vertex coordinates, but when I evaluate it I get a message that the list of coordinates is not valid and the graph is not valid and it shows the output as ...
34 views

### Delete Cell Inside of Module

I want to print a dynamic output while some code is running and then automatically delete it when when the output is done. PrintTemporary is not quite what I am looking for -- I want the output to be ...
78 views

### Help on order of evaluation within plot function

it is my first time asking a question here so please let me know if there's anything I should be doing that I'm unaware of. I'm sure the answer to my question already exists on the site but I'm having ...
70 views

### Create a notebook and save it without prompting Dynamics

This is closely related to the recent: Creating self destructing notebook. However the answer doesn't work in my case. ...
104 views

### Clearing a global variable from inside a Module

This is a highly simplified version of a initialization problem I have with a complicated program with many (about 100) modules. If one enters: X=42; Clear[X]; the ...
73 views

### How can I use an InputField value as a variable name to save to?

I'm trying to save some settings and results from Manipulate, and I want to be able to save them to different variable names. The code I have is something like <...
113 views

...
59 views

### Display a part of a notebook when MMA has done evaluating it

When you evaluate a notebook, it begins to slide upward and shows you a different part of your code, several cells upstream of the notebook... I was wondering if there is a command that could always ...
281 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: ...
98 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... ...
78 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 ...
87 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 ...
152 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 ...
41 views

### is there a way to construct a pattern that would trigger when an expression is used as a held/unevaluated in some form?

For example, consider the following code f[x_] := (Print["evaluated f"]; workWith[x]); We use it, then f evaluates: ...
2k views

### Integrating a Simple Piecewise Function

If I define f[x_]:=If[x<0,-1,1] and then integrate,say Integrate[f[x],{x,-3,7}] I get what I expect, namely 4. But ...
124 views

### How to extract a variable names (not values) from a list of transformation rules?

I am trying to extract variable names from a list of transformation rules mapping = {var1 -> 'val1', var2 -> 'val2' }. Variables ...
248 views

### Generating an editable table that can be used as input

Say I have a number $n_{max}$. I want a command to generate a table like 1 1 2 2 3 3 4 4 ... nmax nmax where the second column is editable, and this table can be ...
146 views

### Need help looping a notebook evaluation

I'm a new user and would like to find the minimum value of soln1[30] obtained after repeating the following evaluation (below) for 1000 cycles (for instance). I can obtain sequential values of soln[...
189 views

### Differentiating a function that has NIntegrate within it

I am something of a novice with Mathematica. I have written the following code; ...
219 views

### Evaluation of the second argument to NIntegrate

The expression Integrate[x^2, Flatten[{{x},{1,2}}]] evaluates properly, to $\frac{7}{3}$. However, ...
64 views

### Label cell goes away with SelectionEvaluate

When a given cell has a label (given with the CellLabel->"label" option of the cell), then this label disappears after calling SelectionEvaluate[ nb ] when the ...
372 views

### Dynamic [ NotebookEvaluate [“_”] ]

A nice way to centralize various tasks in one notebook is the NotebookEvaluation function. For instance I can evaluate ten notebooks from a single notebook (e.g. ...
168 views

### Reuse local variable in declaration within With [duplicate]

Considering the richness of Mathematica.SE, I am quite surprised I could not find my answer... I am very sorry if it is a duplicate. Consider the following example: ...
150 views

### NotebookWrite undo

Is there way to make NotebookWrites undooable? For example let's say I open a new notebook and then run. ...
50 views

### Recognition Power Head for numeric value

We know: Map[Head, {a, a^2, a^3}] (* {Symbol, Power, Power} *) and Map[Head, {2, 2^2, 2^3}] all of them will be known as <...
121 views

### How to properly define this function of function

I encountered real problem at first, and here is the toy example variable argument stored some expression that is generated from other parts of the program. I ...
73 views

### Non-autonomous Dynamical system Sliding mode controller Error

This code is a simulation of a sliding mode controller of a non-autonomous dynamic. When I use ArcTan in input, I receive an error. ...
81 views

### Failure in the use of FullSimplify

My question is about an apparent failure of the function "FullSimplify" to simplify an easy algebraic expression. This is the expression that I ask Mathematica to evaluate: ...
110 views

### Why isn't Table iterator value inserted in failed NIntegrate arguments?

Consider this simplest example: Table[{z, NIntegrate[f[x], {x, 0, z}]}, {z, {1}}] Here f is not defined, so ...
112 views

### What is “ (Dialog) Input [ ] := ” after evaluating a cell?

I have done a time-consuming run and calculation. After many hours ( about 7 hours!), the black color which shows that the cell is evaluating, turn into gray and a strange text appears like this : <...
247 views

### Piecewise function with user-input interval

I would like define a function g[data,bins,x] which is a piecewise constant function taking value data[[i]] in the range ...
73 views

### Evaluate only one from a set of procedures

Let's say I've got a list of procedures: {Print[1];, Print[2];, Print[3];} And I want to only evaluate 3rd one: ...