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

learn more… | top users | synonyms (1)

0
votes
1answer
24 views

NDSolve with coupled ODE's and unknown singularities

I have two coupled ODEs that I am trying to solve numerically. It appears that there is a singularity in the solution to the equations which I am unsure how to get past. Both functions $\alpha$ and ...
2
votes
3answers
145 views

Use NMinimize instead of FindFit for constrained search (of coefficients)

(My problem is more complex, but let us formulate it through this example) I am trying to find the best polynomial approximation to the following function ...
2
votes
0answers
63 views

Computation of a Fresnel Diffraction pattern with Discrete Hankel Transform

In the next link: Computation of Hankel Transform using FFT (Fourier) Rainer implemented a great solution given in the next reference: Manuel Guizar-Sicairos and Julio C. Gutiérrez-Vega, "Computation ...
2
votes
2answers
45 views

Numerically solving coupled ODE's with a parameter as initial condition

i'm currently trying to numerically solve a set of coupled ODE's to obtain the functions p(r), h(r) and m(r) in the range of r1 <= r <= r2 with initial conditions m(r1)=a=const and ...
14
votes
1answer
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 ...
18
votes
1answer
464 views

Numerical inverse Laplace-Hankel transform

When trying to reproduce the result of this paper about numerical solution of Lamb's problem, I encountered the following double integral (to be more precise, the 0-order inverse Hankel-Laplace ...
0
votes
0answers
45 views

Eigenelements of conductivity equation

I am trying to calculate the eigenvalues and eigenfunctions of the conductivity equation in an annulus. In particular I am looking for $(\lambda, u)$ s.t. $$ \begin{cases} \Delta u = \lambda u & ...
8
votes
3answers
919 views

Implement the Bisection algorithm elegantly and easily

Description: Rencently, I have finished my course Numerical Analysis, so I'd like to implement many algorithm that I have learned from that course.By this practice, I hope that I can improve my ...
2
votes
0answers
48 views

Why can Mathematica compute numerical sums more efficiently when they are written as matrix operations?

Let $f(n)$ and $K(n,m)$ be functions such that the double sum, which we wish to evaluate numerically, $$ \sum_{n=1}^a \sum_{m=1}^a f(n) f(m) K(n,m) $$ exists when $a$ is some large positive number. I ...
-4
votes
1answer
32 views

How to write this iterative sequence function in mathematica

The function is Tx=1-x if x∈[0,1/7) =(x+6)/7 if x∈[1/7,1]. I have to write the iterative sequence for n=0,1,2,3,4,5----- where x_{n+1}= ...
1
vote
2answers
102 views

Numerical integration does excessive coarse-graining?

