All Questions

Filter by
Sorted by
Tagged with
2
votes
1answer
2k views

Angular Velocity by Vector - 2D

This is originally a problem in programming, but since almost no one on Stackoverflow know how to solve this I went here instead; https://stackoverflow.com/questions/23003612/javascript-angular-...
1
vote
1answer
308 views

FEM on tet10 element: negetive determinant at the Gauss point

I am trying to implement a fem code on tet10 elements. I follow the lecture notes for tet10 implementation given in http://www.colorado.edu/engineering/CAS/courses.d/AFEM.d/AFEM.Ch10.d/AFEM.Ch10.pdf ...
1
vote
1answer
223 views

Calculate inverse of dense matrix with entries of very different magnitude

I need to calculate the inverse of a dense matrix, with some elements taking values as high as 1e9 and some around 1e2. What would be the best method to do it? Note: I am more concerned about the ...
0
votes
2answers
133 views

Adaptive numerical integration of a univariate vector integrand

Background & Problem formulation I'm trying to write a simple program in C++ that performs adaptive numerical integration of vector valued integrands (in one variable), i.e. $$\int_a^b \bar{f}(...
0
votes
0answers
1k views

Finite differences and Neumann boundary conditions

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 ...
11
votes
1answer
274 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 ...
8
votes
2answers
207 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 ...
8
votes
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 ...
7
votes
3answers
496 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 ...
7
votes
1answer
250 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 ...
6
votes
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" ...
5
votes
2answers
474 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). ...
5
votes
2answers
485 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 ...
5
votes
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. ...
5
votes
2answers
280 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 ...
4
votes
1answer
90 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.
4
votes
1answer
437 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 ...
4
votes
3answers
204 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 ...
4
votes
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 ...
4
votes
1answer
250 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 ...
4
votes
1answer
171 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&...
4
votes
1answer
130 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 ...
3
votes
1answer
129 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 ...
3
votes
2answers
718 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?
3
votes
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 ...
3
votes
1answer
245 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"...
3
votes
0answers
196 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 ...
3
votes
1answer
205 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_{...
3
votes
2answers
450 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) ...
3
votes
1answer
295 views

Finite Elements Weak Formulation generalization

I am struggling with an equation that represents the Weak form of Galerkin method: $ \phi^{T}F(\textbf{u})\sim \int_{\Omega}^{ } \phi.f_{0}(\mathit{u},\nabla \mathit{u}) + \nabla\phi:f_{1}(\mathit{u},...
3
votes
1answer
4k 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 ...
2
votes
1answer
1k views

4th order Runge-Kutta Method for Driven Damped Pendulum

Although I've been looking everywhere, I have been unable to find an answer to my question so here it is. For a driven damped pendulum the equation of motion in dimensionless units is, $$\alpha(\...
2
votes
1answer
485 views

Crank-Nicolson algorithm for coupled PDEs

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-...
2
votes
1answer
2k 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 ...
2
votes
2answers
342 views

In practice, what are the most useful ways to visualize 2d fluid flow, to tell what is happening in the simulation? Esp for verification and debugging

My simulation creates a 2d grid of vectors and scalars (EDIT of velocity, depth etc), at 60 frames per second. Is it correct? It looks sort of right... but who knows? How can I tell what's happening - ...
1
vote
1answer
270 views

How to formulate variance minimization as a mixed integer quadratic program

I have a mixed integer quadratic problem and my objective function is as follows $$\arg \min \operatorname{Var}(f(x),g(x)) + \operatorname{Var}(c(x),d(x)) + \cdots$$ where $f$, $g$, $c$ $d$ are ...
1
vote
0answers
165 views

Oscillating convergence in my Resilient BackPropagation (RPROP) implementation

I have implemented in matlab a neural network that uses rprop's algorithm to update its weights. Strangely the error on the training set does not converge to a local minimum, but oscillates. Here is ...
1
vote
1answer
90 views

Integrating a function and then plotting it's graph in Matlab

I've been working on this code for some hours and it seems I'm doing something wrong which I just can't figure out. I have a function which I integrate and then plot it's values. But the graph I get ...
1
vote
1answer
1k views

Paraview: Multiple csv files to time series

I have multiple CSV files with point-coordinates and, possibly, multiple data values attached to them, i.e., the rows look like x y z data1 data2 ... Is there ...
1
vote
4answers
3k views

Computing the Madelung constant

I am self teaching myself python and computational physics via Mark Newmans book Computational Physics the exercise is 2.9 of Computational Physics I have to compute the Madelung constant. . I have ...
1
vote
1answer
807 views

How can I call the Boost C++ odeint Runge-Kutta integrator for a system of ODEs?

I would like to use Boost C++ odeint Runge-Kutta integrator on a system that looks like this : $$\ddot x = - \frac A{||x||^3} * x $$ $ x $ is a vector in 3D space, so basicaly $ x(i, j, k) $ $ \...
0
votes
0answers
69 views

Analytic vs discrete understanding of PDE

The PDE I am working with: $$\partial_tu = \nabla \cdot (a(x)\nabla u)-\beta(x)u\\ \partial_nu=0, x \in \Omega \subset \mathbb{R}^2\\ \beta(x)>0$$ Integrate the PDE: $$\int_\Omega \partial_t u=\...
0
votes
1answer
78 views

Interpolation of function onto mesh gives different results, depending on mesh density

I wanted to test the numerical accuracy of my program. For that I wanted to interpolate the function $$f=I_0\exp\left(-100x^2\right)\exp(-100y^2)$$ onto a grid, defined on $$\Omega=[0,1]^2$$ by using ...
48
votes
3answers
31k views

What are the conceptual differences between the finite element and finite volume method?

There is an obvious difference between finite difference and the finite volume method (moving from point definition of the equations to integral averages over cells). But I find FEM and FVM to be very ...
54
votes
4answers
8k views

How mature is the “Julia” scientific computing language project?

I'm considering learning a new language to use for numerical/simulation modelling projects, as a (partial) replacement for the C++ and Python that I currently use. I came across Julia, which sounds ...
40
votes
4answers
1k views

Scientific standards for numerical errors

In my field of research the specification of experimental errors is commonly accepted and publications which fail to provide them are highly criticized. At the same time I often find that results of ...
35
votes
6answers
3k views

What attributes make a figure “professional-quality”?

I've heard people say that plots produced by ORIGIN tend to look polished and "professional," whereas plots produced by Mathematica do not. However, most plot-creation programs are quite configurable ...
35
votes
2answers
7k views

Mathematical Libraries for OpenCL?

I am looking for information from anyone that has tried to use OpenCL in their scientific code. Has anyone tried (recently) ViennaCL? If so, how does it compare to cusp? What about OCLTools? Does it ...
29
votes
7answers
6k views

Alternatives to Journal of Computational Physics

The Journal of Computational Physics has been an important outlet for computational science in the past, and I have published there before. For the benefit of those (like me) who have signed the ...
25
votes
3answers
19k views

BFGS vs. Conjugate Gradient Method

What considerations should I be making when choosing between BFGS and conjugate gradient for optimization? The function I am trying to fit with these variables are exponential functions; however, the ...

15 30 50 per page