Stack Exchange Network

Stack Exchange network consists of 174 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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

The tag has no usage guidance.

4
votes
1answer
29 views

Benchmark problems for eigenvalue reordering algorithms sought

Every real matrix $A$ can be reduce to real Schur form $T = U^T A U$ using an orthogonal similiary transform $U$. Here the matrix $T$ is quasi-triangular form with 1 by 1 or 2 by 2 blocks on the main ...
1
vote
1answer
100 views

Does a generic method for solving a system of PDEs exist?

There are generic methods for solving systems of ODEs numerically. Are there generic methods for PDEs? If so, what are they? If not, why not? To elaborate... Any set of ODEs can be written in ...
1
vote
0answers
25 views

What does the Jackson Kernel measure?

A certain filter I'm writing uses two different kernels. The Fejer kernel (which is common) and the Jackson kernel: $$ \Delta_T(x) = T \,\left( \frac{\sin \pi T x}{\pi T x}\right)^2 \quad\text{and}...
3
votes
1answer
75 views

How does fmincon in MATLAB calculate gradients?

I am trying to solve numerically a constrained optimisation problem in MATLAB, and I am wondering how the fmincon function calculates gradients when one isn't ...
5
votes
0answers
36 views

Cressman interpolation and objective analysis

I have read this question and answer – Interpolation of scattered data to a regular grid in python and I am doing something similar as I have temperature values of the atmosphere at different heights ...
2
votes
1answer
58 views

How can a CG solver solve a non positive definite sparse matrix

I am using the CUSP CG solver and I ran it on couple of sparse matrices from the University of Florida sparse matrix collection. The solver was able to solve non positive definite sparse matrices. My ...
2
votes
1answer
86 views

Solve 3-D Heat equation with Neumann boundaries

I want to solve the Poisson PDE for heat flow in a 3-D solid cube with given dimensions $x$, $y$, and $z$: $$\rho C\frac{\partial T}{\partial t} = k \Delta T$$ The cube is irradiated with a constant ...
1
vote
0answers
71 views

Basic approach for numerical solution of PDE

I'm looking for some guidance on how to write a program to numerically solve a PDE. As an example for comparison in 1D: $$\frac{d^2u}{dx^2} = f\;\;\;\;u(0) = 0\;\;\;\;u(1) = 0$$ We could try 6 ...
2
votes
1answer
48 views

Oscillation term in a posteriori error estimator

Assume that in the a (residual type) posteriori error estimator of some PDE is a term of the form $h_T\|g\|_{L^2(\Omega)}$ involved where $h_T$ is the diameter of an element and $g$ is some known data ...
1
vote
1answer
56 views

Numerical solution for eigenvectors and eigenvalues of a Sturm-Liouville problem

I have to deal with the following problem in my research: $$\left[\frac{1}{D}F_{x}\right]_{x} + \frac{f D_{x}}{c D^{2}}F = 0$$ with boundary conditions $$F(0) = 0$$ $$F_{x}(L) = 0$$ where $f$ is ...
5
votes
2answers
116 views

Methods for precise solution of an ODE whose solution terminates at a singularity

I'm working on a fun open-source project to calculate the trajectories of objects near black holes. This is obviously not the first time anyone has done this sort of thing, but I have some design ...
1
vote
0answers
70 views

Comparison between FEM and FDM methods for flow simulations

What are the main differences between finite element and finite difference approach for incompressible flow simulations? I have a vague idea about how FE methods rely on minimizing the residual over ...
6
votes
1answer
187 views

Is it possible to proof a-b+b = a for all double floating-point numbers?

I want to know whether the equation : a-b+b = a is always true for a, b belongs to double precision floating-point number and |a|>=|b|. If the equation is true, how can I proof it? If not, what ...
1
vote
0answers
48 views

Equal area algorithm to find shock location

I am looking to solve 1D burgers equation with various random initial conditions. What is the best algorithm to find the exact solution? One method that is covered in literature is the equal area ...
5
votes
0answers
42 views

Discrete sine and cosine transform for mixed derivatives

Using sine and cosine transforms to solve Poisson's equation with Dirichlet boundary conditions seem quite standard nowadays (see, e.g., here or Table 2 in this paper). In the case of Poisson's ...
0
votes
0answers
75 views

Using Gram-Schmidt to obtain Spherical Harmonics

If we don't know the Spherical Harmonics offhand, we could try to observe they are stratified by degree. So that $x^a y^b z^c$ will have degree $n = a+b+c$. These do not form an orthonormal basis, ...
2
votes
1answer
49 views

Von Neumann's stability analysis on non linear and coupled equations

