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

learn more… | top users | synonyms (1)

0
votes
1answer
119 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
60 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
53 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
45 views
2
votes
1answer
92 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
43 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
136 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
117 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
261 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
154 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
68 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
705 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
126 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 $∞$ : ...
16
votes
4answers
621 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
222 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
539 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
259 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
149 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
72 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
56 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
39 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
104 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
692 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 ...
3
votes
2answers
156 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
62 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
74 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
74 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 ...
3
votes
1answer
69 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
254 views

Rotating an Interpolating Function

I have used the following code to generate eigenfunctions of a PDE: ...
9
votes
3answers
288 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) - ...
14
votes
1answer
285 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
120 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
94 views
24
votes
3answers
833 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
102 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
153 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: ...
4
votes
1answer
60 views

Computing the logarithmic spectral norm rapidly

I wish to compute the logarithmic spectral norm of a square matrix $A$, which is defined by \begin{equation} \mu_2[A]=\lim_{t\downarrow0}\frac{\|I+tA\|_2-1}{t}. \end{equation} Hence, I simply code ...
0
votes
0answers
31 views

How do I numerically integrate the result of NDSolve if it depends on several variables?

I am trying to numerically integrate solution of NDSolve. I am trying to integrate my result of NDsolve in line 97 of my notebook, but am getting the error ...
0
votes
0answers
75 views
0
votes
1answer
93 views
5
votes
1answer
233 views

Trouble with shooting method for a 4th-order stiff ODE

The ODE I need to solve is $$\left(y^3y^{\prime\prime\prime}\right)^\prime+\frac{5}{8}xy^\prime-\frac{1}{2}y+\frac{c}{y}=0$$ where $\prime$ denotes differentiation, $c$ is a constant and ...