Community Digest

Top new questions this week:

why is A*v+B*v faster than (A+B)*v?

$A$ and $B$ are $n \times n$ matrices and $v$ is a vector with $n$ elements. $Av$ has $\approx 2n^2$ flops and $A+B$ has $n^2$ flops. Following this logic, $(A+B)v$ should be faster than $Av+Bv$. ...

linear-algebra matlab matrix  
asked by Sam C. 30 votes
answered by Brian Borchers 57 votes

Example where autodiff works but symbolic differentiation will not?

According to the survey paper on autodiff (linked) Autodiff works on inputs that cannot be specified in closed form but can be described by a sequence of code, each component of which is ...

symbolic-computation automatic-differentiation differentiation  
asked by Lucas Roberts 12 votes
answered by Chris Rackauckas 8 votes

Computation of triple nested loops as a convolution product?

I'm trying to compute efficiently the following \begin{equation} A_j = \sum_{l'=1}^{\infty}\sum_{k= 0}^{K-1} L_{l'}T_ke^{2\pi i \frac{k}{K}j}\epsilon_{l',k} \end{equation} for $j = 0,1, \ldots, ...

fourier-transform fftw convolution  
asked by HansimGlück 4 votes
answered by Ian Bush 2 votes

Why the two Gram-Schmidt algorithms produce different results for qr factorization?

For the qr factorization using classic Gram-Schmidt algorithm, I found the 2 different implementations below. The first one uses the for loop to compute the upper triangular matrix R, but the second ...

matlab matrix-factorization qr-factorization gram-schmidt  
asked by sunshine 4 votes

Why the solid FEM problem can not be solved after constraining 3 degrees of freedom?

I write a simple MATLAB code for solving solid FEM problem. The problem looks like that (1) (2) x-------x | / | | / | | / | x-------x (3) (4) Each node has two degrees of ...

finite-element matlab solid-mechanics  
asked by Xu Hui 4 votes
answered by Bill Greene 5 votes

Memory Management - Why certain initializations order are faster?

#include <stdio.h> #include <stdlib.h> #include <sys/time.h> float timedifference_msec(struct timeval t0, struct timeval t1) { return (t1.tv_sec - t0.tv_sec) * 1000.0f + ...

c memory-management  
asked by TVSuchty 3 votes
answered by Anton Menshov 8 votes

Solving saddle point problem having non-invertible top-left block with a PETSc nested matrix

My system is a symmetric FE problem with lagrange multipliers: $Z=\begin{pmatrix}A & C^T \\ C & 0\end{pmatrix}$ The matrix $A$ is positive semi-definite, non-invertible. The whole matrix is ...

finite-element petsc preconditioning krylov-method saddlepoint  
asked by janou195 3 votes

Greatest hits from previous weeks:

How to code in Matlab: If an argument is empty, then default to "x" value?

I have a function with a number of arguments, but some of them are optional. 1.) If when the function is called, some are left empty, how do I code it so that it defaults to a specific value? 2.) ...

asked by AlanH 7 votes
answered by Nat Wilson 7 votes

Visualising Maxwell's equations using MATLAB

I asked this question to help me understand what is going on in one of Maxwell's equations. I am happy with following through the maths on paper now, but would like to use MATLAB to take it one step ...

matlab pde visualization plotting electromagnetism  
asked by Steve Hatcher 4 votes
answered by nicoguaro 10 votes

What kinds of problems lend themselves well to GPU computing?

So I've got a decent head for what problems I work with are best one in serial, and which can be managed in parallel. But right now, I don't have much of an idea of what's best handled by CPU-based ...

asked by Fomite 86 votes
answered by Max Hutchinson 64 votes

What is the purpose of the test function in Finite Element Analysis?

In the wave equation: $$c^2 \nabla \cdot \nabla u(x,t) - \frac{\partial^2 u(x,t)}{\partial t^2} = f(x,t)$$ Why do we first multiply by a test function $v(x,t)$ before integrating?

asked by Andy 13 votes

Limitations of Density Functional Theory as a computational method?

This question arises from the need I have to prepare a lesson on the limitations of Density Functional Theory as a computational approach. I would like to know not only the limitations, but also ...

asked by Stefano Borini 8 votes
answered by Dan 10 votes

Estimating the Courant number for the Navier-Stokes Equations under differing Reynolds number regimes

I am familiar with the Courant-Friedrich-Lewy Condition in as far as it applies to the stability of explicit finite difference schemes for standard parabolic and hyperbolic PDEs. However, when ...

fluid-dynamics stability  
asked by Paul 3 votes
answered by David Ketcheson 5 votes

Is there a high quality nonlinear programming solver for Python?

I have several challenging non-convex global optimization problems to solve. Currently I use MATLAB's Optimization Toolbox (specifically, fmincon() with algorithm='sqp'), which is quite effective. ...

python optimization nonlinear-programming  
asked by David Ketcheson 78 votes
answered by Aron Ahmadia 32 votes

Can you answer these questions?

Can Representation Theory be studied computationally / numerically?

Can a subfield such as the representation theory of Lie algebras be studied computationally / numerically -- is there an interplay between the abstract and the concrete? I would be grateful for an ...

linear-algebra reference-request  
asked by user33821 1 vote

evaluating $\coth(x) - 1/x$ for real x, on 2 "pieces"

The function $\coth(x) - 1/x$ has a removable singularity at 0. Its Taylor series is: $$ \coth(x) - 1/x = \frac{x}{3} - \frac{x^3}{45} + \frac{2x^5}{945} + \ldots $$ I would like to evaluate the ...

asked by Glenn Davis 2 votes

Hit-n-Run Monte Carlo on convex polytope

So, I'm currently trying to implement a MCMC to uniformly sampling hyper-points from the polytope defined as $\mathbb{K}=\{x\in\mathbb{R}^{n}\;\;\text{s.t.}\;\; A\,x=b \}$ in the specific case where, ...

linear-programming monte-carlo  
asked by Davide Papapicco 3 votes
You're receiving this message because you subscribed to the Computational Science community digest.
Unsubscribe from this community digest       Edit email settings       Leave feedback       Privacy
Stack Overflow

Stack Overflow, 110 William Street, 28th floor, New York, NY 10038