Questions on the numerical functions of Mathematica, implementing numerical methods and numerical computing with Mathematica.

learn more… | top users | synonyms (1)

6
votes
1answer
175 views
+50

How do I numerically evaluate and plot the Fabius function?

The Fabius function is a well-known example in analysis of a non-analytic function that is infinitely differentiable. I want to be able to numerically evaluate the function for any real argument, as ...
9
votes
1answer
537 views

NDSolve and memory usage

After some googling, i've found similar problems around, but didn't find a 100% satisfactory answer, so let me ask here: I'd like to solve a 1+1 problem using the method of lines. In spherical ...
0
votes
1answer
60 views

Underflow occurring in computation

I've got an "Underflow occurred in computation" problem. Here's a simplified version of the code: ...
2
votes
0answers
56 views

Rationalize error

The docs state that "Rationalize[x,dx] yields the rational number with smallest denominator that lies within dx of x." However, testing this out it appears to be false. ...
4
votes
1answer
63 views

A simple syntax does not work

The code below does not work. Can anyone tell me why? Thanks! ...
1
vote
0answers
51 views

NSolve and FindRoot failing to evaluate

So I am integrating a Piecewise function and then using NSolve to find out where the limits of integration lie to satisfy an ...
2
votes
2answers
255 views

Incorrect numerical derivative of function that uses FindRoot

I am trying to plot the derivative of function g[x] below where g[x] is defined as the root of another equation. However, I am ...
0
votes
0answers
49 views

Optimization: Area of solvable constraints

