We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [numerics]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
70 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 $\...
1
vote
1answer
111 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 ...
3
votes
1answer
77 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
61 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
84 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
121 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
87 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
152 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
504 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
75 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
424 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
138 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 ...
2
votes
0answers
147 views

What could be causing multi-dimensional numerical integration inconsistency?

I'm trying to numerically integrate a multi-dimensional expression. The integrand is complicated; for example this is the integrand for $N=4$: $$\begin{aligned}&x_1^6x_2^5x_3^3x_4^2(x_1-x_1x_2)(...
7
votes
1answer
139 views

Element-wise thresholding a low-rank matrix in O(n) time?

Define the element-wise thresholding operator $T_\tau(\cdot)$ with threshold $\tau$ as $$ [T_\tau(X)]_{i,j} = \begin{cases} X_{i,j} &\mbox{if } |X_{i,j}| \ge \tau, \\ 0 & \mbox{if } |X_{i,j}|...
1
vote
1answer
179 views

FFT Poisson Solver for non-uniform grid

I have a 3D solver for the incompressible Navier-Stokes equations which uses a FFT library for the Poisson equation with a uniform grid on all directions. In 2D the Poisson equation is given by: $$ ...
2
votes
3answers
262 views

Matrix vector multiplication performance

I have been learning about the impact of cache size on code performance. I wrote a small code to see how using a column major loop in MATLAB would be better than using a row major loop, since MATLAB ...
1
vote
0answers
84 views

(Approximate) Incremental Projection Method for Navier-Stokes equations

I am trying to implement an incremental projection method for the 2D incompressible Navier-Stokes. The type of projection method I am trying is $$ \frac{u^{*} - u^{n}}{dt} = - \nabla p^{n} - u \cdot ...
1
vote
1answer
519 views

Proper boundary conditions for potential flow around cylinder

I am computing the stationary, incompressible, inviscid and irrotational flow around a circular cylinder using a discretization in general coordinates. I derived a PDE and proper boundary conditions ...
3
votes
3answers
125 views

How to calculate $\arg(z_1z_2\cdots z_n)$ to minimize results error?

As in title, which method is the most optimal for numerical calculating value of: $\arg(z_1z_2\cdots z_n)$? Method 1: one can first calculate $Z=z_1z_2\cdots z_n$ and then calculate $\arg(Z)$. ...
4
votes
0answers
157 views

How to apply an integrated constrain condition in FEM?

I'm running some simulation using FEM. In my model I need to apply a constraint condition to the governing equation. My governing equation similar to the diffusion equation as below: $$\frac{\...
2
votes
0answers
102 views

What is Chebfun `eigs` doing

What is this doing? Looks like the original eigenvalue problem is converted into generalized eigenvalue problems with different dimensions of collocation points. Can someone explain more about this? ...
0
votes
1answer
80 views

How to treat non-linear term in finite difference solution of $T''_x+T''_y+aT^2=0$?

Can we linearize $T^2$ When solving $T''_x+T''_y+aT^2=0$ by finite difference? I solved $T''_x+T''_y=0$ in Matlab using a finite difference explicit scheme. But when there is a source term, I come ...
1
vote
1answer
138 views

Integrating over $\mathbb{R}^{3}$ without a convex subset

