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

learn more… | top users | synonyms (1)

2
votes
1answer
66 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 ...
2
votes
1answer
118 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 ...
0
votes
0answers
45 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? <...
1
vote
3answers
91 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 ...
14
votes
2answers
294 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 ...
4
votes
1answer
350 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 ...
1
vote
1answer
60 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: ...
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
1answer
123 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
1answer
57 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
0answers
64 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
54 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
93 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
50 views

My NIntegrate expression returns a wildly inaccurate value

I am trying to integrate a function using NIntegrate: ...
12
votes
1answer
137 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?
9
votes
4answers
272 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 ...
1
vote
0answers
102 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: ...
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? ...
3
votes
1answer
157 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 ...
0
votes
1answer
132 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}(...
5
votes
2answers
151 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}$ ...
10
votes
2answers
268 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 ...
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
0answers
44 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 ...
3
votes
2answers
161 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 ...
0
votes
1answer
64 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]: <...
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
255 views

Rotating an Interpolating Function

I have used the following code to generate eigenfunctions of a PDE: ...
14
votes
1answer
304 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 ...
3
votes
0answers
100 views

Classification problem using SVM methods

I am running SVM on mathematica and I a used this code with classes: ...
2
votes
1answer
130 views

Basic 2D convolution with mathematica

Can anyone tell me why the following keeps burning my CPU without ever producing the desired plot? ...
24
votes
3answers
837 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
105 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
155 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
61 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
35 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
1answer
95 views

How to fit parameters, not functions?

Given a set of parameters ...
0
votes
0answers
80 views

Solving numerically a system of equations using different methods

I will use, as an example, the simple Henon-Heiles potential ...
1
vote
1answer
75 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$? ...
1
vote
1answer
45 views

Differential equation for a list with parameter dependent function

I am having a differential equation: y' = (1 - y) - f[y, mu] y; f is a hysteretic function that depends on y and on the derivative of y: ...
0
votes
1answer
71 views

Integrate over FindRoot solutions

I have a function of bivariate normal PDF and its marginals defined as ...
5
votes
1answer
260 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 $0<c\le1$....
0
votes
1answer
62 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: ...
2
votes
1answer
203 views

Maximized value of a function as an additional constraint on a variable

I want to maximize a function $f(b, h)$ with respect to its arguments and subject to some additional constraints. If these constraints are satisfied, $f$ is increasing in $h$. I then want to find an ...
3
votes
1answer
391 views

Wrong result of simple math calculation. Is it possibly a bug of the program? [closed]

I encounter the following issue accidentally (shown in the screenshot) which is very odd to me. The output[4] and [5] is obviously wrong. But with the input value of 991.91, it turns out to be right (...
5
votes
0answers
71 views

How does Plus work on machine precision Real arguments?

I thought Kahan's summation method would make a nice example for students to use to think about round-off error [W. Kahan, Pracniques: Further Remarks on Reducing Truncation Errors, Commun. ACM 8  (...
1
vote
1answer
110 views

How can I increase the precision of my computation?

How can I increase precision up to 15 digits for the results (EC, and that of FindRoot) computed below? ...
3
votes
3answers
139 views

Chopping matrix elements, real or imaginary

An undesired shape of a matrix has the following form: which is created by ...