Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [evaluation]

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

0
votes
1answer
29 views

Function that refuses to return a value

I wanted to know the exact solution to the following differential equation $$ \frac{\mathrm{d}^2 y}{\mathrm{d} t^2} = - \frac{1}{y-1}, \quad \begin{aligned} y(0) &= 0 \\ \left. \frac{\mathrm{d} y}...
4
votes
1answer
407 views

How to prevent mathematica rounding extremely small numbers to zero?

I have a function that, while the maths itself is unimportant, at certain values it results in a very large number multiplying a very small number. E.g. 10^450000 * 10^-449998. As you can see, this ...
6
votes
1answer
96 views

RegionPlot3D no longer localizes its arguments?

Bug introduced after 9, fixed in 12.0. Just now, I was astonished to find the behavior of RegionPlot3D changes somewhere after v9 . Consider the following sample: ...
1
vote
2answers
65 views

How to get the derivative with StepMonitor

I am trying to use StepMonitor inside of the NDSolveValue function for a complicated system of differential equations, but the simple example below shows my issue just fine. I am trying to obtain ...
6
votes
1answer
618 views

How to monitor a big program?

Is it possible to know how much % of calculations are done in a big program? In other words, % will increase gradually when the calculations are progressing. I want to see the %.
5
votes
5answers
151 views

How to factor all coefficients of a multivariable into prime factors

I have several polynomials in 2 variables with integer coefficients, e.g., poly= -10 x - 10240 y^3 - 1520 x y^4; I'd like to convert all such polynomials into a ...
12
votes
2answers
254 views

Unexpected behavior of the procedure `Area` on the object 'Polygon'

Bug introduced in 11.3 or earlier and fixed on 12.0. Sometimes get a results, sometimes left unevaluated. For instance ...
3
votes
2answers
81 views

Keep element of formula as it is

