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

learn more… | top users | synonyms (1)

6
votes
1answer
601 views

Handling failed FindRoot calls

I want to handle FindRoot calls which did not converge (e.g "thrown" error message FindRoot::cvmit) ...
15
votes
1answer
442 views

Obtain approximate Hessian using FindMinimum

According to the documentation, when FindMinimum is told to use the method "QuasiNewton" on a unconstrained problem, it uses the ...
11
votes
1answer
1k views

What method does NDSolve use for solving PDEs?

What is NDSolve's mode of operation? I use it to solve partial differential equations and never gave it too much thought. Recently, I came across this question. ...
12
votes
2answers
344 views

Wrong computation with N

I was trying to solve this problem using Mathematica 8.04. I did this: ...
12
votes
1answer
464 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: ...
24
votes
2answers
783 views

Meaning of backtick in floating-point literal

If I compute, say, 1/3//N, Mathematica displays 0.333333 as the result. When I copy that output to use elsewhere, the paste ...
4
votes
3answers
276 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) ...
26
votes
1answer
738 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 ...
21
votes
2answers
3k views

Why round to even integers?

According to the Mathematica help: Round rounds numbers of the form x.5 toward the nearest even integer. For example: Round[{0.5, 1.5, 2.5, 3.5, 4.5}] ...
10
votes
2answers
513 views

Is it possible to use the LevenbergMarquardt algorithm for fitting a black-box residual function?

I have a black-box multiargument multiparametric function of the type SRD[dataPoint_List,params_List] which accepts experimental data along with the parameters of ...
8
votes
2answers
843 views

RootSearch for complex or multiple equations

First the background. I'm trying to solve for the roots of a rather messy complex equation. This is not the exact equation, but it's a decent (simpler) stand in: ...
7
votes
1answer
485 views

Is there any automatic differentiation package?

I'm wondering if an automatic differentiation package exists for Mathematica. This is what I mean by automatic differentiation.
11
votes
1answer
1k views

Kramers-Kronig in Mathematica

I am trying to calculate the change of the refractive index from the change of the absorption coefficient using the Kramers-Kronig relations, in Mathematica. ...
14
votes
1answer
1k views

Parallelizing Numerical Integration in Mathematica

I have an ugly, six dimensional function that I need to integrate numerically. It works, but it currently take twelve hours to complete the calculation. Is there any good way to parallelize the ...
7
votes
2answers
444 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) ...
4
votes
1answer
279 views

How to fix errors in Gram-Schmidt process when using random vectors?

I first make a function to get a random vector on unit sphere in a swath around the equator. That is what the parameter $\gamma$ controls; if $\gamma = 1/2$, the vectors can be chosen anywhere on the ...
11
votes
1answer
301 views

Why is MainEvaluate being used when LinearSolve can be compiled?

According to this question LinearSolve can be Compiled. However, CompilePrint shows a MainEvaluate but no-warning is generated. It appears that LinearSolve is not ...
4
votes
1answer
599 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 ...
7
votes
1answer
480 views

Using Mathematica to help to determine the consistency of and numerically solve systems of non-linear equations

The formal problem The question I am about to ask is applicable to many scientific and engineering problems. In short, I am bout to ask for pointers and practical advice for Mathematica beginners who ...
13
votes
3answers
695 views

Strategies to avoid LessEqual::nord in NMinimize?

When using NMinimize on functions with complex intermediate expressions (but a real end result), quite often one gets the error ...
23
votes
4answers
803 views

How to use NDSolve to track equilibrium?

I am looking for an extension of NDSolve where integration runs until certain variables are settled at an equilibrium. Now I have a working solution in my sleeves ...
13
votes
1answer
436 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 ...
9
votes
1answer
938 views

Combined numerical minimization and maximization

I want to numerically calculate the maximum of a function defined by the minimization of another function, like the following: ...
38
votes
7answers
1k 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 ...
33
votes
1answer
1k views

Adaptive sampling for slow to compute functions in 2D

EDIT: Although I have posted an answer based on my current progress, this in incomplete. Please see the "open issues" section in the answer. Most plotting functions in Mathematica adjust the ...
18
votes
1answer
312 views

Is there an NDSolve`ProcessEquations analog for NIntegrate?

NDSolve has an interface for repeatedly solving an equation with different initial conditions without having to analyze the equation and set up the solving algorithm each time. This can improve ...
36
votes
10answers
2k views

Can Mathematica propose an exact value based on an approximate one?

Sometimes, I use Mathematica to do some hypothesis on homeworks to make the question easier. For instance, when I have to compute big sums when $n\to\infty$ and Mathematica can't give the exact ...
14
votes
2answers
137 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: ...