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

Improve discontinuity detection algorithm

I'm trying to create an algorithm that detects discontinuities (like vertical asymptotes) within functions between an interval for the purpose of plotting graphs without these discontinuous connecting lines. Also, I only want to evaluate within the…
C9C
  • 319
  • 3
  • 14
0
votes
1 answer

Recreating Blended Bisection and False Position algorithm from reference

I'm trying to recreate a blended bisection algorithm (Algorithm 3) from the website below (link takes you to exact section of the algorithm I'm referencing) https://www.mdpi.com/2227-7390/7/11/1118/htm#sec3-mathematics-07-01118 I'm not quite sure if…
C9C
  • 319
  • 3
  • 14
0
votes
1 answer

Implementing scipy.integrate.RK45 for SIR model

I looked at the documents for scipy.integrate.RK45, but I could not find good examples. I'm trying to implement the ODE for an infectious disease, with pre-defined parameters beta, f, gamma and initial values for the groups of population…
0
votes
1 answer

Compiling Numerical Integration Data into a LaTeX Table

So I have a single integral of one variable and I am hoping to collate the data into a LaTeX table but I keep getting the error: 'int': object is not iterable. from scipy.integrate import trapz tvals = [1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5] # fixed…
AlphaArgonian
  • 61
  • 1
  • 7
0
votes
0 answers

Numerical solutions of unsteady 2D heat equation in python producing error incorrectly

I am trying to implement two numerical solutions. A forward Euler and a second order Runge-Kutta for the unsteady 2D heat equation with periodic boundary conditions. I am using a 3 point central difference in both cases for the spatial…
0
votes
1 answer

Simultaneously find x for multiple function values

Problem Given a function f and a list of interested value [y1, y2, ..., yn], how do you do to find the list [x1, x2, ..., xn] such that f(xi)=yi for each i. I know there are many root finding algorithms and we can use any of those to find the root…
hychou
  • 572
  • 5
  • 15
0
votes
1 answer

does matlab filter funtion use all the data information

Please see sample code below for usage of filter function in Matlab. For truncated input, I expected to get exact result up to the truncate point, but there are tiny differences, although it is within double precision. Is this expected behavior? X =…
ahala
  • 4,683
  • 5
  • 27
  • 36
0
votes
1 answer

Alternative to scipy function

I need to find the root of a multidimentional function F(x), I'm using the scipy function scipy.optimization.root(...,method=''), which allows me to select different methods for the solution. However, for some problems it becomes slow and not…
0
votes
1 answer

Result error in implementation of trigonometric function by Newton Raphson method in PYTHON

trigonometric function by Newton method is giving wrong results def func(x): return radians(math.sin(x)+log(x)+1) def derivFunc(x): return radians((1/x) + math.cos(x)) #sin(x)+log(x)+1 --is the function i want to apply method on **#…
0
votes
1 answer

How to solve numerically a nonlinear ODE (a BVP) with singular points in python?

So, I have to solve numerically the following ODE y''+f(y)*(y')^2 = 0: ODE originally between [y_i,y_f] where y = y(t) and y(0) = y_i. The main problem is that the function f(y) has a (regular) singular point (couldn't post the image). Also, f(y) is…
0
votes
1 answer

not getting a result while performing secant method in Matlab

I am new in MATLAB and working on secant method of numerical computing course, But I am not getting result as I solved in my paper sheet. I am providing my code, Kindly tell me what I am missing in this code. function x =…
0
votes
1 answer

Why does my viscous wave equation blow up in the python simulation?

I am attempting to implement equation 16 from this paper: Equation 16 above is the viscous wave equation, and it is supposed to start big and die out over time, eventually approaching 0. However when I run my simulation it seems to blow up. If…
user1068636
  • 1,871
  • 7
  • 33
  • 57
0
votes
1 answer

“dumb” version of Euler’s method using Matlab

I tried to write the 'dumb' version of Euler's method using Matlab but I always came up with nothing. My code was trash :-( See this pseudocode for this method : ‘set integration range xi = 0 xf = 0 ‘initialize variables x = xi y = 1 ‘set step size…
iTurki
  • 16,292
  • 20
  • 87
  • 132
0
votes
1 answer

How to improve Levenberg-Marquardt's method for polynomial curve fitting?

Some weeks ago I started coding the Levenberg-Marquardt algorithm from scratch in Matlab. I'm interested in the polynomial fitting of the data but I haven't been able to achieve the level of accuracy I would like. I'm using a fifth order polynomial…
0
votes
1 answer

Minimize number of shops while reaching all customers

In this particular issue, I have an imaginary city divided into squares - basically a MxN grid of squares covering the city. M and N can be relatively big, so I have cases with more than 40,000 square cells overall. I have a number of customers Z…