Most Popular
1500 questions
7
votes
1 answer
Non-hermitian discretizations in quantum mechanics
Consider the Schroedinger equation
$$\left(-\frac12\frac{\partial^2}{\partial x^2} + V(x) \right) \psi(x) = E \psi(x)$$
The usual way to solve it is to introduce a discretization of $\psi(x)$. This yields an eigenvalue problem which can be solved by…
davidhigh
- 3,127
- 14
- 15
7
votes
1 answer
Are there any drawbacks to using the Method of Manufactured Solutions for convergence testing?
Are there any drawbacks to using the Method of Manufactured Solutions for convergence testing and verification studies? I really can't think of any.
user27504
- 321
- 1
- 5
7
votes
3 answers
Evaluating an integral numerically at many points
Given a real function $f$, how can one efficiently evaluate $\int_0^{a_i}f(x)dx$ for millions of different $a_i$?
Applying a standard quadrature method (such as Simpson's rule or Gaussian quadrature) will incur an independent cost for each $a_i$,…
Museful
- 255
- 1
- 4
7
votes
3 answers
Finding the first N roots of transcendental equation
I need to find the first $n$ roots of the transcendental equation
\begin{equation}
F(k) = J_m'(kr)Y_m'(k)-J'_m(k)Y'_m(kr)
\end{equation}
for integer values of $m$ and any $r \in [0,1)$ where $J'$ and $Y'$ are derivatives of Bessel function of first…
Dipole
- 873
- 2
- 10
- 23
7
votes
2 answers
Efficiently finding all (x,y,z) points within certain distance of point P
I am using Python, and I have a Pandas dataframe with hundreds of thousands, if not millions, of $(x,y,z)$ coordinates. I am looking to find an efficient method to index the original dataframe so that I'm only left with entries that are within some…
Argon
- 213
- 2
- 4
7
votes
1 answer
How to directly compute the inverse of an ill-conditioned dense matrix
I know that it is generally a bad idea to compute the inverse matrix directly. However, if it is necessary to compute the inverse of an ill-conditioned invertible dense matrix, then what can I try?
For example, I know that scaling a matrix may…
nekketsuuu
- 173
- 1
- 7
7
votes
1 answer
Ways to speed up solving an LP with Google's ortools
I'm having an issue solving an LP of the form:
$$\min z = c^Tx$$
$$\text{s.t.}$$
$$Ax \geq b$$
$$x\geq p$$
$1 \leq a_{ij} \ll b_i$, $p \leq 0$, and $c \geq 0$
The specific problems I'm running into with the ortools GLOP solver are:
The LP takes an…
EDZ
- 171
- 4
7
votes
1 answer
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}| < \tau. \end{cases} $$
Clearly, $T_\tau(X)$ can be…
Richard Zhang
- 2,485
- 15
- 26
7
votes
2 answers
How to calculate/derive analytic FEM Newton Jacobian
I trying to wrap my head of derivation of the analytic FEM Jacobian
for the Newton method. Say we have a nonlinear Poisson problem of the
(weak) form
$$ \int a(u)\nabla\ u\cdot \nabla v = \int f v $$
where $a(u)$ is a coefficient. From the…
B Ring
- 73
- 4
7
votes
1 answer
What is a good definition of "accuracy to N digits"?
Let's say I have two numbers $x$ and $y$ which I'd like to compare to see whether they are equal up to their first $N$ digits.
For instance $ 1.002 \approx 1.001$ and $1002 \approx 1001$ up to 3 digits.
Intuitively, this means that the difference of…
user357269
- 363
- 1
- 8
7
votes
1 answer
finite difference : why should we solve linear equation at each step
I'm trying to simulate the growth of a brain tumor using a 3d reaction-diffusion model $ \partial_{t}u = \nabla.{(D\nabla{u}) } + ku.(1-u)$ , knowing the initial distribution of tumor $u^0$, the non-homogeneous diffusion coefficient $D$ and the…
david guez
- 159
- 8
7
votes
1 answer
Solving the Advection Equation with Forcing using the Discontinuous Galerkin Method
I've been learning about the Discontinous Galkerin Method by reading the book by Hesthaven and Warburton and have ran into a problem with the advection equation with forcing
$u_t + u_x = g(x,t)$
Following the book I've been able to implement a…
user3209427
- 407
- 3
- 10
7
votes
3 answers
analyze stability on a nonuniform grid
Assume you have a stability constraint between the space distance in time and space, for example, with an explicit Euler method for $u_t=u_{xx}$ we know $\tau\leq h^2/2$. That is, one can do stability analysis for a uniform grid, obtain a constraint…
Kamil
- 1,206
- 11
- 23
7
votes
1 answer
Stable computation of ratio of sums of large numbers
I have two sets of large positive numbers $a_1,\ldots,a_n$ and $b_1,\ldots,b_n$. By 'large' I mean of the order of $10^{10}$. I want to calculate the ratio $$R = \frac{a_1 - a_2 + \cdots +(-1)^{n+1}a_n}{b_1 - b_2 + \cdots +(-1)^{n+1}b_n}.$$ It is…
EpsilonDelta
- 183
- 3
7
votes
1 answer
How do I analyze the error for the Crank-Nicolson method on a parabolic PDE?
I would like to do the analysis for the Crank-Nicolson method on a non-uniform grid for the parabolic equation with variable coefficients. I was able to prove everything for a uniform grid by energy methods for the results of stability, where I have…
Kamil
- 1,206
- 11
- 23