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 [numerics]

The tag has no usage guidance.

3
votes
1answer
104 views

Efficient computation of tangent of fraction of angle

I want to compute $a = \tan(f \theta)$ for $f\in [0,1]$, given $g = \tan\theta$. Obviously, I can compute $a = \tan(f\tan^{-1}g)$, but I'm wondering if there's a more efficient way that avoids having ...
4
votes
0answers
221 views

Negative viscosity stabilized by fourth order terms

I am trying to solve a "Navier-Stokes"-type problem where the viscosity is negative. Of course this renders the equation unstable and thus I add a fourth order term, so the entire equation becomes: $$...
1
vote
0answers
138 views

Numerically evaluate 1D inhomogeneous wave equation solution

I am trying to solve the following 1D inhomogeneous wave equation. Forgive me if I a miss any rigorous mathematical concept. $$ \frac{\partial^2 u}{\partial x^2} - \frac{1}{c^2}\frac{\partial^2 u}{\...
4
votes
1answer
188 views

How can exponential fitting be used with the finite element method?

Restricted to one dimensional problem, is it possible to dynamically adapt the finite element method (FEM) discretisation based on the local value of the Péclet number ($P_e$) for advection-diffusion ...
3
votes
1answer
88 views

numerical inaccuracy ellipsoid-ellipsoid collision

I am trying to implement ellipsoid-ellipsoid collision in my C++ code. Briefly this task can described as next: Let's assume that we have two arbitrarily oriented ellipses in the in space and this ...
4
votes
2answers
2k views

Does the finite element method impose any restrictions on the Peclet number for numerical stability?

Background on finite volume method When discretising the flux with a central difference stencil of the the advection-diffusion equation restriction $\frac{ah}{d} < 2$ must be observed for the ...
1
vote
1answer
1k views

Implicit heat diffusion with kinetic reactions

I am using the implicit finite difference method to discretize the 1-D transient heat diffusion equation for solid spherical and cylindrical shapes: $$ \frac{1}{\alpha}\frac{\partial T}{\partial t} = ...
8
votes
5answers
759 views

Is Discrete Exterior Calculus currently a focusing point in numerial computing world or simulation in industry,

I am just wondering if Discrete Exterior Calculus, as a new numerical method , is good at numericall solving problems in elasticity, fluids or other physical/real area.
5
votes
1answer
369 views

When is discrete Fourier transform a good approximation to the continuous one?

I am looking for help in understanding the use of discrete Fourier transform as an approximation to continuous Fourier transforms. As an exercise, I considered a Gaussian $$f(x) = \exp\left(-2x^2\...
0
votes
1answer
135 views

Simulating the motion of a elastic body under gravity [closed]

I am doing a numerical simulation of a elasticity problem. It is very simple. A cuboid elastic body with the right end fixed on the wall, under the gravity(but here I set it to be 1 along the z-axis ...
0
votes
1answer
465 views

Are these coefficients correctly calculated?

I'm solving a problem (page 16 is in English) in numerical analysis and this is the solution: ...
6
votes
2answers
183 views

Continuation procedure to solve for a 2D curve that satisfies f(x,y) = 0

I have some function of $R^2$, that must be numerically computed. For instance, I might be interested in a real-valued contour integral that begins from (x,y) = 0. $$ f(x,y) = \Re\left[\int_0^{x + iy}...
7
votes
3answers
537 views

A problem in 1D linear finite element method

When applying Galerkin method, we have two conventions, i.e. multiply the test function $v$ at left/right, $(v,u)/(u,v)$. Both ways won't matter for a simple problem like Poisson's equation, since the ...
6
votes
3answers
926 views

Significance of p-convergence studies

Consider a method (e.g., FEM) with variable approximation order $p$. Now, we know that the optimal order of convergence is given by $$e = C h^{p+1},$$ where $h$ denotes the mesh size and a constant $C$...
5
votes
2answers
949 views

Examples of numerical solution of stochastic differential equation(SDE)?

I want to simulate a nonlinear stochastic differential equation $$ {\rm d}X_t = f(X_t) {\rm d}t + g(X_t){\rm d}B_t $$ where $f,g \in C^{\infty}({\mathbb R}^n ,{\mathbb R})$ and $B_t$ is one-...
15
votes
2answers
2k views

Is it possible to solve nonlinear PDEs without using Newton-Raphson iteration?

I am trying to understand some results and would appreciate some general comments on tackling nonlinear problems. Fisher's equation (a nonlinear reaction-diffusion PDE), $$ u_t = du_{xx} + \beta u ...
10
votes
2answers
409 views

Numerical method for equation solving that works on stochastically computed functions

There are many well known numerical methods for solving equations of the type $$ f(x) = 0, \quad x \in \mathbb{R}^n,$$ e.g. bisection method, Newton's method, etc. In my application $f(x)$ is ...
4
votes
1answer
2k views

Analytic solution 2D scalar wave equation in cylindrical coordinates numerical implementation

I am trying to compare my finite difference's solution of the scalar (or simple acoustic) wave equation with an analytic solution. For that purpose I am using the following analytic solution ...
7
votes
2answers
609 views

Evaluation of Vandermonde matrix

I would like to construct a Finite Element basis by using a generalized Vandermonde matrix. The idea is to compute the values of a suitable modal basis ('prime basis') at a set of points in reference ...
2
votes
0answers
116 views

Lapack++ for QR algorithm

I have recently started using Lapack++ which I found convenient for my programming purpose, in general. Now, I need to solve a matrix using QR algorithm. I've searched the user manual and I found a ...
5
votes
2answers
486 views

Solving PDE with spatial and temporal derivatives on left hand side

I wish to solve an equation of the form, $$ \frac{\partial}{\partial t} \left( \frac{\partial \phi}{\partial x} \right) = -\frac{\partial}{\partial x}(\mathcal{F}) $$ for the variable $\phi$ (e.g. ...
6
votes
2answers
709 views

Need an example of convection-dominated problem to test on FreeFEM++

Can you all give me (at least) one example about convection-dominated problem in order that I can test it (them) on FreeFEM++. If possible, please give me specific examples (it/they contain(s) full ...
2
votes
1answer
72 views

Can you give me a detailed description of (spetral) deferred correction method?

I have just read "Accelerating the convergence of spectral deferred correction methods". The link is here: http://www.unc.edu/~junjia/papers/sdcgmres.pdf‎. But I wonder how to understand deferred ...
5
votes
1answer
172 views

Stabilization of solution to one-dimensional system of PDE

I am trying to solve numerically next PDE system: $$\frac{\partial c}{\partial t}=\epsilon\frac{\partial}{\partial x}(\frac{\partial c}{\partial x}+\rho\frac{\partial \varphi}{\partial x}+\frac{vc}{1-...
16
votes
1answer
807 views

How do you debug numerical code, what could be source of this oscillatory error?

Quiet a lot of insight can be gained form experience, I was just wondering if anybody has seen something similar to this before. The plot shows the initial condition (green) for the advection-...
3
votes
1answer
232 views

Finite volume with cell averages vs cell totals for conservation equations

What implementation details need to change if I use a cell average approach rather than a cell total approach for the finite-volume method? For example, consider the conservation law, $$ u_t + \...
39
votes
3answers
3k views

What's the state of the art in parallel ODE methods?

I'm currently looking into parallel methods for ODE integration. There is a lot of new and old literature out there describing a wide range of approaches, but I haven't found any recent surveys or ...
4
votes
1answer
212 views

Multivariate numerical integration with a non-uniform grid

I want to approximate the integral: $$ I = \int f(\boldsymbol{x})d\boldsymbol{x} $$ where $\boldsymbol{x}$ is $d$-dimensional. I have a set of non-equally spaced points $\boldsymbol{x}_1, \dots, \...
14
votes
1answer
9k views

How should boundary conditions be applied when using finite-volume method?

Following from my previous question I am trying to apply boundary conditions to this non-uniform finite volume mesh, I would like to apply a Robin type boundary condition to the l.h.s. of the domain (...
1
vote
0answers
206 views

Block Backward Differentiation Formula (BBDF), on order 4 formula

I am trying to implement a program the numerical method to solve ODE called Block BDF as explained in this article: https://waset.org/journals/waset/v38/v38-49.pdf As it is variable step-size, I need ...
3
votes
1answer
175 views

Is using Monte Carlo method a good approach for solving Boltzmann equation?

I'm trying to solve for electron and hole distribution function using Boltzmann equation with various scattering mechanisms. Since I land up with an integro-differential equation, analytical solution ...
6
votes
1answer
390 views

ENO-WENO Schemes: Are ENO-WENO schemes non oscillatory for all kinds (linear/non linear) of problems?

Is there an rigorous proof of ENO-WENO schemes being non oscillatory?
11
votes
3answers
1k views

How should non-constant coefficients be treated with finite-volume first order upwind scheme?

Starting with the advection equation in conservation form. $$ u_t = (a(x)u)_x $$ where $a(x)$ is a velocity which depend on space, and $u$ is a concentration of a species which is conserved. ...
14
votes
4answers
903 views

Optimal ODE method for fixed number of RHS evaluations

In practice, the runtime of numerically solving an IVP $$ \dot{x}(t) = f(t, x(t)) \quad \text{ for } t \in [t_0, t_1] $$ $$ x(t_0) = x_0 $$ is often dominated by the duration of evaluating the right-...
12
votes
2answers
330 views

Oscillations in singularly perturbed reaction-diffusion problems with finite elements

When FEM-discretizing and solving a reaction-diffusion problem, e.g., $$ - \varepsilon \Delta u + u = 1 \text{ on } \Omega\\ u = 0 \text{ on } \partial\Omega $$ with $0 < \varepsilon \ll 1$ (...
5
votes
1answer
1k views

Integration of an indefinite integral: matlab precision problem

The integral I need to evaluate is: $$ \int_x^{\infty} \frac{t^n}{e^{t} -1} dt $$ After some research I found a paper saying, The numerical values of the two integrals [...] are easily calculated ...
4
votes
1answer
162 views

Why do I get “estimated error” -1.#IND when doing BICGSTAB linear solver using ILUT perconditioner in eigen

I'm using Eigen (a C++ library for numerical linear algebra) to solve a linear equation with the the bi-conjugate gradient BICGSTAB algorithm with Incomplete LU preconditioner. However, the result <...
4
votes
1answer
470 views

Solving Coupled ODE eigenvalue problem

I've been trying to find some resources that would help me figure out how to numerically solve a coupled system of ODEs which is also an eigenvalue problem. The system is something like: $ \tag{1} ...
5
votes
1answer
170 views

Local truncation error and transformation of coordinates

I am given the advection equation $$ u_t=u_x $$ and then the transformation of coordinates $$ x=x(\xi,\theta), \qquad t=\theta $$ which leads us to the transformed equation $$ x_{\xi} u_{\theta} - u_{\...
3
votes
1answer
236 views

Closed form for singular values of 2D Laplacian?

Does anyone know where to find an analytic form for the singular values of the finite-difference approximation to the 2D Laplacian, expressed in matrix form for a square grid? This would be for the ...
8
votes
2answers
260 views

Astoundingly large difference when evaulating trigonometric identity with NumPy

According to Wolfram Alpha and the Sage computer algebra system, the following identity holds: $$ \cos\left(\arctan\left(\frac{l_1-l_2}{d}\right)\right) = \frac{1}{\sqrt{1 + \frac{(l_1-l_2)^2}{d^2}}} $...
10
votes
4answers
601 views

Relevance of fixed-point and arbitrary precision computations

I see very few non-floating point computing libraries/packages around. Given the various inaccuracies of floating point representation, the question arises why there aren't at least some fields where ...
2
votes
0answers
106 views

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 ...
5
votes
2answers
177 views

Imposing invertibility on a Matrix

I have a symmetric positive semidefinite covariance matrix $A$, which is approximately computed as the output of a quadratic regression. I then need to invert $A$, but often it is close to singular. I'...
10
votes
3answers
462 views

Regression testing of chaotic numerical models

When we have a numerical model that represents a real physical system, and that exhibits chaos (e.g. fluid dynamics models, climate models), how can we know that the model is performing as it should? ...
4
votes
1answer
97 views

Bounded Variation Spaces

Could someone explain me (roughly) the interest of Bounded Variation (BV) Spaces for PDEs ? Is there any numerical application of those space to real problems or is it just a theoretic way to ...
6
votes
1answer
157 views

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 ...
17
votes
1answer
306 views

Catastrophic cancellation in logsum

I'm trying to implement the following function in double-precision floating point with low relative error: $$\mathrm{logsum}(x,y) = \log(\exp(x) + \exp(y))$$ This is used extensively in statistical ...
40
votes
4answers
1k views

Scientific standards for numerical errors

In my field of research the specification of experimental errors is commonly accepted and publications which fail to provide them are highly criticized. At the same time I often find that results of ...
13
votes
2answers
1k views

Alternatives to von neumann stability analysis for finite difference methods

I'm working on solving the coupled one-dimensional poroelasticity equations (biot's model), given as: $$-(\lambda+ 2\mu) \frac{\partial^2 u}{\partial x^2} + \frac{\partial p}{\partial x} = 0$$ $$\...