Questions on the numerical functions of Mathematica, implementing numerical methods and numerical computing with Mathematica.
0
votes
1answer
190 views
Tabulating Numeric Approximation
I was wondering how to approximate or tabulate values for this numeric approximation: It is the following: The confusing part is how to implement the subscripts in mathematica.
$y_{i+1} = (t_i - ...
9
votes
2answers
1k views
Numerically obtaining the inverse Laplace transform of data
I have been using several Mathematica packages to do numerical inverse Laplace transforms on known (expressible in closed form) expressions, $\tilde{f}(s)$. I am now being confronted with the more ...
13
votes
3answers
1k views
Solving a Volterra integral equation numerically
I would like to solve for $P(t)$, in Mathematica, a Volterra integral equation of the 2nd kind.
It is:
$$P(t) = R_0(t) + \int_0^t P(t') R_0(t-t')dt'$$
I know the function $R_0$ and would ...
6
votes
2answers
362 views
Number of iterations in NSolve
In Excel's solver, one can define how many iterations are to be done, to one's liking.
I am wondering if this is possible to do with NSolve in Mathematica?
Code
...
26
votes
6answers
2k views
Finding real roots of negative numbers (for example, $\sqrt[3]{-8}$)
Say I want to quickly calculate $\sqrt[3]{-8}$, to which the most obvious solution is $-2$.
When I input $\sqrt[3]{-8}$ or Power[-8, 3^-1], Mathematica gives the ...
10
votes
4answers
680 views
Numerical underflow for a scaled error function
I calculate scaled error function defined as
f[x_] := Erfc[x]*Exp[x^2]
but it can not calculate f[30000.]. ...
10
votes
6answers
432 views
Annoying display truncation of numerical results
I have a lot of data to inspect. An example of a number in my program is
123.189094
This gets displayed as
123.189
...
6
votes
1answer
455 views
Handling failed FindRoot calls
I want to handle FindRoot calls which did not converge (e.g "thrown" error message FindRoot::cvmit)
...
14
votes
1answer
345 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 ...
9
votes
1answer
930 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. ...
11
votes
2answers
320 views
10
votes
1answer
278 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:
...
19
votes
2answers
466 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
222 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)
...
20
votes
1answer
457 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 ...
19
votes
2answers
1k 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}]
...
7
votes
2answers
299 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
516 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
360 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.
8
votes
1answer
880 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.
...
11
votes
1answer
926 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
305 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
229 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 ...
8
votes
1answer
233 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 ...
3
votes
1answer
375 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
336 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 ...
12
votes
3answers
486 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 ...
20
votes
4answers
539 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 ...
12
votes
1answer
326 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 ...
8
votes
1answer
491 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:
...
31
votes
7answers
878 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
879 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 ...
17
votes
1answer
252 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 ...
34
votes
10answers
971 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 ...
