Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [numerical-methods]

Questions on numerical analysis/numerical methods; methods for approximately solving various problems that often do not admit exact solutions.

12
votes
0answers
6k views

Simpson's Rule for Double Integrals

Simpson's Rule for double integrals: $$\int_a^b\int_c^df(x,y) \,dx \,dy$$ is given by $$S_{mn}=\frac{(b-a)(d-c)}{9mn} \sum_{i,j=0,0}^{m,n} W_{i+1,j+1} f(x_i,y_j) $$ where: $$W= \begin{pmatrix} 1&...
10
votes
0answers
1k views

Integral of rational function over $\mathbb{H}^4$

Suppose I have a rational function of $8$ coordinates $a,b,c,d,e,f,g,h$ that I want to integrate over $\mathbb{H}^4$: ...
9
votes
0answers
360 views

Why is backward Euler more stable?

I'm new to the idea of solving ODEs using the backward Euler. I have a system which I solve using the Backward Euler (actually backward Euler + Newton's method since I can't find a closed form ...
8
votes
0answers
153 views

Monotonic convergence of Newton's method for boundary value problems

I’m interested in solving nonlinear elliptic boundary value problems of the type $$ -a\Delta u + f\left(u\right) = 0, \\ u\big\vert_\Gamma = u_0 $$ by Newton’s method when its convergence is global ...
8
votes
0answers
394 views

Fixed point iteration to find root of Arctan

I am trying to find the root of $f(x)=\arctan(x)$ by using successive iteration. There are some conditions to apply this in successive iteration . 1) The function has to be continuous. 2) $\sup|f'(...
7
votes
0answers
91 views

Recommendation for intro to geometric integrators?

Explicit Request Looking for book or lecture note recommendations on numerical optimization that (ideally) have the following: Emphasis on geometric and physical intuition Emphasis on symplectic ...
7
votes
0answers
163 views

Manifold Galerkin method

Standard Galerkin method reduces the problem Find $u\in V$ such that $a(u,v) = f(v)$ for all $v \in V$, where $V$ is Hilbert space, $a$ is bilinear form and $f\in V^*$. to a finite ...
7
votes
0answers
139 views

What makes a geometric construction more or less stable?

As anyone who's actually done geometric construction of n-gons knows, not all construction methods are made equal. Some are very stable (the shape you get is always close to ideal even if you're not ...
7
votes
0answers
223 views

Tridiagonal matrix w/trigonometric eigenvalues

Let $n$ be a natural number and $B$ be the $n\times n$ square matrix of $0$'s and $1$'s $$ B=\begin{pmatrix} 0 & 1 & 0 & \ldots & 0 \\ 1 & 0 & 1 & \ldots & 0 \...
7
votes
0answers
145 views

Implementation of a simulation of an incompressible Newtonian fluid with uniform density

Let $d\in\left\{2,3\right\}$ and $\Omega\subseteq\mathbb R^d$ be a bounded domain. I want to simulate an incompressible Newtonian fluid with uniform density $\rho$ and viscosity $\nu$. The evolution ...
7
votes
0answers
258 views

Two Matlab ODE solvers, two different results

I am solving a system of ODEs using Matlab. One particular set of parameters caused the solver to fail, so I worked my way through the different solvers Matlab provides. I was surprised to find that ...
7
votes
0answers
212 views

Numerically solving a non-linear PDE by an ODE on the Fourier coefficients

I need to solve numerically a PDE of the form $$ u_t(x,t)=u_{xx}(x,t)+u_x(x,t)^2-a(x)u_x(x,t)-a_x(x) $$ with initial condition $u(x,0)=u_0(x)$. I can assume that both $u(\cdot,t)$ and $a(\cdot)$ are ...
7
votes
0answers
338 views

What’s the best way to cut an apple?

Take the apple in one hand, and the knife in the other. In the first cut, the apple is divided in two pieces: a small one that drops into the plate and a big one that is still hold with the hand. This ...
7
votes
0answers
774 views

Runge's phenomen: interpolation error using Chebyshev nodes oscillates

We're trying to approximate the Runge function $f(x) = \dfrac{1}{1+25x^2}$ using Chebyshev nodes. When calculating the interpolation error, using different degrees ranging from 0 to 50, we get the ...
7
votes
0answers
621 views

Simulating from a Multivariate Gaussian without Cholesky

I'd like to draw a sample from a multivariate Gaussian distribution $\mathcal{N}(\mu, \Sigma)$, where $\mu$ is the mean vector (can assume it to be $\boldsymbol{0}$), and $\Sigma$ is a sparse positive ...
6
votes
0answers
74 views

Numerically robust 2x2 determinant?

How can the determinant of a 2x2 matrix $$ \begin{vmatrix} a & b \\ c & d \end{vmatrix} = a d - b c $$ be computed in floating point without suffering unnecessary catastrophic cancellation? ...
6
votes
0answers
189 views

Obtaining a positive definite covariance matrix of order statistics

Suppose $X_1,\dots,X_n$ are independent samples from some distribution with known absolutely continuous CDF $F:\mathbb{R}\rightarrow[0,1]$. Let $X_{(1)},\dots,X_{(n)}$ denote the order statistics, i.e....
6
votes
0answers
98 views

