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

learn more… | top users | synonyms (1)

4
votes
3answers
308 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) ...
27
votes
1answer
803 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 ...
24
votes
3answers
4k 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}] ...
12
votes
2answers
576 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 ...
9
votes
2answers
974 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: ...
8
votes
1answer
519 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
2k 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
2k 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
476 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
289 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
329 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
689 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
563 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
782 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
905 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
461 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 ...
10
votes
1answer
1k 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: ...
39
votes
8answers
2k 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 ...
35
votes
1answer
2k 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
334 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 ...
37
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 ...
17
votes
2answers
235 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: ...