I am trying to perform numerically the following integral $$\int_0^8\text{d}x\,\text{Re}\left[\frac{e^{-\frac{a^2}{2}-\frac{x^2}{2}} x^4 \sin (b x)\left(e^{-i c x} \text{erfc}\left(\frac{-c +i x ...
5
votes
1answer
124 views

Multiply integrand with -1, and the precision changes?

"After multiplying the integrand of NIntegrate with -1, the Precision of the output will ...
3
votes
0answers
74 views

Kernel crashes when computing finite difference mixed derivative with respect to y & z but works fine when computing with respect to x & y or x & z?

I am using Mathematica 10.4.0 on Ubuntu 16.04. I am trying to solve a set of differential equations using finite difference method on an NxNxN cubic grid (x, y, z directions). I am getting a weird ...
1
vote
2answers
96 views

NSolve won't act on very large powers

I noticed that NSolve isn't running properly when I have some seemingly harmless numbers in my expression. Here is a simple example: ...
5
votes
1answer
72 views

Finding the correct boundary conditions to a specific problem

I want to reproduce the following problem in the figure: $$\phi''+c\phi'\sqrt{m^2\phi^2+\phi'^2}+m^2\phi=0$$ where $\phi=\phi(x)$ with $x \in (-\infty,\infty)$, $c=\sqrt{3/2} \ $ and $m=0.2$. ...
5
votes
1answer
72 views

ComplexInfinity for a convergent product

The infinite product involving the ratio of (n^2)! to its Stirling approximation ...
57
votes
9answers
3k views

Updating Wagon's FindAllCrossings2D[] function

Stan Wagon's Mathematica in Action (second edition; I haven't read the third edition and I'm hoping to eventually see it), demonstrates a nifty function called ...
0
votes
1answer
1k views

how to solve second order nonlinear coupled differential equations using NDSolve with hyperbolic function

i have to solve some solitons scattering through this coupled equations. i need to get two different graph, but still the graph did not come out. and also the equations quite complicated containing ...
14
votes
2answers
239 views

What can one do with extremely stiff problem in NDSolve?

Consider the following illustrative problem: $$ \frac {\partial f} {\partial t} = \frac {\partial} {\partial x}(x f) + \frac {\partial} {\partial x}(f \frac {\partial f} {\partial x}) $$ This is ...
0
votes
1answer
54 views

Transform a variable's exponent from an exact rational to an inexact decimal

here is a little problem I could not find a solution for. I have a variable with an exponent represented as a fraction, for example, var = a^(39/106) Now I ...
0
votes
1answer
56 views

Using Neumann boundary conditions

I had a semi-related physics problem I needed to solve analytically (which I have already done), but I am now curious how I would go about numerically solving the entire system in Mathematica. ...
0
votes
2answers
72 views

Numerical derivative from data points

I want to take the second derivative of a set of data points (at the point $x = 0$). Let's assume that this set looks like that ...
1
vote
1answer
99 views

Mathematica Precisions vs Doubles in C/C++

I'm having a bit of an issue regarding numerical precision and I'm not sure how to deal with it. I have a certain randomly generated matrix, say $M$, that I wish to compute the eigenvalues. The ...
1
vote
1answer
36 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 ...
2
votes
1answer
55 views

Accuracy limitations of singular value decomposition?

in the process of working on a physics problem I have found the need to use the singular value decomposition function built into Mathematica. I have encountered what seem to be limitations to the ...
0
votes
0answers
43 views

Problems with numerical solution of differential equation

I'm trying to obtain a numerical solution for my differential equation. But i have the following mistake: Encountered non-numerical value for a derivative at z == 0. Can somebody help with that? ...
0
votes
1answer
469 views

Problem with FindRoot applied to functions

I am having difficulty with the error "is not a list of numbers with dimensions..." when using FindRoot (and other numerical routines in Mathematica) to solve equations numerically when the argument ...
4
votes
1answer
344 views

How to calculate accurate answer in Mathematica?

I accidentally discovered for myself, that Mathematica outputs inaccurate answer. For instance, if I take $\sin(2 \cdot \pi \cdot 0.5) = 0 $, then in Mathematica it is: But if I calculate it on ...
12
votes
2answers
814 views

Why can't I change the value of MaxRecursion in NIntegrate when integrating BesselJ?

Bug introduced in 8.0.4 or earlier and persists through 10.4. I am trying to evaluate this integral numerically $$ \int_0^{\infty } J_0(q R) \tanh(q) \, \mathrm{d}q $$ for large values of $R$. ...
1
vote
1answer
55 views

Precision in calculation [duplicate]

I am writing some code to demonstrate the effect of the number of significant figures a coefficient has on the solution of a nonlinear equation. I define the coefficient as follows: ...
1
vote
0answers
91 views

How to find the eigenvalues of a custom operator using NDEigensystem? [closed]

I would like to solve a Hamiltonian presented by a 2x2 matrix. Hamiltonian is given by: ...
0
votes
1answer
115 views

How can I solve a Hamiltonian with numerical methods?

Hamiltonian in terms of two level atom's operator (0 is ground state and 1 is excited state) which are 2*2 matrices and cavity modes are given by $a$ and $a^\dagger$. Rest of the parameters are ...
0
votes
0answers
42 views

Difficulty in replacing variables with list of variables for a function for FindMaximum application

FindMaximum gives incorrect answer when I redefine a function by changing its arguments from variables to a list of variables. The code goes as follows ...
0
votes
0answers
59 views

Another question about inverse Laplace transform

Given $r = 0.06;\quad \theta = 105;\quad \kappa = 1;\quad x_0 = 100;\quad K = 100;\quad \sigma = 0.10;\quad T = 0.25;$ Define $ \nu = -\kappa/\sigma^2 - 0.5;\quad p = \kappa*\theta/\sigma;\quad q = ...
0
votes
0answers
52 views

Solving a Volterra type (second) integral

I am trying to numerically solve this Volterra type integral equation. The equation I'm plugging in is a simplified version of We will take $H(\eta')$ and $q(\eta)$ to be 1 for now. $\mu$ is = ...
2
votes
2answers
91 views

How to find the integrand singularity points when having NIntegrate::slwcon:

In order to calculate the closed area of the curve below defined by parametric equation curve02, ...
3
votes
1answer
44 views
2
votes
1answer
90 views

Results of ArgMax as a function of a parameter with InterpolatingFunctions

I would like to obtain a function and its derivatives, where the function is defined as the solution to a maximization problem. The obvious approach ...
0
votes
0answers
41 views

EvaluationMonitor and variables with indices + subscripts

I have encountered the following problem while using EvaluationMonitor with NMinimize: variables that have both a subscript and an index, e.g. Subscript[x,y][1] do ...
27
votes
3answers
1k views

Funny behaviour when plotting a polynomial of high degree and large coefficients

I am trying to plot a polynomial of degree $29$ on the domain $[0,1]$, with fairly large coefficients: ...
2
votes
1answer
96 views

Funny behavior when computing dot product of coefficients with high-order polynomials

I have a similar problem to Funny behaviour when plotting a polynomial of high degree and large coefficients. However, the thing being evaluated is not just a polynomial but a dot product of some ...
12
votes
1answer
135 views

A weird issue with Interval[$MaxNumber]

From the Interval documentation: For approximate machine- or arbitrary-precision numbers x, Interval[x] yields an interval reflecting the uncertainty in x. ...
-1
votes
2answers
114 views

Numerical approximation using trapezoidal formula [closed]

I have bumped into a problem, that I cannot solve. I have to approximate the value of ln3 using a composite trapezoidal formula, so that the error should be within (10)^-3! How can it be solved?
20
votes
5answers
5k views

How can I differentiate numerically?

Mathematica has two ways to integrate: Integrate and NIntegrate. But what about D? ...
51
votes
3answers
4k views

Numerically solving Helmholtz equation in 2D for arbitrary shapes

I would like to solve the Helmholtz equation with dirichlet boundary conditions in 2 dimensions for an arbitrary shape. (for a qualitative comparison of the eigenstates to periodic orbits in the ...
9
votes
4answers
251 views

How to find the next root larger than a specified value, numerically?

I would want to have a general-purpose, reasonably robust method of finding the next numerical root above a specific value of x. I'm stumped by the fact ...
3
votes
1answer
149 views

Errors Solving Elliptic PDES with FEM

I am trying to solve the equation below governing transversely isotropic plane strain in cartesian coordinates with the given boundary conditions based on code found here using Mathematica 10.1 on OSX ...
4
votes
0answers
67 views

strange FullSimplify result, why zero? [duplicate]

This came up looking at this How to speed up calculation of this equation (FindRoot). Is there some sense to why FullSimplify gives zero here? ...
24
votes
1answer
671 views

How to work with Experimental`NumericalFunction?

This question is intimately connected with previous one: "How to create internally optimized expression for computing with high WorkingPrecision?" Oleksandr R. correctly states in the comment: A ...
0
votes
1answer
120 views

Solving a nonlinear systems of coupled differential equations with boundary conditions

I am trying to solve the following systems of coupled differential equations with boundary conditions (BC) at $0$ and at $∞$ : ...