A naive conjecture about Taylor series convergence

Conjecture. Let $f$ be a real (or complex) analytic function defined on some open subset $U$ of real (complex) numbers and assume that $p,q,x\in U$ are such that $x\in B(p,r_p)\cap B(q, r_q)$, where $...
6
votes
0answers
180 views
+100

Convergence of numerical methods for Viscous Burgers' Equation

For linear problems we can deduce convergence of numerical schemes by checking consistency and stability because of the Lax Equivalence Theorem. For conservation laws, we know that conservative, ...
6
votes
0answers
206 views

Numerical integration of $\int_0^{2\pi}\frac{dx}{3+\sin x}$

We know that numerical integration using end points is first order, trapezoid and mid-piont rules second order, and Simpson's rule fourth order. However, with $\int_0^{2\pi}\frac{dx}{3+\sin x}$, we ...
6
votes
0answers
251 views

Diophantine approximation with additional constraints

I am trying to compute best rational approximations to various transcendental numbers $c$, subject to the following constraints: $$\frac {i j} {2^k} = c + \epsilon, \space\space2^n \le i, j \lt 2^{n+1}...
6
votes
0answers
220 views

Invariant measure of Euler-Maruyama Discretisation of an Ito diffusion

Let $(X_t)_{t \geq 0}$ be a diffusion process with dynamics governed by the stochastic differential equation \begin{equation} dX_t = b(X_t)dt + \sigma(X_t)dW_t, ~~ X_0 = x_0, \end{equation} where $b,\...
6
votes
0answers
199 views

Solving numerically the equation of motion of D7 brane perturbation

I want to solve this equation $$ \partial_{\rho}^{2}\phi+\frac{3}{\rho}\partial_{\rho}\phi+\left(\frac{M^{2}}{(1+\rho^{2})^{2}}-\frac{l(l+2)}{\rho^{2}}\right)\phi=0 $$ numerically. I know that ...
6
votes
0answers
180 views

Shintani cone zeta function

Is there a procedure/algorithm for calculating sums of the form $$ \sum_{n_1,\ldots,n_r >0} \frac1{L_1(n_1,\ldots,n_r)^{m_1} \ldots L_r(n_1,\ldots,n_r)^{m_r}} $$ where $$ L_i(n_1,\ldots, n_r) :...
5
votes
0answers
54 views

How can I numerically compute a stochastic integral?

I am trying simulate a to solve a 2-dimensional stochastic process and $Y_t^1$ is a mean-reverting square root process which I simulated on a time grid using its known conditional distribution. I ...
5
votes
0answers
49 views

Efficient method to find $H$ given by $H(x)=\int_0^x f(x-u) f(x-au) e^u \, du$

Question Let $f:[0,\infty) \rightarrow [0,\infty)$ be some continuously differentiable function and $a \in (0,1)$ then we define the function $H:[0,\infty) \rightarrow [0,\infty)$ by letting: $$H(x)=\...
5
votes
0answers
49 views

error sensitivity analysis of Runge - Kutta method

In Runge - Kutta - Fehlberg methods, sometimes and in some cases the answer depends on the method we define the error and also on the magnitude of the error. In the case I am working on, there are ...
5
votes
0answers
503 views

Are there some Python implementations of the Schwarz Christoffel mapping?

I am interested in Python implementations of the Schwarz Christoffel mapping for simply and doubly connected polygonal domains. Well, I know that by now multiply connected domains can be dealt with, ...
5
votes
0answers
183 views

Equations with Chebyshev polynomials

For a natural number n, let $r(x)$ be the polynomial $$r(x)=\prod_{k=1}^n(x-2\sin(\frac{\pi k}{2n+1})).$$ Then $-xr(2x)r(-2x)$ is Chebyshev polynomial of the first kind with integer coefficients. ...
5
votes
0answers
171 views

Error in computing $\frac{e^x-1}{x}$ for $x$ near $0$.

My book says that if we want to compute $\frac{e^x-1}{x}$ for $x$ near $0$ the following algorithm is a bad idea: z1 = (exp(x) - 1)/x while the following one is ...
5
votes
0answers
139 views

Convergence of iteration scheme of solving matrix equations

Consider the equation $A\mathbf{x}=\mathbf{b}$. It is equivalent to $$S\mathbf{x}=(S-A)\mathbf{x}+\mathbf{b}$$ where $S$ is a splitting matrix. We now consider the iteration scheme $$S\mathbf{x}_{i+1}=...
5
votes
0answers
407 views

Approximating two-dimensional convolution

