Most Popular
1500 questions
8
votes
3 answers
Calculating partial trace of array in NumPy
A simulation I'm doing requires me to calculate the partial trace of a large density matrix. I am trying to calculate it using tools from numpy, but my code seems to be having some problems. For background, let me explain the arrays I am interested…
msm
- 201
- 1
- 1
- 2
8
votes
0 answers
What can be done with Finite Element Method and not with the Finite Volume Method, and vice versa?
What are some applications where you would absolutely go for either FEM, but not FVM, or vice versa? What are some applications where both methods are equally suited?
I worked with the FEM so far and have written various codes, but I sometimes…
Michael
- 1,463
- 11
- 22
8
votes
1 answer
Correct eigenfunctions of Laplace operator by Finite Differences
I am trying to compute the eigenfunctions of the Laplace operator, i.e. finding $u$ in
$$ -\nabla^2 u = \lambda u .$$
For now I am trying to do this in 1D, so
$$ \nabla^2 = \partial_{xx} .$$
I am using the finite difference method. My boundary…
islanss
- 147
- 7
8
votes
0 answers
Numerical implementation of the Dirichlet-to-Neumann map
I am solving the Dirichlet problem
$$
\begin{cases}
\Delta u = 0, \\
u|_{\partial D} = f,
\end{cases}
$$
in a $2d$ domain $D$ using the finite element method. What I want to get is the normal derivative of the solution $u$ on the boundary:…
Appliqué
- 445
- 3
- 10
8
votes
1 answer
What are the differences between the different gradient-based numerical optimization methods?
I am interested in the specific differences of the following methods:
The conjugate gradient method (CGM) is an algorithm for the numerical solution of particular systems of linear equations.
The nonlinear conjugate gradient method (NLCGM)…
Eduardo J. Sanchez
- 265
- 3
- 10
8
votes
7 answers
What is the difference between MATLAB and FORTRAN?
In our university some Ph.D students for computational methods prefer FORTRAN over MATLAB. I can't understand why? What is the difference between them when are used in computational methods like spectral methods, FEM or BEM? Please tell me which one…
MohammadSh
- 267
- 3
- 7
8
votes
2 answers
Compute powers close to zero
What is a simple way to compute $10^x - 1$, where $x$ is close to zero?
Using exponentiation and then subtraction isn't good enough, because the fractional part is very small compared to the one that we subtract away.
Tom V
- 83
- 2
8
votes
2 answers
Time discretization of the variational formulation of the Navier-Stokes equation
I've asked this question on mathoverflow too.
Let
$T>0$
$I:=(0,T]$
$d\in\mathbb N$
$\Lambda\subseteq\mathbb R^d$ be nonempty and open, $$\mathcal V:=\left\{\phi\in C_c^\infty(\Lambda,\mathbb R^d):\nabla\cdot\phi=0\right\}$$ and…
0xbadf00d
- 283
- 1
- 7
8
votes
6 answers
What algorithm for solving a set of stiff ODEs would be easiest to port to high precision floating point arithmetic?
I want to solve a relatively small system of stiff ODEs (< 10 first-order equations) using high precision floating point arithmetic (using MPFR or alike). What would be the easiest algorithm to implement/port? I'm not only interested in the…
GertVdE
- 6,179
- 1
- 21
- 36
8
votes
6 answers
Testing equality of two floats: Realistic example
When does it typically make sense in programming to be testing the equality of two floating point numbers?
i.e.
a == b
where both a & b are floats.
My naive impression is that one would always test the difference against some tolerance epsilon.…
curious_cat
- 259
- 2
- 6
8
votes
4 answers
Is there an in practice limit on the number of constraints on a linear programming problem?
I am new to linear programming and have formulated a linear program (LP) with order of $10^{13}$ variables and $10^{13}$ constraints, although the constraint matrix is extremely sparse.
I wanted to know if an LP of this scale is tractable or not?
stressed_geek
- 319
- 1
- 2
- 5
8
votes
3 answers
Power of complex-valued neural network
I often see neural networks extended to complex-values. Those networks allow complex input, complex parameters, and complex output. My understanding is that the inner products and point nonlinearities are simply extended. I can see it's advantage…
Memming
- 870
- 1
- 8
- 19
8
votes
1 answer
Solving two inverse problems with same solution
I've got two inverse problems,
$$A_1 ~ x = b_1 \qquad A_2 ~ x = b_2$$
So far I've been solving them independently using Tikhonov Regularization and getting two estimates for $x$. However in my case $x$ represents the same solution in both equations.…
abnowack
- 255
- 1
- 4
8
votes
1 answer
How to calculate the maximal ellipsoid in a given polyhedron
I am faced with the problem of finding the ellipsoid $B$ ($B$ is a symmetric positive definite matrix) of maximal volume within a convex set $C$ given as a set of linear inequalities $C=\{x| a_i^T x \leq b_i, i=1,\dots,m\}$.
I understood how it is…
Denis K.
- 81
- 2
8
votes
2 answers
How much does choice of OS matter for performance of scientific computing code?
It's common parlance to say that Linux is faster, and for good reasons. But as stated in the title, how much does choice of OS matter for performance of scientific computing code? For something things which the operating system is more directly…
Chris Rackauckas
- 12,320
- 1
- 42
- 68