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

learn more… | top users | synonyms (1)

0
votes
0answers
46 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? <...
4
votes
1answer
354 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
842 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
61 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
107 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
132 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
43 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
65 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
55 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
102 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
51 views
2
votes
1answer
99 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
45 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 ...
28
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
98 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
140 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
121 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?
23
votes
5answers
6k views

How can I differentiate numerically?

Mathematica has two ways to integrate: Integrate and NIntegrate. But what about D? ...
52
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
282 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
161 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
69 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
745 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
138 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 $∞$ : $y_{1}'(x)=\frac{-\sqrt{\frac{2}{\pi}}\,\frac{\alpha}{18}\,x^4+x\,y_{2}(...
16
votes
4answers
642 views

How to remove duplicates from set of machine precision 2D points?

I have a set of 2D points with machine precision coordinates. I need to remove all duplicates. Performance is important. This is the most obvious fast solution: ...
3
votes
1answer
244 views

Breaking out of NDSolve

I am solving a coupled set of differential equations with NDSolve for 6 unknown functions of time. At a certain point in time, the system hits a singular point ...
23
votes
2answers
557 views

Symbolic derivatives are being calculated numerically

Just found the following while debugging a problem. Mathematica is calculating the derivative of IntegerPart[x] in some odd way: ...
10
votes
2answers
281 views

What is the fastest way to compute digits of $\pi$ using Mathematica?

There are a lot of ways to calculate digits of $\pi$ using Mathematica. The most naïve way I can think of is N[π, 100000000] Of course, there are a lot of fast ...
5
votes
2answers
152 views

Evaluate numerically an extremely small number

How to evaluate numerically $e^{-4 \cdotp 10^{35}}$ in the form $0,a_1a_2...\times 10^{-n}$ ...
1
vote
1answer
76 views

Paramter Scans and $\chi^2$ Test in Mathematica

Is there any in-built function or a recommended package that enables one to find, say, 10 Parameters, which are used as boundary conditions in NDSolve, that minimize $\chi^2$? ...
0
votes
1answer
69 views

LinearSolve on non-square matrices?

I just came across a strange behaviour for LinearSolve (on Mathematica 8.0.0.0). Consider the following definitions: ...
0
votes
1answer
71 views

Integrate over FindRoot solutions

I have a function of bivariate normal PDF and its marginals defined as ...
1
vote
0answers
40 views

solving with numerical methods [closed]

Hi I would like to solve the equation below in Mathematica.Since I am a beginner I can not solve it with NSolve and Solve.I don't know why.Do you have any idea?! ...
0
votes
1answer
115 views

Precision of Eigensystem? [closed]

I was using Eigensystem to obtain the rotation matrix. However, I find out Mathematica does not fully diagonalize my matrix (or say not precise enough). My matrix ...
12
votes
7answers
741 views

Numerical evaluation of a sum

I am trying to compute numerically NSum[(-1)^n/n^3, {n, 1, Infinity}]. Of course, using first Sum would work here, but often it'...
3
votes
2answers
168 views

Plotting Planck's function and unexpected results

I have the code below. If you look at the plot, you can see a strange behaviour. The function goes to zero as λ->0 but you can see the plateau below ...
34
votes
0answers
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 ...
2
votes
0answers
73 views

Number recognition in Mathematica [duplicate]

Suppose that I have a number $n$ with many decimal digits of precision. What is the code to use to get Mathematica to recognize possible closed-form expressions for that number?
0
votes
1answer
65 views

Can't sort my list numerically for larger numbers than 10 e.g. 1,10,100,2 [duplicate]

I want my files names in real numerical order so 1,2,3,10,12. However it is currently putting them in order like so: 1,10,12,2,3 Input: ...
3
votes
0answers
75 views

Low accuracy while solving a multi-variable equation numerically

My question is as following: I was trying to make a function Vs2[r] with two parameters fit a set of conditions. Vs2[r]: <...
1
vote
1answer
76 views

Estimating error in NDSolve

I would like to give a theoretical estimation of local truncation error (and then for the global one) for a solution to a numerical initial value problem by NDSolve....
3
votes
1answer
75 views

Split Boundary Value Problems win Algebraic Equations

Is it possible at all to solve with NDSolve (or other built in function) a split boundary value problem with algebraic equations? Please look at the following example: ...
4
votes
2answers
258 views

Rotating an Interpolating Function

I have used the following code to generate eigenfunctions of a PDE: ...
9
votes
3answers
300 views

Labeling solutions of an Eigenvalue equation involving Bessel functions

I'm solving the Schrödinger equation for a particle in an annular geometry with hard wall boundary conditions and I've reduced it to the following equation: $$J_m(k\,R_1)\,Y_m(k\,R_2) - J_m(k\,R_2)\,...
14
votes
1answer
311 views

Non Standard Eigenfunction Plots of the Laplacian Over the Unit Square

I have recently been plotting eigenfunctions of the laplacian over the unit square using the NDEigensystem command. However, I have noticed something in the plots ...
2
votes
1answer
137 views

Basic 2D convolution with mathematica

Can anyone tell me why the following keeps burning my CPU without ever producing the desired plot? ...
3
votes
0answers
101 views
24
votes
3answers
839 views

Exponential fitting - isn't actually a BUG there?

There are many questions on this site about wrong exponential fitting in Mathematica but no one considers this well-known problem as a potential bug. Usually people suggest well-known workarounds ...
1
vote
0answers
113 views

Numerically Solving Helmholtz over the Rectangle - Why does this code only give eigenfunctions of the form $u_{m1}$ [closed]

I have been following the method for numerically solving the Helmholtz equation in this example (the answer by User21) and have come across two problems. I have been implementing the method for a 2x1 ...
3
votes
3answers
162 views

Smooth initial data

I need something that produce pseudorandom smooth initial data for modelling phase separation equations (Cahn-Hilliard and simular). Generator code for now: ...