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
0
votes
1 answer

Using Cubature in python

I am trying to calculate a seemingly simple integral. Here is the MMA code: In[1]:= rect[x_] = If[x <= 0.5, 1, 0]; In[2]:= N[Integrate[Integrate[rect[(x^2 + y^2)^.5], {x, 0, 100.}], {y, 0., 100.}]] Out[3]= 0.19635 However, when I do that with the…
MsTais
  • 189
  • 2
  • 9
0
votes
1 answer

How to calculate integral for very very small y values (SciPy quad)

Here is a probability density function of a lognormal distribution: from scipy.stats import lognorm def f(x): return lognorm.pdf(x, s=0.2, loc=0, scale=np.exp(10)) This function has very small y values (max ~ 1E-5) and distributes over x value…
0
votes
1 answer

How to integrate a set of two differential equations numerically in SageMath?

I am trying to solve the following two differential equation (numerically) in SageMath: My goal is to obtain the plot of M(r)-r. I tried the following code: sage: r = var('r') sage: M = function('M')(r) sage: a = function('a')(r) …
0
votes
0 answers

Where is the error in my below code for approximate solution of poisson boundary value problem?

I have to solve the following boundary value problem which is also it is defined in my Matlab code below, but my code doesn't work. I mean I didn't get the approximate solution of my system. I want to know where is the problem in my code or just…
0
votes
1 answer

I cant use long function in python

there I want to ask why I cant use long() function in python3.6.5? its say long is not defined and what should the function should I use? please anybody help me
0
votes
1 answer

How can I put this problem in a python for?

I am solving this problem in python that consist in to obtain the total volume of a tetrahedral mesh of a knight. This code that I wrote obtains the value of the volume but of the first tetrahedron of the mesh, the problem is that I do not know how…
0
votes
1 answer

Adaptive trapezoidal rule and clarifications on priority queue implementation

On the subject of adaptive trapezoidal subdivision (see this and this), I need to solve a problem where evaluating f(x) takes a lot of time, so I need to do it the least number of times possible. Searching on SO I found this answer:…
abenci
  • 8,422
  • 19
  • 69
  • 134
0
votes
0 answers

How to use the Thomas-Algorithm to the Heat-diffusion-equation correctly?

my text is structured in three parts: Part I) I give you some information about the context my principal questions refers to. Part II) I will tell you what I believe to know about the Thomas Algorithm. If I am wrong in any regards, correct me…
0
votes
0 answers

How can I accelerate convergence of a series using Aitken's delta-squared method?

I am working on an assignment that requires me to calculate the first 9 partial sums of the taylor series for ln(2), the equation for which is the sum: I have to use Aitken's delta-squared process to accelerate it, so that I can compare it to the…
0
votes
1 answer

NAN during numerical solution of poisson equation

I am solving Poisson Equation for heterostructure (AlGaN-GaN system specifically) using SOR method, in FORTRAN. For a specific initialization, the solver gives NAN as output and stops (as I have set the ffpe-trap flag), and for a different…
0
votes
1 answer

How does one compute the norm of a function in python?

I want to compute the functional norm of a function. My use case is the distance of two function but that is not as important as computing this in a correct manner in python. Looking at the docs I did: import numpy as np import scipy.integrate as…
Charlie Parker
  • 5,884
  • 57
  • 198
  • 323
0
votes
1 answer

Get opposite offset points from a root

With root-finding algorithms, you're usually just given the x value of the position of a root. I want to get the two closest points on either side of the root where these two points would have opposite signs considering that's where the roots exist…
C9C
  • 319
  • 3
  • 14
0
votes
3 answers

Incremental scaling function

If you know that 'input1' is strictly between 0 and 1 or generally, 'min' and 'max' (where min and max are known to be between, but not strictly, 0 and 1), how would you get 'input1'to increment or decrement by a numerical jump given by 'input2'…
0
votes
0 answers

4th Order Adams-Moulton Method C++

I am trying to solve an ODE using 4th Order Runge Kutta and the 4th Order Adams-Moulton Method. I iterate over a couple of thousand timesteps and it seems to hold fine when the values are constant(first 50 or so) However, the very first iteration…
0
votes
0 answers

Attempting to do verlet integration

I have tried adapting euler method code, and am using euler to calculate the first value so there are two for me to use in verlet but when i plot the graph i just get two perpendicular straight lines. this is the code: for t in t_array: if t ==…
Soph44
  • 1