# Tagged Questions

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

330 views

### How to make Mathematica try harder to perform symbolic comparisons?

(I suspect this question is a duplicate, but I didn't find a sufficiently similar question with an answer to it.) I'm having trouble with comparisons of symbolic ...
200 views

### Derivative of the Dedekind eta function fails to compute with errors I don't understand

When trying to understand better the question Eisenstein Series in Mathematica? I stumbled on the following: issuing Derivative[1][DedekindEta][.11 I] gives ...
290 views

### Mod[1.2, 0.2] is not equal to zero

Why doesn't the following expression evaluate to zero? In[1]:=Mod[1.2, 0.2] Out[1]=0.2 Edit: This is what I wanted to do: ...
255 views

### How to do multi-dimensional principal value integration?

The toy model is: $$\int_{-2}^{2}\int_{-2}^{2}\frac{1}{1-(x^2+y^2)}\, dx\, dy$$ The integrand have opposite sign across the circle $x^2+y^2=1$, so one would expect that the integral has meaning only ...
1k views

### MaxSteps and Computing time issue for Solving Differential equation in Mathematica

When we solve differential equation numerically using NDSolve then sometimes we get error like NDSolve::mxst: Maximum steps reached According to Mathematica docs ...
1k views

### How can I solve Tan[t] - t == F[x] for t as a function of x?

How can I solve the equation Tan[t] - t = Ax, where A is a constant for t[x]? I know that ...
109 views

### Why is the Spherical Bessel Function acting strangely at this point?

I'm doing some computation that requires the use of Spherical Bessel Functions of the 1st kind, at high orders and values. So, I managed to find this, while running it over a wide range of values. I ...
2k views

### Plot FindRoot for non-trivial function

I would like to plot the results of FindRoot over certain range of inputs. I tried to do this with the code: ...
131 views

### NSum generates a warning message when getting the sum of a list

I know what I'm doing can be done with Total: a = Range@3; Total@a And if I simply choose ...
745 views

### How to guess initial complex value for FindRoot

I have to solve a transcendental equation for a parameter, say $\beta$. Now, the $\beta$ has a range from $ik$ to $k$ where $i$ is the usual imaginary root $\sqrt{-1}$ and $k$ is a real number. ...
219 views

...
231 views

### Non-linear curve fit problem

I am having a problem with making a fit to data in Mathematica, which may involve my understanding of the methods available. I am trying to fit the derivative of a Frota function (which is a Single ...
159 views

### automatic processing of numerical results in Plot`

First I want to solve an equation $F(x,y)=0$ for $y$ by supplying a value of $x$. (suppose obtaining the analytic form of $y(x)$ is too difficult) Then I want to plot root $y$ (numerically calculated) ...
309 views

### Mathematica can't minimize a function

Mathematica seems not to be able to minimize this univariate function over integer arguments, $r>2, r \in \mathbb{Z}$. ...
141 views

### Series expansion of InterpolatingFunction obtained from NDSolve

I am trying to obtain a series expansion of the numerical solution of a differential equation. I encounter difficulties going beyond first-order expansions which I believe might be due to my inability ...
126 views

### Applying N to the roots found by Solve gives complex numbers when the roots are real [closed]

I have a function which is f(x) = x^3 - 5 x^2 - x + 1. When I solve for x to find the zeros ...
284 views

### Slow evaluation of NIntegrate when used as a pure function

I asked a perhaps related question here. Here is my code in below. The goal is that to define a function which must be integrated numerically. The function itself first is calculated over different ...
781 views

### Running a Numerical Simulation on a System of Differential Equations with unique initial conditions

I have a system of differential equations as follows: ...
89 views

### singularity in boundary value problem

I am trying to solve a non linear differential equation with variable parameter. ...
1k views

### Numerics with Mathematica

From time to time, I would like to use Mathematica purely numerically, e.g., plotting a function which is defined as an integral which cannot be solve analytically or a solution of a differential ...
2k views

### 2D Heat equation: inconsistent boundary and initial conditions

I'm attempting to use NDSolve on a 2D boundary value problem with initial conditions. Upon running my code, I get the following message: "NDSolve::ibcinc: Warning: Boundary and initial conditions are ...
3k views

### Computation of Hankel Transform using FFT (Fourier)

To address circularly symmetric cases of 2-D Fourier Transformations, the so-called Hankel Transform can be applied (for a detailed derivation of the relation between the 2-D Fourier transform and the ...
901 views

### Computing polynomial eigenvalues in Mathematica

MATLAB offers a function polyeig for computing polynomial eigenvalues, which appear, for instance in quadratic eigenvalue problems (see here for some applications) such as: (M\...
162 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 ...
3k views

### Finding a fit to a multi-dimensioned function

I have a model function $f:\mathbb{R}^2\rightarrow\mathbb{R}^2$, and a bunch of data points for which I'd like Mathematica to fit for me. Unfortunately FindFit ...
606 views

### How to guarantee that NDSolve correctly detects abrupt changes in parameters?

When using NDSolve, I often have parameters that, in most of their domain, have a constant or null variation, but that suffer from abrupt variations on a very small ...
1k views

### Fast Spherical Harmonics radiative transfer

This is a rather specific question and I apologize for spamming you with some lengthy code. But it could be interesting for some reader and maybe you can help out, so please bear with me. I am using ...
755 views

### Real Numbers in the Wolfram Language

Epilog: Much of the discussion in the answers below revolves around the distinction between Real as a data type and real numbers as a domain or class of numbers (irrespective of the form in which ...
2k views

### What are the algorithm details of FindRoot?

The Help page of FindRoot says: "by default, FindRoot uses Newton's method (Newton-Raphson) to solve a nonlinear system". But I ...
259 views

### BitShiftRight produces incorrect results in Version 10

Bug introduced in 10.0.0 and fixed in 10.0.2 With Mathematica 10 for Mac, BitShiftRight works properly on lists of up to 100000 numbers, but appears to give ...
788 views

### Dual complex integral over implicit path using contour plot

Context I am interested in doing double contour integral over paths which are defined implicitly. For the sake of debugging, let's assume its $$\oint_{\cal C}\oint_{\cal C} \frac{1}{u\, x} d u d x$$ ...
692 views

### How to apply restrictions to the “integrated” variable, when using NDSolve?

I have to integrate an energy along a path. I know the energy at the "beginning" of the path (energy[0]), and I can determine the energy change (gain and loss) ...
1k views

### How to compute the inverse CDF of HyperbolicDistribution properly?

Fixed in version 9. I want to compute the CDF and inverse CDF of the hyperbolic distribution: ...
160 views

### FindMinimum doesn't increase step size when necessary

I've spent much time finding a minimal example demonstrating this problem with FindMinimum. Normally one faces this problem when fitting very large and complicated ...
1k views

### Water Hammer - Numerically solving system of PDEs

I'm trying to use Mathematica to solve the water hammer effect. ...
208 views

### Trouble with shooting method for a 4th-order differential equation

I'm trying to solve the following forth-order ODE with the shooting method: \frac{1}{5}(y-2xy^\prime)=\frac{1}{x}\left\{\frac{xy^\prime}{y}+xy^3 \left[\frac{(xy^\prime)^\prime}{x} \right]^\prime \...
2k views

### Numerical differentiation methods

Is it possible to write code in Mathematica that implements various differentiation methods (like forward, central, extrapolated, etc.)?
1k views

### Monitoring the Evaluation of NDSolve: time to finish estimation

My problem is quite simple: I run a NDSolve with a system of many ODEs, a calculation that will run for many hours, and I would like to know the progress of the ...
5k views

### Forcing FindRoot to return only real solutions

FindRoot documentation reports that if the equation and the initial point are reals, the solutions are searched in the real domain. However, in the following case I ...
4k views

### Does Mathematica get Pi wrong?

I happened to watch a Youtube video on Pi. According to the video, the 1 millionth digit of Pi is 1. And here is another page of the first 1 million digits of Pi. You can get the same answer from ...
483 views

### Symbolic Integration along contour: branch cut problem?

Context Following this question on path integrals in the complex plane, having defined again a numerical and symbolic integrator along a path as ...
151 views

### How to speed up Min of DateObjects?

I'm in version 10.0.1 using a Dataset to do some plots and things. For one of the plots I need to get the minimum date of a some filtered set of the ...
112 views

### How to enforce numerical precision throughout a package

I developed a big package that does quite a bit of numerics. Is there a way to enforce that all numerical computations are done with a pre-defined accuracy? For example, can one use something like ...
383 views

### How to cancel floating point factors?

I am currently having problems with some floating points. I have a function, which gives as an intermediate result (for example) ...
199 views

### NDSolve - sampling for result during the computation

I am using NDSolve for a Langevin dynamics problem. I want to the know long term behaviour of my system ($t>1$) but it has to be simulated with very small time steps ($dt\sim 10^{-9}$). An example ...
143 views

### Tools for Stability/Automatic Error Analysis in Mathematica

I have a longer analytic expression in several variables containing special functions and others. Does Mathematica bring tools - or are there any packages - to examine the stability when I evaluate ...
1k views

### Numeric calculation of Hessian

I want to calculate the Hessian matrix for a function that can only be evaluated numerically. So far, I have the following (where f is just for testing): ...
1k views

### NDSolve runs out of memory

I need to solve a second order ODE numerically. The ODE depends on two parameters (a,b). Things work fine when 'a' is small, but for large 'a' the solutions are oscillating rapidly and Mathematica ...