I am working on a problem (solid state physics, I am stripping all the details for brevity but if more details can help I'll elaborate) where I need to numerically calculate an integral of the form: $$...
2
votes
1answer
191 views

How to show that Gauss-Seidel iterative method is equivalent to successively setting each component of residual vector to zero?

As stated in the title, it's said in the book that Gauss-Seidel iterative method is equivalent to successively setting each component of residual vector to zero. After rearranging G-S scheme, I got ...
0
votes
3answers
261 views

Why there are people that still prefer fortran 77 over new versions?

I am reading some notes from a course in numerical analysis for physical sciences and it is my impression that there are still people that prefer Fortran 77 over new version due to the implicit ...
0
votes
1answer
93 views

Normalization of MATLAB HermiteH

I was wandering - what kind of normalization does Matlab use in hermiteH, its implementation of the Hermite polynomials? It is certainly not the case that they use ...
1
vote
0answers
276 views

Vectorised root finding in Python

I have an array of size (254, 80) which I am trying to use Scipy's fsolve on. I have found that the speed of using fsolve on a vector is quicker than it is in a for loop but only for vectors upto ...
1
vote
1answer
361 views

What is a relative condition number of a sum of positive values?

We want to compute the relative condition number of: $$x_1+x_2+x_3+\cdots$$ We assume all values are positive, and we will do a limit of a large $x_1=10^{8}$, and smaller values for all the other ...
1
vote
0answers
293 views

Newton - Raphson method : maxima of function in 2 variables

I am computing the maximum of a function (with two-variables) using Newton-Raphson method. The function is : $e^{-(x \ - x_0)^2 - (y \ - y_0)^2}$, whose maxima exists at $(x_0,y_0)$. The Jacobian ...
0
votes
1answer
290 views

Crank-Nicolson method and mixed derivatives

I am curious if anyone had literature references or knowledge on how to apply the Crank-Nicolson (with approximate factorization) to the $$ \nabla \cdot (\nu (\nabla \mathbf{u} + \left(\nabla \mathbf{...
8
votes
2answers
302 views

Lagrange multipliers space is too rich in a mathematical view

Background: Lagrange multiplier method has been employed in numerous fields, such as contact problems, material interfaces, phase transformation, stiff constraints or sliding along interfaces. It is ...
1
vote
0answers
188 views

the augmented global stiffness matrix is not positive semi-definite using Lagrange Multipliers method within FEM

The augmented global stiffness matrix is not positive semi-definite when using Lagrange Multipliers method to enforce boundary constraints on a simple square domain of integral form: I am considering ...
1
vote
1answer
73 views

finite difference for a second order ode

I saw in a code for discretization of something like $\frac{d^2T(x)}{d^2x}$ , ( $x = sin(\theta)$ ) tries ...
2
votes
2answers
133 views

How does Mathematica compute real and complex solutions to single, non-polynomial equations?

This question on StackOverflow has led me to ask myself what would be involved in solving an equation like this one using tools available to the Python programmer. $$ \frac{0.125567841}{d^{2.25}} = \...
3
votes
1answer
71 views

SIRS Model doesn't depend on initial conditions?

So i have been working (as an undergrad, by working i mean "Redoing a few things my professor does") in a SIRS model for epidemies. SIRS stands here for: Susceptible -> Infected -> Recovered -> ...
0
votes
1answer
131 views

Error measure for a simple finite difference scheme

I am responsible for assisting with certain error measurements for an FE program. The idea is to set up some benchmark comparisons which we can use for future development of the program. To simplify ...
1
vote
0answers
115 views

Definition of CFL number in Arbitrary Lagrangian-Eulerian framework

In an Eulerian frame of reference, the CFL number is defined as $$\sigma=\frac{u \Delta t}{\Delta x}$$ with $u$ the magnitude of the fluid velocity. A restriction such as $\sigma<1$ for time ...
3
votes
1answer
270 views

How to compute the Frobenius norm of matrices whose entries are either too large or too small?

While implementing in Matlab the Frobenius norm of a matrix $$\| A\|_{\text F} := \sqrt{ \sum_{i=1}^m \sum_{j=1}^n a_{ij}^2 },$$ a problem arises when numbers are too big or too small: If a number ...
3
votes
0answers
87 views

How to optimize for decay constant in exponential-like function?

I've got a data set of points $M_O .. M_N$ for time points $t_0 .. t_N$, where $N$ is approximately 10-20, and the spacing of time is not uniform (i.e., $t_{i+1}-t_i$ is not constant for all i). It is ...
3
votes
1answer
302 views

Numerical calculation sum of exponential functions

I have to repeatedly calculate a function which contains a sum of a large number (~100) of exponential terms: $f(x) = \sum_{r=1}^{100} C_r e^{b_r \cdot x}$ There is no relation between the $C_r$ ...
4
votes
1answer
278 views

Clenshaw-type recurrence for derivative of Chebyshev series

The naive summation of a Chebyshev series \begin{align*} f(x) = \frac{c_0}{2} + \sum_{k=1}^{n-1} c_{k}T_{k}(x) \end{align*} which employs the three-term recurrence for evaluation of the Chebyshev ...
0
votes
1answer
104 views

finding the growth rate from numerical data

Suppose i have a bunch of 10 data points and i have to conclude whether the increase is $n^2,n^3,\cdots,2^n,3^n, e^n,\cdots$. For example i have the image:- Now the increase is either polynomial or ...
1
vote
0answers
19 views

Does excitation type matter in a time-domain simulation/computation of a transfer function of an LTI system?

Let's say I am running a FDTD simulation of a wave-equation to determine a transfer function of an LTI system: \begin{equation} H(f) = \dfrac{Y(f)}{X(f)}\ \end{equation} where $Y(f)$ and $X(f)$ are ...
4
votes
1answer
126 views

Using GSL for basic operations

I am learning C/C++ for Scientific Computing and I have a question regarding the usage of scientific libraries for basic operations. Suppose I have to write a small program in C for a bioinformatics ...
4
votes
2answers
174 views

Literatures on numerical stability of optimisation algorithms

I am curious of whether optimisation algorithms (whatever simplex, active-set quadratic programming, interior point sequential etc.) can fail due to numerical errors and how to avoid them. But I ...
4
votes
1answer
124 views

Reference Request: Raviart Thomas with hanging nodes

I am interested in reading about the analysis (existence, uniqueness, error estimates) of elliptic problems solved with a Mixed method that uses the Raviart Thomas elements (so far so good, easy to ...
6
votes
3answers
2k views

Galerkin method: Test functions vs. Basis functions

I'm a novice to finite element and I'm finding quite hard to find the actual difference between Test function(s) and Basis function(s). I would be glad if somone could explain me that and point out ...
2
votes
1answer
101 views

interpolation 2D irregular nodes

Given a 2D irregular spaced data like shown in the figure, I would like to know how to find derivatives at '*' by interpolating the values at 'o'. Does lagrange 2D interpolation work at irregular ...
6
votes
1answer
315 views

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 ...