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
0 answers

Iterating a Finite Difference Scheme in a 2-D Array with 3 Boundary Conditions

In an intermediary step to completing my undergraduate thesis, I'm attempting to solve the Black-Scholes PDE in R by an explicit finite difference scheme. As of now, I keep getting hung up on simultaneously iterating backwards in time (along the…
dunno
  • 205
  • 1
  • 5
6
votes
5 answers

Computing a matrix which transforms a quadrangle to another quadrangle in 2D

In the figure below the goal is to compute the homography matrix H which transforms the points a1 a2 a3 a4 to their counterparts b1 b2 b3 b4. That is: [b1 b2 b3 b4] = H * [a1 a2 a3 a4] What way would you suggest to be the best way to calculate…
6
votes
3 answers

Optimization to find complex number as input

I am wondering if there is a C/C++ library or Matlab code technique to determine real and complex numbers using a minimization solver. Here is a code snippet showing what I would like to do. For example, suppose that I know Utilde, but not x and U…
Nicholas Kinar
  • 1,440
  • 5
  • 24
  • 36
6
votes
1 answer

Algorithm of boost::math::erf

are there any details available for the algorithm behind the erf-function of boost? The documentation of the module is not very precise. All I found out is that several methods are mixed. For me it looks like variations of Abramowitz and…
Euphoriewelle
  • 63
  • 1
  • 4
5
votes
2 answers

Generic programming: Log FFT OR high-precision convolution (python)

I have a slightly unusual problem, but I am trying to avoid re-coding FFT. In general, I want to know this: If I have an algorithm that is implemented for type float, but it would work wherever a certain set of operations is defined (e.g. complex…
user
  • 7,123
  • 7
  • 48
  • 90
5
votes
1 answer

Numerical recipes / Multidimensional root search (using newt) : How to minimize the maximum error

This question is related to the "numerical recipes in C++" book, so it will be reserved to people knowing a little about it as well as about multidimensional optimization. I am writing a program that needs to search for a multidimensional root, and…
5
votes
0 answers

Problem while solving a minimal 1D Poisson-Nernst-Planck equation

I am trying to solve the Poisson-Nernst-Planck equation in Python with the library FiPy. It is basically a set of equations that describes - in my example - the separation of two ion concentrations in a solution with a potential gradient. Like…
Nadav
  • 51
  • 1
5
votes
1 answer

Bifurcation diagram of dynamical system

TL:DR How can one implement a bifurcation diagram of a seasonally forced epidemiological model such as SEIR (susceptible, exposed, infected, recovered) in Python? I already know how to implement the model itself and display a sampled time series…
Jared Frazier
  • 413
  • 1
  • 4
  • 10
5
votes
2 answers

How can this linear solver be linked within Mathematica?

Here is a good linear solver named GotoBLAS. It is available for download and runs on most computing platforms. My question is, is there an easy way to link this solver with the Mathematica kernel, so that we can call it like LinearSolve? One thing…
5
votes
1 answer

Deflation Method for Multiple Root Finding

I'm trying to implement the deflation method for finding multiple roots of a polynomial on Julia. In the deflation method, new functions are generated from the actual function divided by x - x_roots[i], and the root of new generated function must…
tugberk21
  • 53
  • 4
5
votes
1 answer

Norms in Python for floating point vs. Decimal (fixed-point)

Is it recommended to use Python's native floating point implementation, or its decimal implementation for use-cases where precision is important? I thought this question would be easy to answer: if accumulated error has significant implications,…
phoenixdown
  • 828
  • 1
  • 10
  • 16
5
votes
2 answers

Writing a function for the Implicit Runge-Kutta method (order four)

I am trying to compose a function that will solve a system of ODES using the implicit Runge-Kutta method (IRK) of order 4, but I am having trouble properly defining my loop. Here we define the IRK by Any advice would be greatly…
5
votes
6 answers

Can someone explain why scipy.integrate.quad gives different results for equally long ranges while integrating sin(X)?

I am trying to numerically integrate an arbitrary (known when I code) function in my program using numerical integration methods. I am using Python 2.5.2 along with SciPy's numerical integration package. In order to get a feel for it, i decided to…
batbrat
  • 5,155
  • 3
  • 32
  • 38
5
votes
1 answer

How to implement adaptive step size Runge-Kutta Cash-Karp?

Trying to implement an adaptive step size Runge-Kutta Cash-Karp but failing with this error: home/anaconda/lib/python3.6/site-packages/ipykernel_launcher.py:15: RuntimeWarning: divide by zero encountered in double_scalars from ipykernel import…
ZelelB
  • 1,836
  • 7
  • 45
  • 71
5
votes
7 answers

Approximating the square root of sum of two squares on a microcontroller

I'm working on implementing an FFT algorithm in assembly on an 8-bit microcontroller (HCS08) for fun. Once the algorithm is completed, I'll have an array of 8-bit real/imaginary pairs, and I'll want to find the magnitude of each of these values.…