Questions tagged [numerical-methods]

Algorithms which solve mathematical problems by means of numerical approximation (as opposed to symbolic computation).

Numerical methods include the study of algorithms that use numerical approximation (as opposed to general symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). Numerical methods naturally find applications in all fields of science and engineering, and include implementations of many important aspects of computation including: solving ordinary and partial differential equations, numerical linear algebra, stochastic differential equations, Markov chains, and so forth.

Numerical methods use several approaches to calculate observables. For example, iterative methods that form successive approximations that converge to the exact solution only in a limit. A convergence test, often involving the residual, is specified in order to decide when a sufficiently accurate solution has (hopefully) been found. Examples include Newton's method, the bisection method, and Jacobi iteration. Another example is the use of discretization, a procedure that is used when continuous problems must sometimes be replaced by a discrete problem whose solution is known to approximate that of the continuous problem.

The field of numerical methods includes many sub-disciplines. Some of the major ones are:

  • Computing values of functions

  • Interpolation, extrapolation, and regression

  • Solving equations and systems of equations

  • Solving eigenvalue or singular value problems

  • Optimization

  • Evaluating integrals

  • Differential equations

2104 questions
6
votes
1 answer

Is it a defect to center a simulation in [0.5, 0.5, 0.5] with a box size of 1?

I am a numerical physicist, and I've seen some simulation codes in my community which use a 3D simulation box with a center in [0.5, 0.5, 0.5] and a normalized length of 1 (so the box coordinates goes from 0. to 1.). In this box a lot of physical…
Vincent
  • 57,703
  • 61
  • 205
  • 388
6
votes
4 answers

Problem with arithmetic using logarithms to avoid numerical underflow (take 2)

I have two lists of fractions; say A = [ 1/212, 5/212, 3/212, ... ] and B = [ 4/143, 7/143, 2/143, ... ]. If we define A' = a[0] * a[1] * a[2] * ... and B' = b[0] * b[1] * b[2] * ... I want to calculate a normalised value of A' and B' ie…
mat kelcey
  • 3,077
  • 2
  • 30
  • 35
6
votes
1 answer

Comparing fsolve results in python and matlab

I have a follow up question to the post written a couple days ago, thank you for the previous feedback: Finding complex roots from set of non-linear equations in python I have gotten the set non-linear equations set up in python now so that fsolve…
6
votes
2 answers

Finding complex roots from set of non-linear equations in python

I have been testing an algorithm that has been published in literature that involves solving a set of 'm' non-linear equations in both Matlab and Python. The set of non-linear equations involves input variables that contain complex numbers, and…
6
votes
3 answers

positive semi-definite matrices and numerical stability?

i'm trying to do factor analysis for a co-occurrence matrix(C) , which is computed from the term-document matrix(TD) as follows: C=TD*TD' In theory C should be positive semi-definite , but it isn't and the factor analysis algorithm can't work with…
Alex Brooks
  • 5,133
  • 4
  • 21
  • 27
6
votes
4 answers

Using boost geometry to check if two lines have an intersection

Is it possible to use boost::geometry to check whether two line segments (each given by two points in 2D) intersect each other? If this is possible, does boost::geometry allow to check also for special cases such as that only one point is…
Thomas W.
  • 2,134
  • 2
  • 24
  • 46
6
votes
1 answer

Solving a differential equation in parallel, python

I am numerically solving a differential equation that depends on parameters. I am not really interested on the solutions but on their behaviour depending on the value of the parameters. Since I want a very precise description I must use a very fine…
6
votes
10 answers

Function approximation

I have a function, P(x0, x1, ..., xn) that takes 100 integers as input and gives as output an integer. P is a slow function to evaluate(it can range from 30 seconds to a couple of minutes). I need to know which values of points will maximize the…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
6
votes
4 answers

Trying to simulate a 1-dimensional wave

I'm trying to make a simplified simulation of a 1-dimensional wave with a chain of harmonic oscillators. The differential equation for the position x[i] of the i-th oscillator (assuming equilibrium at x[i]=0) turns out to be - according to…
Marco Disce
  • 234
  • 2
  • 13
6
votes
4 answers

sparse matrix library for C++

Is there any sparse matrix library that can do these: solve linear algebraic equations support operations like matrix-matrix/number multiplication/addition/subtraction,matrix transposition, get a row/column of a matrix,and so on matrix size could…
6
votes
2 answers

Sum or Product of Rationals with Spire (how to get a scala.Numeric)

I thought this should be straight forward: import spire.math.Rational val seq = Vector(Rational(1, 4), Rational(3, 4)) val sum = seq.sum // missing: scala.Numeric val prod = seq.product // missing: scala.Numeric I guess this is just a…
0__
  • 66,707
  • 21
  • 171
  • 266
6
votes
1 answer

Python - Scipy : ode module : issue enabling the step option of the solver

I wanted to store the different integration steps taken by the solver itself when I call it : solver1.integrate(t_end) So I did a while loop and enabled the step option setting its value to True: while solver1.successful() and solver1.t < t0+dt: …
kuider
  • 103
  • 5
6
votes
2 answers

Currying and multiple integrals

I am interested in learning an elegant way to use currying in a functional programming language to numerically evaluate multiple integrals. My language of choice is F#. If I want to integrate f(x,y,z)=8xyz on the region [0,1]x[0,1]x[0,1] I start by…
6
votes
1 answer

minimization in scipy, algorithm to find all local minima of a N dimensional scalar function

Does anybody know about a powerful routine/algorithm (preferrably in scipy/python) to localise "all" the local minima for a scalar real function of N variables in a defined ("rectangular") region of N-dimensional vector space ? the constrained and…
6
votes
4 answers

How to make topographic map from sparse sampling data?

I need to make a topographic map of a terrain for which I have only fairly sparse samples of (x, y, altitude) data. Obviously I can't make a completely accurate map, but I would like one that is in some sense "smooth". I need to quantify…
Norman Ramsey
  • 198,648
  • 61
  • 360
  • 533