I'd like to know if is possible to make a Von Neumann's stability analysis on an system of coupled equations, featuring quadratics: $$\begin{aligned} \frac{\partial u_1}{\partial t}&=D_1\Delta ...
1
vote
0answers
29 views

Computing Multivariate Cumulative Normal Distribution

I am trying to compute the CDF of a Multivariate Cumulative Normal Distribution in the 1000th dimension (I have a 1000 vectors and their covariance matrix). I haven't been able to find a fast way to ...
6
votes
2answers
69 views

What good are hard-sphere event-driven molecular dynamics simulations in the face of chaos?

Simple hard-sphere dynamical systems can exhibit chaotic dynamics. Due to finite-precision arithmetic when implemented on a computer, the presence of chaos implies that for a given set of initial data,...
1
vote
0answers
102 views

How to prevent BFGS from getting stuck on astronomically large gradient?

I have implemented BFGS myself from scratch in order to solve minimization problems. Part of BFGS, as I understand it, is that the approximation to the Hessian is supposed to be positive definite, ...
1
vote
1answer
61 views

Parallel integration of dynamical systems

I need to solve the following problem: $$ \begin{cases} \dot{\vec{x(t)}} = A\vec{x(t)} + u(t)D\vec{x(t)} + u(t)\vec{b}, & x \in (0, T), \\ \vec{x(0)} = \vec{0}, \end{cases}$$ where $u(t)$ is known ...
2
votes
0answers
56 views

Numerical solution to Time-dependent Schrodinger equation with time dependent hamiltonian

