All Questions

Filter by
Sorted by
Tagged with
4
votes
1answer
178 views

Using PAPI in PETSc code

I am trying to count the number of cache misses, total cycles, etc. per iteration of a for loop inside MatMult_SeqSBAIJ_2() . I'...
2
votes
2answers
211 views

Re-scaling array of floats so that all items are approximately integer

I have an array of floating point values $F$. I want to input my array into an algorithm that only takes integer values. How can I efficiently determine the smallest multiplier $m$ such that all ...
11
votes
2answers
524 views

Numerical method for equation solving that works on stochastically computed functions

There are many well known numerical methods for solving equations of the type $$ f(x) = 0, \quad x \in \mathbb{R}^n,$$ e.g. bisection method, Newton's method, etc. In my application $f(x)$ is ...
3
votes
1answer
76 views

a posteriori error estimation for skewed elements

I'm working with error estimates for Poisson's equation of the form $$\mathcal{E}^2_T = h_T^2\|-\Delta u - f\|_{L^2(T)} + \sum_{e\in \partial T} h_e\|n\cdot \nabla u\|_{L^2(e)}$$ where $T$ is an ...
4
votes
1answer
259 views

Multigrid stops converging when more grid levels are used

I'm having a problem with multigrid code I wrote. If I solve Laplace's equation in 2D and use more than 5 grid levels, the V-cycles stop converging after a few cycles (see below, convergence factor > ...
2
votes
1answer
915 views

Partial derivatives of a 3D array in Matlab

I'm interested in taking some partial derivatives of a 3 dimensional array in Matlab - say $A(i,j,k)$ approximates $f(x_i,y_j,z_k)$. I need to approximate things like $\partial_{xy}f$, $\partial_{yz}...
5
votes
1answer
3k views

Stability of numerical method for 1D Burger's equation

I am trying to solve 1D viscous Burger's equation numerically and I cannot apply von Neumann analysis because the equation is non-linear. How do I predict the stability criteria for my system? I also ...
2
votes
2answers
542 views

About Subspace Iteration for Eigenvalues

I heard that subspace iteration plus Ritz acceleration could improve the performance a lot for solving clustered eigenvalues, for the eigenvalues and eigenvectors could converge linearly with ratio $\...
2
votes
1answer
129 views

combine $n$ vectors using $L2-normalization$

Suppose that I have the following vectors $v_1$, $v_2$, $v_3$ $\in R^n$,$n= 9$. What I want to do exactly is to combine these $3$ vectors into $1$ representative vector $V$. According to the ...
14
votes
1answer
887 views

Scientific computing with Python with modern GPUs with double precision

Has anyone here used double precision scientific computing with new generation (e.g. K20) GPUs through Python? I know that this technology is rapidly evolving, but what is the best way to do this ...
1
vote
0answers
209 views

Characteristic length of differential element of cylinder surface?

I am trying to find the Nusselt number for a small element of the outside of a cylinder that has a height of $\Delta z$. I found the average Grashof number of a surface as $$Gr_{L}=\frac{\beta \rho (...
11
votes
2answers
10k views

How do I plot the surface of a 4D plot?

I am trying to plot the wave function for a particle in a 3D box. This requires me to plot 4 variables: x, y, z axes and the probability density function. The probability density function is: ...
3
votes
1answer
4k views

How to change the dimensions of an Eigen Matrix in a loop?

I have a while loop, in which I use a Matrix A, vectors B and x with varying dimensions: <...
2
votes
2answers
176 views

Why the same program runs faster on an older computer?

I have the same single thread problem, which is something like a simple ...
4
votes
1answer
580 views

My algorithm for the heat equation is unstable

I have implemented the 2D heat equation with what I thought was the Crank-Nicolson algorithm in the following way: ...
3
votes
4answers
412 views

Looking for analytic solutions to time dependent fluid flow problems

I'm looking for analytic solutions to time dependent fluid flow problems (can be compressible or incompressible, Euler or Navier-Stokes equations). The main thing though is that I'd like there to be '...
2
votes
2answers
161 views

How to impose a constant constraint PDE

What is the best way to impose a "constant constraint" for a PDE? Specifically, I want to solve an eigenvalue problem $Au=\lambda u$ on the rectangle $(0,2\pi)\times(-\pi/2,\pi/2)$ with periodicity ...
3
votes
1answer
682 views

Generalized eigenvalue problem using ARPACK

Is it possible to solve the eigenvalue problem: $$Ax = \lambda Mx$$ using ARPACK when $A$ and $M$ are both non-symmetric complex matrices? According to this documentation, the function ...
3
votes
2answers
150 views

Calculating the trace of $A^+B$

For a computational representation theory program, I have to calculate the trace of $A^+B$ for a fixed $A$ and many different $B$, where $A^+$ is the pseudoinverse of $A$ ($A,B$ have full column rank ...
5
votes
1answer
411 views

The Lax-Milgram Lemma in FEM with non-homogenous Dirichlet BC

How can show that the prerequisites for the Lax-Milgram Lemma holds if I have different test and trial spaces (which I think is the natural thing to have if at least part of the boundary is non-...
4
votes
1answer
1k views

Finite difference method (diffusion equation) for 3D spherical case

There is one 3D-diffusion IBVP for sphere (Dirichlet problem with zero conditions on the surface of sphere). The equation has the following view: $$\frac{\partial u}{\partial t}=\operatorname{div}\...
7
votes
1answer
2k views

Solving for null space of a matrix with mkl LAPACK

I want to find a solution for $xA=0$, where $A$ is a square matrix. I know that most of the LAPACK routines solve for $Ax=b$. So I take $A^T$ as a, and set $b=0$. I have an additional restriction of $\...
6
votes
3answers
6k views

Visualizing finite element solutions in MATLAB

On my triangular mesh, I have the $(x,y,z)$ coordinates of each vertex of each triangle. For higher order elements, I refine each element a few times so I have more points to work with. If I just need ...
6
votes
5answers
473 views

Using multiple languages in scientific codes

Short version: Is it ever a good idea to use multiple languages in scientific codes? Long version: May be its just me but these days I often see scientific codes written in multiple languages. The ...
2
votes
1answer
128 views

Trying to generate a wave function basis set

For a little project I'm working on, I am trying to generate a wavefunction basis set I can use in Quantum Monte Carlo (DMC to be specific). Preferably, it would be a linear combination of Slater ...
3
votes
2answers
830 views

How to avoid precision loss when handling very long integer constant involved multiple precision computation?

I have a numerical computation problem which requires solving nonlinear equations (with long integers) in multiple precision. I tried an MPFR C++ wrapper from this link by Pavel: mpfr C++ wrapper by ...
3
votes
2answers
1k views

Slow convergence of Newton's method for finite elements

The application is a simple non-linear advection diffusion problem (steady state) using DGFEM. My error at each iteration is given by $$ e_{n+1} = ||\mathbf{J}^{-1}(\mathbf{u}_{n})\mathbf{F}(\mathbf{u}...
1
vote
0answers
190 views

Problem with cell size and boundary conditions in transient cylindrical conduction

I am attempting to model the steady state behavior of a cylinder using the finite volume method (FVM) subjected to a variety of boundary conditions in Matlab. First off, I am treating the cylinder as ...
5
votes
2answers
401 views

Finite element discretization of Reaction-diffusion problem with Dirac source term

I'm writing a code using continuous piecewise linear finite elements on triangular grids to solve the diffusion-reaction problem. the source function f is a Dirac mass at the center. How can i compute ...
3
votes
1answer
351 views

Convergence of interior penalty DG methods

I’m currently having some issues with my routine for the linear advection-diffusion problem. The model problem is as follows: $$ \nabla\cdot(\mathbf{s} u) - \nabla\cdot(\kappa\nabla u) = f, \;\;\;\...
4
votes
1answer
887 views

Backward Euler time step for finite elements

For the backward Euler discretization in time: $$ \left( \frac{u^{(k)}-u^{(k-1)}}{\Delta t}, v\right) + a(u^{(k)},v) = \ell(v) $$ where $a(\cdot,\cdot)$ is the bilinear operator associated with the ...
7
votes
2answers
136 views

Convergence of adaptive finite elements with inexact solves

I'm working on some adaptive discontinuous Galerkin codes for time harmonic wave propagation, currently just Helmholtz, but will be branching out once I have a working prototype in this case. There ...
11
votes
1answer
989 views

Numerical methods for inverting integral transforms?

I'm trying to numerically invert the following integral transform: $$F(y) = \int_{0}^{\infty} y\exp{\left[-\frac{1}{2}(y^2 + x^2)\right]} I_0\left(xy\right)f(x)\;\mathrm{d}x$$ So for a given $F(y)$ ...
3
votes
1answer
239 views

Can one use incompressible flow approximation for fluid flow in heated pipes?

I was wondering if the use of incompressible flow approximation for fluid flow in heated pipes is reasonable. A previous question (Definition of incompressible flow) seemed to focus on Natural ...
0
votes
1answer
204 views

What libraries provide an implementation of multigrid?

I am working on numerical method of Multigrid. What's the available implementation(solver) (actually used in scientific computation) of multigrid method?
7
votes
1answer
97 views

Shall I derandomize a randomized algorithm in real application?

In general (and in real application), suppose I am using a randomized algorithm (e.g. Use MCMC to sample from a distribution and then compute $E(f(x))$ for some function $f$) Assume my algorithm will ...
4
votes
2answers
380 views

Can the Levenberg-Marquardt algorithm be used for minimization and not fitting

Can the Levenberg-Marquardt algorithm be used for minimization and not fitting? Usually we input the derivative of the function we want to fit in the minimizer. Now if I assume I have an objective ...
4
votes
3answers
344 views

Is there a general framework for solving PDEs on uniform grid in parallel

Hej, I want to simulate a partial differential equation (a modified Cahn-Hilliard equation, but the details do not matter much. The questions also applies to the diffusion equation). I'm looking for ...
9
votes
1answer
2k views

Solving system of linear equations with cyclic tridiagonal matrix

I have this problem in my textbook: Suggest efficient algorithm for solving system of linear equations with cyclic three-diagonal matrix, that is of the form: \begin{bmatrix} a_1&b_1&0&...
1
vote
1answer
111 views

How to allocate memory for successive iterative solutions with potentially different non-zero structure?

Background I am solving the unsteady heat equation in 3D using an alternating direction implicit (ADI) method. This means that I am solving three different tridiagonal systems within a single timestep ...
2
votes
1answer
127 views

Detect rigid body motions in a cloud of points

This question popped up today in our group meeting. Suppose you are given a cloud of N points in 2D and each is associated with a velocity vector. These points are associated with particles on a 2D ...
3
votes
1answer
811 views

Sparse matrices that represent common stencil operations

I am not sure if this is the correct place to ask this question! Is there a data set such as the University of Florida Sparse Matrix Collection which is produced from stencil operations? Or is ...
2
votes
1answer
156 views

Inclined plate capacitor grid/ mesh

You can calculate the electric potential over every point in a defined space by solving Laplace's equation. To do this in a computer program you set up an 2-d array/ matrix and loop the internal ...
0
votes
1answer
112 views

max speed <--> time discretization

I'm working on a heat diffusion problem, $$ \frac{\partial T}{\partial t}=\vec{\nabla}\cdot\left(\kappa T^{5/2}\,\vec{\nabla}T\right) $$ I know that, after discretization, the time step for the 1D ...
2
votes
1answer
55 views

Algorithm to extract the decaying parts of complex exponentials

I have an oscillatory, decaying function that can be decomposed as $$\sum_k e^{iz_kt} $$where $z_k$ are complex. What I want is the imaginary parts of all of the $z_k$'s with some range of real ...
5
votes
3answers
329 views

Machine epsilon does not limit relative rounding error for denormals. Is this a problem?

As we know, machine epsilon limits relative rounding error in the range of normalized floating point numbers. But it is easy to check that this is not true for denormalized numbers. My question is ...
5
votes
1answer
275 views

Is is possible to mix finite-volume and finite-difference discretisations when solving a coupled non-linear system?

In my last question I noticed a peculiar error when solving the Poisson equation using finite volume method (FVM), Peculiar error when solving the Poisson equation on a non-uniform mesh (1D only) ...
11
votes
3answers
1k views

Libraries for solving Lyapunov's equation

The following matrix equation $$B\Sigma + \Sigma B^T + C = 0$$ in $\Sigma$ $-$ for given $B$ and $C$ matrices $-$ appears in my work as a characterization of a covariance matrix. I have learned that ...
1
vote
1answer
6k views

Numerically determining convergence order of Euler's method

I need to numerically determine the convergence order of Euler's method for various step-sizes. I am unsure how to go about doing this. Here is the question: Problem statement: $\frac{dy}{dt}=\alpha ...
4
votes
1answer
391 views

PETSc input format for linear solvers

I’m going through some considerable effort to translate one of my codes from MATLAB. It’s a type of finite element code and I haven’t implemented the solver yet but comparing CPU times for simply ...

15 30 50 per page
1
159 160
161
162 163
194