I need some support with the following problem: In a polar-type problem, I hand over a list of variables rlist and a numerical optimization function (e.g. ...
10
votes
1answer
419 views

Confused by (apparent) inconsistent precision

$$ e^{\pi \sqrt{163}} \approx 262537412640768743.99999999999925 $$ E^(Pi Sqrt[163.0]) N[E^(Pi Sqrt[163.0]), 35] NumberForm[E^(Pi Sqrt[163.]), 35] returns <...
3
votes
2answers
538 views

A problem about function N

Toady,I have a problem about N,described as below: For example N[1/3, 5] (* ==> 0.33333*) and ...
1
vote
1answer
50 views

Error “Summand (or its derivative)…is not numerical at point m = -85.” on a simple sum

I'm a beginner on mathematica.. I'm trying to calculate a simple sum of a function, ...
2
votes
0answers
37 views

Why FinancialDerivative fails for the Spread case?

According to the documentation center for FinancialDerivative in version 10.4, when there are multi assets, we still may use ...
4
votes
0answers
57 views

How can I make NIntegrate aware of a singularity along a curve, e.g. a circle in a 3D integral?

I am having some trouble trying to get Mathematica to do a numerical integral over three dimensions which contains a singularity of dimension 1, and I would like some pointers to solid resources on ...
1
vote
1answer
82 views

Why do these calculations 'stop'? [duplicate]

Question 1: If I change guess to a integer, for example guess = 1 then ListPlot already stops at $n=50$. This seems strange to me, any ideas on why this happens? ...
4
votes
1answer
78 views

Can I use operators of the form $\frac{d^2}{dx^2}+i\frac{d}{dx}$ inside NDEigensystem?

I am currently trying to find the eigenfunctions of Hamiltonians of the form $\hat H=\frac12 \hat p^2 +a\hat p +f(\hat x)$, and I thought I would give NDEigensystem ...
1
vote
0answers
35 views
1
vote
1answer
58 views
28
votes
2answers
483 views

How to implement custom integration rules for use by NIntegrate?

How can NIntegrate be extended with custom implementation of integration rules? This answer of the question "Monte Carlo integration with random numbers generated ...
17
votes
1answer
180 views

How to implement custom NIntegrate integration strategies?

How can new integration strategies algorithms be used with NIntegrate? This is a different type of extension than the extensions with new integration rules, as ...
0
votes
1answer
56 views

What does it mean that “there are no significant digits to display”? [closed]

So I substitued with the following values in my function T(x,n) and it gave me this red box with the value in the picture. When I hover over it, it tells me that there are no significant digits to ...
0
votes
0answers
42 views

Numerical derivative step size

I am trying to perform a numerical derivative of some function using ND. I want to know if there is a way to set the step size of differentiation to the specific ...
1
vote
2answers
50 views

Chains of approximate numeric equalities

Mathematica considers two numbers equal if "at most their last seven binary digits" differ. For example: ...
2
votes
1answer
95 views

difference between FullSimplify and Simplify

I have a problem to dinstinguish the following two mathematica codes, the only difference is the first use FullSimplify and the second is Simplify. but the results are totally different. what is wrong,...
2
votes
1answer
82 views

Using Associations and Pattern matching in numerical functions possibly broken

It looks like the very young feature of pattern matching (/replacing) within Associations (http://mathematica.stackexchange.com/a/119542/6804), with or without ...
2
votes
1answer
301 views

Numerical comparisons of matrices

I have a matrix which should be equal to a null matrix. However due to the numerical precision, a brutal equality test with a matrix initialized with zeros does not work. How should I perform the ...
0
votes
2answers
76 views

Finding and plotting a parametric solution to a complicated equation (transcendental, log-polynomial)

I am trying (desperately) to find a way to solve a transcendental equation whose solution $x$ depends on non-numerical parameters $a$ and $b$. And then to produce a ...
1
vote
2answers
46 views

NSolve and domain specifications

I am using NSolve to find roots to a system of polynomials that describe some chemical reactions. However, I am seeing some odd behavior when I restrict the domain. First, the basic setup: ...
2
votes
2answers
97 views

Union sorting after ignoring some digits

I have a list with its bellow elements: {-0.7071067811865476, -0.7071067811865475, 0.7071067811865475, 0.7071067811865476} If I use ...
18
votes
6answers
2k views

Annoying display truncation of numerical results

I have a lot of data to inspect. An example of a number in my program is 123.189094 This gets displayed as 123.189 ...
2
votes
3answers
96 views

FindMinimum step size too small

I'm running a simulation of an electromagnetic system using Radia, an external code that is run from Mathematica. I want to use FindMinimum to determine some ...
3
votes
1answer
139 views

Machine-Precision and Arbitrary Precision [closed]

What is meant by a machine number in the Mathematica documentation? What is the difference between machine-precision and fixed-point precision? What is arbitrary precision?
1
vote
1answer
54 views

Evaluation of Element?

What is the Mathematica reasoning behind the result of the first two elements on the second row of the following table? ...
5
votes
1answer
203 views

Is there an alternate way to calculate beyond the memory limit of the home edition?

I bought the Home Edition of Mathematica online 0.5 G of memory and costs \$150 per year. When I calculated the median of outputs from $[0,1]$ with an interval of $.000001$ I ended up with the ...
3
votes
2answers
133 views

Multiplication non-deterministic?

I have two vectors of 134 elements each ($mu$, and $gt$). $mu$ contains Integers, and $gt$ contains machine precision Reals. I execute the following simple expression multiple times without changing ...
1
vote
0answers
60 views

Numerically parameterize portion of $F[x,y]==0$ [duplicate]

I have a relatively complicated function of two variables F[x,y] whose zero locus contains a number of intersecting paths in the $x,y$-plane. A problem I've been ...
1
vote
0answers
271 views

Problem with NDSolve in Mathematica 9 / 10

I'm having trouble by solving the following differential equation in Mathematica 9 and 10, where the code works fine in version 7: ...
4
votes
2answers
909 views

Numerical solution of Bessel-like equation using NDSolve

I need to calculate solution of Bessel-like equation having general form: $\frac{d^2F}{dr^2}+\frac{1}{r}\frac{dF}{dr}+Q(r)F(r)=0$. Problems come from the points near $r=0$ leading to numeric errors. ...
0
votes
0answers
31 views

Copy-pasting a floating point number [duplicate]

Here is a behavior of the Mathematica front end which confuses me. Type N[Sqrt[2]] The displayed output is 1.41421 ...
16
votes
0answers
184 views

Is manual adjustment of AccuracyGoal and PrecisionGoal useless?

This is a problem confusing me for years. AccuracyGoal and PrecisionGoal are two options that I never truly understand and, to ...
3
votes
1answer
102 views

Understanding difference between `NIntegrate` result and home-cooked Simpson's rule

In this question I am asking about the different results I get between NIntegrate-ing a function of two variables vs. "doing it myself" with my own implementation ...
0
votes
0answers
58 views

Numerical fitting trajectory to model that has NDSolve

I have a model which describes the motion of an object on a plane. ...
0
votes
2answers
162 views
3
votes
1answer
120 views
14
votes
4answers
298 views

Does Mathematica have an equivalent of C's nextafter?

In C (and many other programming languages), there is a function double nextafter(double x, double y) which takes two (IEEE 754) floating-point numbers and ...
1
vote
2answers
86 views

Determining the value at which a function becomes non-real or undefined

If I have a function $f(x)$ that I only know numerically and that returns a real value for some range of values $-\infty < x \leq a$ and complex values for $a < x < \infty$, how can I ...
2
votes
1answer
104 views

Using loops to draw multiple polygons and discretizing them

I am trying to plot the first eigenvalue of the Laplacian operator with zero Dirichlet condition on following figure against decreasing values of $\varepsilon$. I used ...
3
votes
1answer
60 views

MachinePrecision versus $MachinePrecision in NDSolve

I'd like to understand why one of these inputs gives me an error and the other doesn't: ...
0
votes
1answer
33 views

SetPrecision on a decimal gives imprecise result [duplicate]

I noticed that SetPrecision doesn't actually guarantee that my number is as precise as I want: ...
0
votes
0answers
31 views

Use “FindFit” for Multi-variable Polynomial Fit

I'm interested in defining three input vectors: $L=\{L_{1}, \ldots, L_{N} \}$ $W=\{W_{1}, \ldots, W_{N} \}$ $Q=\{Q_{1}, \ldots, Q_{N} \}$ and I'm hoping to be able to input a number for each of ...