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

Solve non-linear non homogeneous differential equation with python (Duffing oscillator)

I try to solve the Duffing equation using odeint: def func(z, t): q, p = z return [p, F*np.cos(OMEGA * t) + Fm*np.cos(3*OMEGA * t) + 2*gamma*omega*p - omega**2 * q - beta * q**3] OMEGA = 1.4 T = 1 / OMEGA F = 0.2 gamma = 0.1 omega =…
0
votes
1 answer

Numerical Integration in fortran with infinity as one of the limits

I am asked to normalize a probability distribution P=A(x^2)(e^-x) within 0 to infinity by finding the value for A. I know the algorithms to calculate the Numerical value of Integration, but how do I deal with one of the limits being Infinity.
0
votes
1 answer

Calculate arc length of piecewise cubic spline?

I would like to calculate the arc length of an already-interpolated piecewise cubic spline, where each segment is defined by a normal cubic polynomial ax^3 + bx^2 + cx + d. I am not sure, however, what the best route to take is. My first idea is to…
Gary Allen
  • 1,218
  • 1
  • 13
  • 28
0
votes
1 answer

solving differential equation using matlab

I have a question and just need you to tell me the steps I have to do. I have an equation with boundary conditions.the question is how can I find f(x)? I don't want to use the predefined Matlab.Please just show me the steps I need to solve this…
Bahram
  • 87
  • 1
  • 9
0
votes
3 answers

Problem with roots of a non-linear equation

I have a hyperbolic function and i need to find the 0 of it. I have tried various classical methods (bisection, newton and so on). Second derivatives are continuous but not accessible analytically, so i have to exclude methods using them. For the…
0
votes
0 answers

Double pendulum animation in python

I am using the following code to solve the system of differential equations numerically and then animate it: for i in range(steps-1): Theta1 = t1[i] Theta2 = t2[i] dTheta1 = w1[i] dTheta2 = w2[i] a1 =…
Souroy
  • 21
  • 2
0
votes
1 answer

How to set UMFPACK's tolerance

I am using umfpack in c++ to solve a sparse matrix. I am having trouble finding where the [UMFPACK PIVOT TOLERANCE] parameter is set. Would anybody know how to set this control parameter? My current code is umf::symbolic_type
Mikhail
  • 7,749
  • 11
  • 62
  • 136
0
votes
0 answers

Ode-system output gives null values in Matlab

I am trying to compute the numerical solution (over the interval [0,2]) for this system of differential equations using the Runga Katta (4th Order) Method and a step of my choice. % This is not just equations, not MATLAB code dy1/dt = 1.3 * (y2-y1)…
0
votes
2 answers

C function call Numerical Recipes Chapter 10.3

I have this function. I'm kinda green in C and I don't know how to call this function to get a result: float dbrent(float ax, float bx, float cx, float (*f)(float),float (*df)(float), float tol, float* xmin) { int iter, ok1, ok2; float a, b,…
0
votes
1 answer

Matlab optimization stopping criteria

I am trying to solve a system of 12 equations in Matlab. Because I have constraints on the minimum and maximum values of the variables I use lsqnonlin rather than fsolve. However, I would like the optimizer to stop once the output (sum of squared…
fes
  • 127
  • 4
0
votes
1 answer

Overflow and Invalid Values encountered in double scalars - Nonlinear PDE Solving

I am seeking to find a finite difference solution to the 1D Nonlinear PDE u_t = u_xx + u(u_x)^2 Code: import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm import math ''' We explore…
AlphaArgonian
  • 61
  • 1
  • 7
0
votes
1 answer

Multidimensional interpolation: return function

I have a 4 dimensional array. I can use interpn in Matlab to construct interpolated points between the array values. However, this command only returns the interpolated values at specified points. Is there a way to directly obtain a full function of…
fes
  • 127
  • 4
0
votes
1 answer

Euler Method Setting h Value

I am trying to implement euler method to solve differential equation y' = x^3 + y^2 between 0 and 2 with initial condition y(0) = 0.5. Firstly I set h = 0.1 and it's okey. y converges to 643,.... Secondly I set h = 0.01 and y diverges to the…
0
votes
0 answers

Difference between Eulers and Improved Eulers (Heun) in precision

I'm developing the code below to check the difference between Euler and Enhanced Euler methods for the function y'= y. In this case, I see that the more the iterations advance, the greater the difference between the values. Does anyone know why? def…
0
votes
1 answer

Plotting the results of a Newton-Raphson solution for multiple cases

Consider the following problem: I am now in the third part of this question. I wrote the vectorial loop equations (q=teta2, x=teta3 and y=teta4): fval(1,1) = r2*cos(q)+r3*cos(x)-r4*cos(y)-r1; fval(2,1) = r2*sin(q)+r3*sin(x)-r4*sin(y); I have these…