# All Questions

825 questions
Filter by
Sorted by
Tagged with
453 views

### How to do FEM in sector elements?

Suppose we have an element in the polar coordinate as $0\leq r\leq 1$, $0\leq\theta\leq \alpha$. What are the correct basis functions in this element? For this kind of mesh, there are a lot of ...
612 views

### role of initial guess for iterative linear solver

Suppose we use a preconditioned iterative solver for a linear system. If the initial state for the solver can be chosen very close to the exact solution - does this reduce requirements for the ...
145 views

### Accurate evaluation of the sign of a polynomial

Let $p$ be a polynomial with floating-point coefficients and let $a$ be a floating-point value. Is there a method for accurately evaluating the sign of $p(a)$ in floating-point arithmetic? I don't ...
2k views

### PDE - Conservative form, conservative methods and discrete conservation

I cannot find a reference explaining clearly and rigorously the links between the notions of conservative form for a PDE, a conservative numerical method and discrete conservation. I would be very ...
1k views

### method of frozen coefficients and its relation to von Neumann stability analysis

I am considering two equations $$u_t=a(x)u_{xx}$$ and $$v_t=b(x)v_x$$ as classical representatives of the parabolic and hyperbolic family of equations. If $a(x)=a$ and $b(x)=b$ were constants, to show ...
471 views

### How to parallelize a banded direct solver?

I have a linear system whose matrix that is diagonally dominant, non-symmetric, but banded. Since the band-radius is 2 (producing only 5 variables per equation), a banded direct solver (gaussian ...
288 views

### adjoint method for reaction-diffusion problem

I'm trying to code a parameter estimation for a reaction-diffusion problem. Namely, knowing the distribution of tumor density $u$ at time $0$ and $T_f$ ($u^0$ and $u^f$), what are the best ...
2k views

### Is there a mesh generator that will generate zero thickness elements for interfaces?

I have a geometry and a finite element method where there are a couple internal interfaces across which I want to enforce some fairly simple jump conditions. One recommendation I've gotten has been ...
522 views

### Quality Measures for Various Pseudo-Random Number Generators

According to this paper, Ideally, a pseudorandom number generator would produce a stream of numbers that: are uniformly distributed, are uncorrelated, never repeats itself, ...
322 views

160 views

### Heisenberg Model python : Specific heat capacity for spin 2

I have the correct plot for specific heat capacity when I am using the formula which is $C_V$ = differentiation of entropy with respect to temperature. However, When I try to calculate $C_V$, by using ...
124 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}$ ...
3k views

### Introduction to Lattice Boltzmann methods [closed]

I am trying to learn the Lattice-Boltzmann method and was looking for some good beginner resources explaining the method. I have been looking at some codes online, but have been having trouble ...
180 views

2k views