I am trying to use discrete 2d-convolution to estimate continuous double convolution. The convolution integral is $$g(x,y)=(f\ast h)(x,y) = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} f(u,v) h(...
5
votes
0answers
97 views

Efficient of Newton Polynomial Evaluation

The polynomial in Newton form having the coefficients $a_{0},a_{1},\ldots,a_{n}$ and centers $x_{1},x_{2},\ldots,x_{n}$ is the polynomial $$ p(x) = a_{0} + a_{1} (x-x_{1}) +a_{2} (x-x_{1})(x-x_{2}) + ...
5
votes
0answers
237 views

Jacobian of Stabilized Eikonal Equation $| \nabla u| = 1$

I am trying to implement a Finite Element Solution for the Stabilized Eikonal Equation : $$ |\nabla u| = 1 + \Gamma \Delta u, \quad \text{ where } \quad u = \text{ distance function }$$ $$ \text{...
5
votes
0answers
303 views

Did I correctly derive the scheme for this PDE using the Crank Nicolson Method?

I'm taking an Applied Numerical Methods course this semester, and I was given the following homework problem: Basically, before I begin writing any sort of code, I would like to ensure that I have ...
5
votes
0answers
996 views

Optimized way to compute L1 distance matrix

I'm computing distances between two groups of multi-dimensional points giving a matrix of distances pairwise between points. For the L2 (euclidean) distance I can use optimized matrix multiplication ...
5
votes
0answers
152 views

Are there high performance computing applications for symbolic integration?

Currently there are a number of applications for numerical integration in applied mathematics and physics. Many of these are integral transforms (often Fourier or Laplace), or solving definite ...
5
votes
0answers
491 views

What differential equation might model this almost-harmonic oscillator?

I need to precisely control the motion of a damped, driven (nearly) harmonic oscillator: $$ \ddot x(t) + \alpha\dot x(t) + \omega_0^2 x(t) \approx V(t) $$ I use the $\approx$ symbol because this is ...
5
votes
0answers
2k views

3d-diffusion equation in spherical coordinates (numerical), boundary problem

There is one boundary problem $$\frac{\partial u}{\partial t}= \operatorname{div}\left(a^2 E \nabla u\left(r,\varphi,\psi \right) \right) $$ in a ball $$ B_{1}(0)=\left\{x \in \mathbb{R^3}: \left\| ...
5
votes
0answers
235 views

How do zeros on the complex plane affect the real number line?

Let's say there is a real-valued "signal" that you can only measure at discrete points $f(x)$. You have a theory that this signal is the result of an analytic function $f(z)$ on the complex plane but, ...
5
votes
0answers
695 views

How can I solve the Poisson PDE efficiently and fast in cylindrical coordinates?

I am trying to numerically solve the Possion PDE in cylindrical coordinate system. $$\Delta f = {1 \over \rho} {\partial \over \partial \rho} \left(\rho {\partial f \over \partial \rho} \right) + {1 ...
5
votes
0answers
973 views

Approximating a function with a piecewise constant function

I have some distribution X of values (which I don't know exactly but I can sample many times). I also have a function $f : X \to Y$ which may be complicated. I want to approximate $f$ with a piecewise ...
4
votes
0answers
54 views

Gram-Schmidt: how close are resulting vectors to $0$?

Let $\{u_1,u_2,\ldots,u_n\}$ be the orthogonal (i.e., before the normalization) basis obtained from linearly independent vectors $\{v_1,v_2,\ldots,v_n\}$ by the Gram-Schmidt process, starting from $...
4
votes
0answers
91 views

Integral form of the conservation law $u_t+f(u)_x=0$

Consider the conservation law given by $$u_t+f(u)_x=0$$ We know that in general weak solutions are not smooth but are bounded in $L^{\infty}$ norm (they do not belong to Sobolev spaces). However ...
4
votes
0answers
57 views

Solve issue with Matlab 2018b version

I was very successfully solving an equation numerically in Matlab R2014a with the following code ...
4
votes
0answers
59 views

How can I solve this system of three PDEs?

I'm trying to solve this system of PDEs. $$\begin{cases}\dfrac AxG^2=\partial_x F-k\cos\theta\\\dfrac AxG(\partial_\theta G)=-\dfrac 1x\partial_\theta F-k\sin\theta\\h(\theta)=\displaystyle\frac1{x_0l}...
4
votes
0answers
60 views

From infinite dimensional function space to n-dimensional real space

I am an engineering student who works in the field of optimal control. Problems in this field are typically framed in infinite dimensional Sobolev space, $W^{k,p}(\Omega)$, as: \begin{equation} \...
4
votes
0answers
118 views

Stability criterion for leapfrog in relativistic physics.

I am doing a 2D MD simulations of charge carriers in graphene using the Leapfrog algorithm. I am trying to prove that, in some specific cases (when distance between particles is small), the method is ...
4
votes
0answers
73 views

$\int_{-\infty}^{\infty} (x+1)(x-1)e^{-(x+1)^2(x-1)^2}$

I am tring to solve the following integral: $$I=\int_{-\infty}^\infty(x+1)(x-1)e^{-(x+1)^2(x-1)^2}dx$$ So far I cannot think of a method for doing this other than numerically, And I have no proof that ...
4
votes
0answers
50 views

Explicit Euler method for Fokker-Planck equation

I'm trying to obtain an approximation of the solution of the following equation: $$ \left\lbrace \begin{array}{l,l} u_t = \alpha u_{xx} + (\beta u)_x, & u,\alpha ,\beta \in [T_0,T_f]\times [X_0,...