Questions tagged [numerical-analysis]

Construction and analysis of algorithms to compute approximate discrete solutions of continuous problems. A canonical example is the approximation of derivatives via difference quotients.

Wikipedia article on numerical analysis

478 questions
10
votes
2 answers

About faster approximation of log(x)

I had written a code a while ago which attempted to calculate $log(x)$ without using library functions. Yesterday, I was reviewing the old code, and I tried to make it as fast as possible, (and correct). Here's my attempt so far: const double ee =…
sarker306
  • 213
  • 1
  • 8
8
votes
1 answer

How to check the correctness of my implementation of a numerical scheme for differential equation

I know the method of constructing solutions. For example I have a BVP: $$ u_{xx} + u = 0 $$ subjected to: $$ u_{x}(0) = f_1, $$ $$ u_{x}(1) = f_2 $$ If I want to check the correctness of my numerical implementation, just plug in $u(x) = \sin(x)$ and…
Sohail
  • 246
  • 1
  • 6
6
votes
1 answer

Computing flux of vector field numerically with regular grids

I would like to compute the flow rate (mL/s) of a pipe flow given the 3D velocity field $\mathbf{v} = (v_x, v_y, v_z)$ over the computational domain (a curved pipe). The field is represented in the form of a voxel grid with uniform sampling…
user44010
  • 207
  • 1
  • 2
6
votes
1 answer

Is there any point to using hypot() for $\sqrt{1+c^2}$, $0 \le c \le 1$ for real numbers

It is conventional wisdom that programmers should use std::hypot whenever one implements an expression of the form $r = \sqrt{x^2 + y^2}$ In my example, my expression is $r = \sqrt{1 + c^2}$, where $0 \le c \le 1, c \in \Re$. My first instinct is…
Damien
  • 802
  • 4
  • 10
6
votes
3 answers

Matrix representation of the radial Laplace operator isn't symmetric as supposed

I'm working with the cylindrical coordinates. I'm using the central difference to convert the radial part of Laplace operator into a matrix. $\nabla^2 u = \frac{\partial ^2u}{\partial r^2}+\frac{1}{r}\frac{\partial u}{\partial r}$ which in the…
user334106
  • 61
  • 1
5
votes
1 answer

What is lost in terms of approximation, when writing a problem in terms of a Differential Algebraic Equation (DAE) system rather than an ODE system?

It may be that we have a model where the following equation holds for some phenomenon: $$(1)\quad x + y + z = T$$ Importantly, $T$ is a constant, i.e.: $$(2) \quad \frac{\mathrm{d}T(t)}{\mathrm{d}t} = 0$$ We may be interested in the evolution of…
bzm3r
  • 669
  • 5
  • 21
5
votes
0 answers

Computing linear combinations of sines and cosines (phasors)

I have a finite series that looks like this: $f(t) = \sum^n_{i=0} A_i cos(\Theta_i + \omega_i t) + B_i sin(\Theta_i + \omega_i t)$ That is, a finite series of pairs of phasors. What's the state of the art for numerically calculating the value of the…
Jay Lemmon
  • 583
  • 3
  • 10
4
votes
1 answer

Function approximation: why does using increasingly higher order approximating polynomials not lead to convergent approximation schemes in general?

Given some equally spaced data for a function on an interval, we can use line segments (pictured below), quadratic functions, various cubic schemes, and increasingly higher order polynomials to approximate the function using this equally spaced…
bzm3r
  • 669
  • 5
  • 21
4
votes
2 answers

Gradient of a vector on a triangulated lattice

Suppose I have a triangulated mesh and I have solved a differential equation problem and have a solution phi. From phi I can construct a vector field, how would I go about computing the gradient of this vector field? The mesh looks something like…
wgwz
  • 350
  • 2
  • 10
4
votes
1 answer

Numerical gradient in spherical coordinates

Assume that we have a function $u$ defined in a ball in a discrete way: we know only the values of $u$ in the nodes $(i,j,k)$ of spherical grid, where $i$ is a radius coordinate, $j$ is a coordinate for angle $\varphi$, $k$ is a coordinate for angle…
cool
  • 491
  • 2
  • 15
4
votes
1 answer

Methods for solving BVP for DAE

I look for a numerical method to solve boundary value problems for systems of differential and algebraic equations of the form F(x,y,y') = 0, G(x,y) = 0, y(a) = ya, y(b) = yb, where y = (y1, y2, ... yn). I have to implement it myself, but I can't…
XDRM
  • 43
  • 4
4
votes
2 answers

Is there a method to examine numerical diffusion for non-linear PDE?

I have a nasty non-linear partial differential equation. I wonder if there exists a method that would allow me to examine what numerical errors (like numerical diffusion or dispersion) are introduced by different approximation schemes. Name of the…
Misery
  • 475
  • 3
  • 9
3
votes
1 answer

Fabry-Perot Interferometer with Frequency-Dependent Refractive Index

I am looking for assistance with calculating the fabry-perot standing modes in a resonator which has a non-static refractive index. For a resonator with perfectly reflective mirrors only the standing modes experience sustained population. For a…
speeze
  • 33
  • 3
2
votes
0 answers

How to compute the sum of a power series in a more robust way?

In order to compute the sum of a power series, we can use for loop, while loop or the analytic formula. I am wondering what is difference between those algorithms and how to improve the robustness of this question?
Willowbrook
  • 601
  • 3
  • 10
2
votes
0 answers

Meaning of a symbol in a research paper

The 2014 paper "Iteration-Free Computation of Gauss--Legendre Quadrature Nodes and Weights" by I. Bogaert (https://doi.org/10.1137/140954969) contains the following expression in Appendix A: What is the meaning of the "LL" here? It is not defined…
smh
  • 663
  • 3
  • 12
1
2