Currently I am facing the problem to solve numerically the following equation for a double well harmonic potential: $iℏ\frac{\partial}{\partial t}ψ(x,t)=−\frac{ℏ}{2m}\frac{\partial ^2}{∂x^2}ψ(x,t)+V(...
1
vote
0answers
89 views

Fixing catastrophic cancellation

I have been looking through the internet and this page quite some time, so if this might be similar to a solved question, please explain the similarity to me, as I could not see it myself. I am ...
0
votes
0answers
30 views

Numerically stable way to evaluate $\log{ \sum_i{e^{p_i}} }$ given $p_i$ [duplicate]

Typically the expression $\log{ \sum_i{e^{p_i}} }$ will have the same order of magnitude as the largest $p_i$, but numerically moderately large $p_i$ will result in overflow during floating-point ...
2
votes
0answers
47 views

2D reaction-diffusion system simulation

I am a complete beginner in numerical simulation and I am pretty lost about how to tackle this problem. I have been trying for some time to find the steady state (or simulate), the following system ...
0
votes
0answers
22 views

Time iteration no longer smooth after using scaled units

I have a time iteration function looked on a 2D surface like this. Since the numbers wee very small i.e. hbar=6.6260700404e-34./(2*pi), my professor told me to use our own "scaled unites" during the ...
1
vote
0answers
40 views

Global truncation error behavior at fixed time step

I am trying to solve the following diffusion equation problem: $\frac{\partial f}{\partial t}=\frac{\partial (D\frac{\partial f}{\partial x})}{\partial x}+S$ $D=1+x^{2}+\sin(x)$ $f(x,0)=1 , f(0,t)...
1
vote
2answers
200 views

Implementing no-flux boundary condition reaction-diffusion PDE

I'm having trouble figuring out how to implement boundary conditions for this problem: \begin{align} \frac{\partial n}{\partial t} &= D_n\nabla^2n - \nabla\cdot\left(\frac{\chi}{1+\alpha c}n\nabla ...
2
votes
1answer
42 views

Test on a set of high degree polynomials whose coefficients in {-1,0,1}

I'm looking for the best way of implementing the following algorithm: consider the set of all polynomials with a high degree (say, degree 30) whose coefficients ranges from a given set of values (say, ...
1
vote
0answers
51 views

Numerical analysis: Chebyshev coefficient representation error

If $x_k$ are the Chebyshev nodes, that is for $n \in \mathbb{N}^*$, we have $x_k = \cos(\pi \frac{2k + 1}{n})$. Now suppose you have approximated values of $x_k$ and $x_{k'}$ for $k,k' \leq n$. In the ...
1
vote
3answers
70 views

Discretization Error amplification instead of stagnation to machine precision

I wrote a code on Python 2.7.5 to solve numerically the following differential equation. $\frac{\partial^2f}{\partial x^2}=-S$ $S=\pi^{2}\sin(\pi x)$ S is chosen that way in order to have $f= \sin(\...
2
votes
0answers
76 views

Why would someone use empirical sum instead of numerical integration methods?

In the context of a scientific computing application, using data coming from (powerful) embedded systems, acquiring raw data (but from calibrated acquisition electronics), I have been asked to ...
1
vote
1answer
132 views

Applying Neumann boundaries to Crank-Nicolson solution in python

Consider the heat equation $$u_t = \kappa u_{xx}$$ with boundary conditions of $$u(x,0)=0\\ u(0,t)=100\\ u(l,t)=0$$ Numerical analysis by pyton can be done with ...
2
votes
1answer
75 views

Calculation of the EFIE integral

I need help computing the following integral: $$ \int_{}\frac{(1+jk|\vec{r}-\vec{r}^\prime|)e^{-jk|\vec{r}-\vec{r}^\prime|}}{|\vec{r}-\vec{r}^\prime|}d\vec{r}^\prime $$ in this integral $\vec{r}$ ...
3
votes
1answer
66 views

Numerical Lax-Wendroff scheme order of convergence on Burgers equation

I was suggested to move that question here. The question to be as follows. Statement of the problem Is it possible to achieve the second order of convergence (OOC) of Lax-Wendroff (LxW) scheme ...
1
vote
1answer
47 views

Problems with deriving an equation for a finite-difference scheme given in the journal paper

I'm reading this paper and trying to follow everything that the author has done. A Comparative Study of Finite Volume Method and Finite Difference Method for Convection-Diffusion Problem But there ...
3
votes
0answers
105 views

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 ...
1
vote
0answers
36 views

Apply flux-limiter to nonlinear hyperbolic equation

I am trying to solve the LWH traffic flow equation, which is a nonlinear hyperbolic equation $$\frac{\partial \rho}{\partial t}+\frac{\partial (v\rho)}{\partial x}=0,$$ where $$v=v_0(1-\frac{\rho}{...
1
vote
1answer
44 views

Defining dimensionless tempearture for Periodic flow systems

Given a flow inside a square duct with constant temperature at the walls $(T_{w1} = T_{w2} = T_w)$ the physical property in terms of temperature that repeats itself in a periodic fashion is the $\...
0
votes
1answer
90 views

Questions about iterative projection methods in Saad book

I am reading Chapter 5 of Saad's iterative methods book, and I don't understand section 5.2.1 about the two propositions of optimality results. In the statements of the propositions, what does it mean ...
4
votes
1answer
61 views

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 ...
1
vote
0answers
53 views

Stable Method of orthogonal projection onto a subspace with the help of Moore-Penrose inverse,

Projection of a vector $v$ onto the column space of a matrix $A$ is given by $AA^\dagger v$. From the definition of Moore-Penrose Inverse we know that $AA^\dagger v = (A^T)^\dagger A^T v $. Below is ...
3
votes
0answers
83 views

Stabilizing online average calculation

In Knuth, the following method for computing an average is presented: \begin{align*} M_{n} = M_{n-1} + (x_{n} - M_{n-1})/n \end{align*} (See here, if you don't have TAOCP.) Assuming the samples all ...
2
votes
1answer
65 views

Implementation details for high order IMEX methods by Kennedy and Carpenter

This question is a continuation of Fourth order IMEX Runge-Kutta method, concerning the implementation. Is seems to me that the first implicit stage value involves a direct evaluation, rather than ...
1
vote
0answers
63 views

Eigenvalue problem (LAPACK)

I am working on a project in numerical analysis which I have to program in C (using Lapack and Blas). Matrix is given which is tridiagonal and "almost" symmetric (one element is to be changed to make ...
3
votes
0answers
94 views

Convergence of Gauss quadrature for a discontinuous function

Is there a known error estimate for Gaussian quadrature when applied to a discontinuous function? For simple one-dimensional experiments, the error appears to be bounded by $C h$, where $C$ is some ...
0
votes
1answer
162 views

Crank–Nicolson method for nonlinear differential equation

I want to solve the following differential equation from a paper with the boundary condition: The paper used the Crank–Nicolson method for solving it. I think I understand the method after googling ...
3
votes
0answers
62 views

Backward stable algorithm to get orthogonal projection onto the column space of a matrix

I have to find the orthogonal projection of a vector $b$ onto the matrix $A$ of size $m \times n$. In my application, I don't have the luxury of calculating the QR factorization. All I have are ...
3
votes
1answer
184 views

Finite difference method basic implementation on Octave

Trying to study the error of FDM for a second order derivative versus step size I calculated the coefficients and validated them, but the output has errors for small step sizes. The function in ...
0
votes
2answers
101 views

Nédélec Elements and Newton-Methods

If you want to develop numerical algorithms for variational inequalities, you often choose a Semismooth Newton Method. In many cases, this approach involves derivatives of $\max$ or $\min$ functions ...