I am dealing with a highly nonlinear system of two PDEs. I already have a code to solve the system in case of Dirichlet boundary conditions. The explicit system is: $$\begin{eqnarray*} \partial_{t}u ... 1answer 331 views ### For software submitted to ACM TOMS, how does the ACM software license agreement interact with other licenses? The journal Association for Computing Machinery Transactions on Mathematical Software (ACM TOMS) publishes many articles on numerical algorithms that include software implementations. According to ... 2answers 221 views ### How should I report profiling/timing information about my code? I've seen a lot of publications in Computational Physics journals use different metrics for the performance of their code. Especially for GPGPU code, there seems to be a great variety of timing ... 1answer 1k views ### Shortley-Weller finite difference method can you give me a link for a good and simple explanation of the Shortley-Weller finite-difference scheme? I tried to google it but all I get is (inaccessible) academic publications. I also tried ... 3answers 521 views ### C - OpenMP, MPI, Serial Program I'm part of a Computational Science course and come from a non-programming background, so please forgive me my ignorance. I'm working on a set of code in C to numerically solve the Navier Stokes ... 1answer 269 views ### How to avoid overflow error in program that computes product of two numbers, such that when one is big enough to cause overflow, other is 0? Let us say that I have a function like so: def f(x): return g(x)*h(x) Now, g(x) and ... 3answers 4k views ### How to find QR decomposition of a rectangular matrix in overdetermined linear system solution? While trying to find cell-centered gradients in finite volume method computation of incompressible fluid flow I get over-determined linear system. This is a well known "cell based least-square" ... 3answers 275 views ### Is there a minimum angle requirement for cells in the finite volume method? In his talk "What is a good linear finite element?", Shewchuk states that small dihedral angles in linear tetrahedra elements cause ill-conditioning of the stiffness matrix. Do small dihedral angles ... 2answers 489 views ### What does symmetrize mean? (imposing multifreedom constraints to stiffness matrix) I have a small FEM implementation program. And I want to add imposing multifreedom constraints (MFC) feature to it. The theory of master-slave method is given here (page 10 for general case). ... 3answers 3k views ### Discrete Poisson Equation with Pure Neumann Boundary Conditions I'm trying to implement the Helmholtz-Hodge Decomposition in 2D, which states that a vector field is composed by a rotational free component, a divergence free component and a harmonic component. ... 2answers 313 views ### Approximating and visualizing basins of attraction I am working on estimating the position and orientation (pose) of a model (rigid object) from its silhouette in an image. For this, I have constructed an error measure between the model in its pose ... 2answers 595 views ### Perturbation of Cholesky decomposition for matrix inversion I am looking for a computationally cheap way to compute x such that$$(L L^T + \mu^2 I)x = y$$where L \in \mathbb{R}^{n \times n} is a lower triangular definite positive matrix (with some very ... 1answer 227 views ### Fast algorithm for computing cofactor matrix I wonder if there is a fast algorithm, say (\mathcal O(n^3)) for computing the cofactor matrix (or conjugate matrix) of an N\times N square matrix. And yes, one could first compute its determinant ... 1answer 562 views ### LU Decomposition of PSD Matrix + Diagonal Matrix If I have a psd, symmetric matrix \mathbf{A} and I need to do LU decomps on \mathbf{B_i}= \mathbf{A} + \mathbf{D_i} (where \mathbf{D_i} is a diagonal psd matrix, where \mathbf{D_i} changes ... 1answer 335 views ### Interpolating a mathematical function using a Hermite Cubic Finite Element Space I have a Hermite Cubic Finite Element Space on a computer in the form of Matlab m-files. More specifically, I can evaluate four "shape functions" N_1, N_2, N_3, and N_4, for which the following ... 1answer 175 views ### Compute hypergeometric function ratio: \frac{_{2}F_{1}(a+1,b;c;x)}{_{2}F_{1}(a,b;c;x)}? I need a numerically stable way to compute the following ratio:$$\frac{_{2}F_{1}(a+1,b;c;x)}{_{2}F_{1}(a,b;c;x)}$$All the parameters are real numbers, with a< 0,\  b,c > 0 and 0<x&... 1answer 143 views ### Fast and free server for computing I have to calculate a huge differential equation. With my laptop, it's going to be computed for several days. Is there a free (I need just for 3 days) fast server for scientific calculations? My ... 1answer 2k views ### Partial trace algorithm (original) In general, is there a partial trace algorithm (ideally for systems of any size) that can be coded using basic matrix operations found in software like Mathematica or Maple? All of the methods I'm ... 1answer 92 views ### Linear programming boundedness Assume the optimal value of a primal problem is bounded. Is the following statement true? If the primal problem is bounded, then its dual problem is bounded as well. 0answers 211 views ### logsumexp with one very large term and many very small terms I want to compute an expression of the form:$$L = \ln\sum_i e^{x_i}$$Suppose that there are many small terms, say e^{x_i} \approx \epsilon. If there are N_\epsilon such terms, their ... 1answer 255 views ### non-smooth convex c++ solver I happened to know that there are advanced established techniques for non-smooth convex optimization in research. For example, these two papers: Nesterov, "Smooth minimization of non-smooth functions"... 1answer 5k views ### Why a finite difference scheme would give second order of accuracy in norm L2 but 1.5 with L1 (while 1 with Linf)? My finite difference scheme for the 2D Euler equations is second order accurate in theory, since all the terms are second order accurate, with the advective terms being third order. So I expect a rate ... 2answers 526 views ### DST using FFT routine Please can you help me with my problem? On Wikipedia, in article Discrete sine transform, this is written (chapter Computation): "Although the direct application of these formulas would require O(N2) ... 2answers 729 views ### NP-Completeness Consider an instance of non-convexoptimization problem: It seems that this problem is NP-complete. How can I find a suitable reduction for this? 1answer 212 views ### Finding zeroes of an infinitely differentiable function of ~100 to ~1000 variables I have a function that is not only infinitely differentiable, but it is also very cheap to calculate any of those derivatives. It looks like: f(\boldsymbol{C}, \boldsymbol{x})=\sum_{i} C_{i} \prod_{... 1answer 179 views ### How many operations are needed for LAPACK's zgesv to solve a linear system? I have a linear system of complex numbers. I am using LAPACK' zgesv (actually I am using intel MKL LAPACKE, but I am assuming the algorithm is the same). No assumption can be made about the system. I ... 2answers 386 views ### Get equation for a curve which intersects x at seemingly randomly distributed points? Is there any type of function that when graphed would show a curve which intersects the x axis multiple times, with each point being an arbitrary distance from the last? I mean, not like a trig ... 1answer 96 views ### MATLAB's ode45 not dealing with initial conditions well [RESOLVED] *Concern highlighted in yellow *Solution at bottom I have a differential equation to solve for the motion of an electron:$$ \frac{d^2v}{dt^2} = \frac{1}{\gamma^6}\left( \frac{eE}{\tau m} - \left( \...
Assumed I have the following two coupled equations $$\begin{split} \partial_tA&=a_0AB\\ \partial_tB&=b_0AB \end{split}$$ but I am not sure how to calculate them. One approach is a crank-...