I have ClearAll["Global`*"]; de = f''[y] - (n^2 \[Pi]^2)/(4 a^2) f[y]; DSolve[de == -q/S (4/(n \[Pi] b))(-1)^((n - 1)/2), f[y], y] and I would like the $(-1)^{(n ...
2
votes
1answer
72 views

Why is Mathematica “de-evaluating” my expressions when I try to generate a Table? [duplicate]

I am attempting to plot a combination of StreamPlot and ParametricPlot that is a function of a parameter. When using Manipulate or Animate, the evaluation is slow but the graphs are outputted as ...
2
votes
1answer
52 views

Why can't I execute other commands while the dialog is running?

Bug introduced in v10.4 or earlier and persisting through 11.3 CASE:4226661 The code is from the following video: http://www.wolfram.com/broadcast/video.php?sx=Ian%20Johnson&v=2076 ...
2
votes
0answers
64 views

Wrong result using “numeric” symbols

Recently I stumbled upon a weird bug when I used a package that sets the NumericQ result of symbols you are feeding into a certain function to true. Here is a minimal working example of what I mean: ...
3
votes
1answer
62 views

Correct way to make groups of cells (not) evaluable

Let us say that I want to make all the cells within a section not evaluable. In principle, I would simply highlight the relevant section, then go to ...
2
votes
0answers
34 views

Problem with PopupMenu: Its values don't update dynamically

I have a problem with PopupMenu inside DynamicModule, its values don't update dynamically as they supposed to. The example below ...
2
votes
2answers
57 views
0
votes
0answers
32 views

Why am I getting strange results from CUDADot?

This is what I am getting: This is what I am expecting:
0
votes
1answer
27 views

Variable value is changing inexplicably [closed]

So I was trying to avoid doing some trig calculations on paper by using mathematica, when I encountered this (Screenshot in a new notebook, after having restarted everything): As you can see, B is ...
1
vote
0answers
53 views

Making a function definition where the right hand side is evaluated before the definition is saved [closed]

My question is about assigning the resulting expression after evaluation of a function. So what I want: FOCf[x, y] := D[f[x, y], x] such it immediately ...
0
votes
0answers
46 views

Extract unevaluated definition of function

Say I have a function f[x_]:=a x + b Now I want to get the a x + b part from the function to use in e.g. ...
7
votes
2answers
114 views

Bug in VectorFieldPlot[] with InterpolatingFunction[]?

Bug introduced in 11.3 or earlier and persisting through 11.3.0 or later While looking at How do I Plot a Divergence?, I thought to suggest the following as a solution to the OP's problem (where <...
1
vote
1answer
60 views

Nested Do loops with externally defined iterators [closed]

I want to be able to define a set of iterators for nested Do loops, such as ...
5
votes
2answers
84 views

Converting prefix to infix

Is there a way in Mathematica to convert prefix to infix notation (where precedence order is preserved)? For example, how would I convert S[a, S[b, c]] to ...
2
votes
0answers
27 views

Using Min & Max of an Interval in a replacement [closed]

I want to use a replacement rule to transform a list of equations. The following works as expected: ...
2
votes
2answers
85 views

How to evaluate the “Domain” of a Parametric Function?

In a simple example I try to calculate the time the solution x[t] passes a second time x[t]==1. ...
2
votes
1answer
30 views

Reevaluating an expression when Assumptions have changed

Is there a way to make this work? THM = TensorDimensions[M]; Assuming[ Element[M, Vectors[n]], THM ] Which gives: ...
3
votes
2answers
98 views

Convert defined variables to rule list

I'd like to make a function that takes a list of variables and returns a corresponding rule list with the current values of the variables. E.g. ...
0
votes
1answer
30 views

Replacing non-adjacent variables [closed]

Suppose I have an expression of the form $exp=a\,b\,c\,d\,+\,e\,f\,g\,h$ where all the letters represent real numbers, and I want to replace $a\,c$ in the first term by $w\,x$ and $f\,h$ in the second ...
3
votes
3answers
217 views

Why is expression not evaluated completely? [closed]

I have a simple sum of complex numbers. In my example their sum is zero. sum = Total[{1 , E^(2*I/3*Pi) , E^((4*I)/3*Pi)}] Print[sum] Try it online! When ...
1
vote
0answers
40 views

Differentiating functions of Set expressions

There are so many things in Mathematica I think I will never understand. Perhaps today there will be one fewer... B'[y]/.B->Function[y,y^2] Outputs ...
2
votes
0answers
64 views

Calling a notebook from a different notebook

Basically I have a notebook (let's call it nb1) that when evaluated yields one number when I specify some parameter $\alpha$ (in nb1). I want to call nb1 in a different notebook (nb2) using for ...
3
votes
2answers
175 views

Maximum point of a rational function

Suppose I have the following rational function: ...
5
votes
0answers
34 views

Why does't 'Abort evaluation' properly work when NotebookEvaluate is executed

The following procedure can be easily aborted using Evaluation > Abort Evaluation menu item: Do[j + k, {j, 1, 10000}, {k, 1, 10000}] But it is not possible if <...
0
votes
0answers
29 views

Incorrect Function value and Derivative when expression in numerator yields zero

Recently I found that in special cases when the r.h.s. of a function definition is not simplified, and part of the expression in numerator yields zero, the value of the function is incorrectly zero as ...
5
votes
1answer
70 views

Does the position of a comment in a CompoundExpression matter for the result obtained with Out (%)?

I would like to understand what happens when we include a comment at the end of a line that ends with a semicolon. For example, if you execute ...
3
votes
1answer
90 views

HoldFirst being overridden by Activate [duplicate]

So here's the problem a=1;a=2 works because of the HoldFirst attribute of Set, so that it ...
0
votes
0answers
15 views

Evaluating part(s) of a function which outputs another function [duplicate]

I would like to define a function f(n) which outputs another function as follows: ...
1
vote
1answer
29 views

Evaluation of Extract and use the result in a Sum

I am experiencing a problem in the evaluation of a sum. I hope that someone can help me, I am not an expert Mathematica programmer. I'm posting just the portion of code that gives problems, I know ...
2
votes
1answer
45 views

Strange behaviour (or issue?) in using evaluation of held argument inside a table in Mathematica

I encountered a very strange behaviour on Mathematica using Evaluate on a held argument. Could anyone explain to me what is the subtlety (or is it a bug?) Here is the expression: ...
5
votes
2answers
91 views

How to prevent arguments UpValues from being used in selective functions

Ok, I know the simple answer is to set some form of Hold attribute to the function but bear with me for a bit while I explain my motivation and why that is not quite what I want. I have a collection ...
10
votes
3answers
177 views

Perform localized, evaluation-leak free replacements

Consider the following expression: expr = Hold[ { f[ {1, {Print@1}} ], g[ {{{Print@1}}} ] } ]; I'm looking for a way to ...
0
votes
1answer
31 views
1
vote
2answers
63 views

Getting thet derivative of a user defined function in terms of an auxiliary function

I'm currently struggling with evaluation control when getting the derivative of a function (I dont know if that's the correct term here. Sorry, beginner). My function is of the form ...
0
votes
2answers
40 views

How to find value of an expression if some cases are given>

I actually need to find the value of x which have 3 cases as follows: x=0, when x<=0 x=[x], when x>0 and is non-integral ...
9
votes
1answer
190 views

Force evaluation of user-defined function

Consider a function that sorts its arguments based on a function called order ...
1
vote
0answers
66 views

Why is my Mathematica notebook resetting all my previous computations after some hours?

I am using Mathematica 11.1. This morning I started some calculations in the hope that when I come back from work, they will be finished and I can get on with the rest of my project. Indeed, when I ...
0
votes
0answers
64 views

Evaluate higher order derivative at some point under some assumptions

I need to evaluate the $k^{\rm th}$ order derivative D[w[t] w'[t], {t, k}] which is actually equal to ...
0
votes
0answers
33 views

How to perform delayed evaluation containing function with Mathematica

I was wondering whether there is a way in Mathematica to evaluate an expression in the most simple form, without any simplifying. For example if we define: ...
3
votes
2answers
48 views

Parametric function with reference at a central point

Would anyone have any idea how to delete the xy andxyz steps? I tried using the Evaluate ...
1
vote
0answers
37 views

How to use Evaluate inside function definitions? [duplicate]

How to use Evaluate inside function definition so that is acts as Evaluate only whet function is called? This is toy exampl, where I want to define function inside another function: ...
1
vote
1answer
69 views

Why the difference in outputs in different cores?

Executing the code r = RegionIntersection[Region[Ball[3]], Region[Ball[{1/2, 1/3, 5/6}, 1]]]; Region[r] in version 11.3.0.0 on Windows 10 32-bit, I don't ...
5
votes
3answers
350 views

What is the the proper way to define a function from an expression?

Say after some long computation we get an expression expr=x^2 We do not know what the value of expr beforehand. Now we want ...