All Questions

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

Quadrature and quadrature-free discontinuous galerkin method for non-linear PDE

Quadrature-free DG method using nodal Lagrangian basis are computationally very efficient. I have seen many papers using this method for linear PDE but almost no literature for non-linear PDE like ...
35
votes
11answers
2k views

Venues for publishing papers that emphasize software

Software is a fundamental part of computational science, and is increasingly recognized as an essential part of the scientific record. Given the value of using existing and well-tested code, it seems ...
1
vote
0answers
38 views

Hybrid Ellpack-Itpack (ELL) + COO Sparse Matrix Representation decomposition threshold

Hybrid ELL-COO sparse matrix representation can be done as in the picture, I was looking intensively, however I couldn't find out what is the threshold of decomposing the original matrix into ELL part ...
2
votes
0answers
16 views

Normalising DFTs Correctly

I have been playing around with convolutions in scipy's signal package: ...
0
votes
0answers
13 views

Efficient Alternatives to Operator Splitting in NLSE

Lately i've been trying to decide my thesis theme and i've become interested in adaptive finite elements and finite volumes algorithms. However, I need my thesis to fit into a physics related theme. ...
0
votes
0answers
13 views

How to handle system of chemical reactions for a batch reactor SciPy solver

I have a system of chemical reactions where the rate equations represent a batch reactor model. The model is a system of ODEs which is solved with the SciPy ...
0
votes
0answers
69 views

What algorithm do BLAS and ATLAS use for matrix multiplication?

I have searched and what I understood was that they use the naive one with several memory and cache optimizations. However, I wanted to know whether they are using the Strassen or the Coppersmith-...
-2
votes
0answers
15 views

Implementing Housholder QR decomposition in Python

I am struggling to get my implementation of householder qr decompostion to generate the correct answers. I have been working on this for days and cannot workout where my code is going wrong. Any help ...
3
votes
3answers
4k views

How to implement Gauss-Laguerre Quadrature in Python?

To get the hang of Gauss-Laguerre integration I have decided to calculate the following integral numerically, which can be compared to the known analytical solution: \begin{align} \int_0^{\infty} s^...
0
votes
0answers
20 views

Interpreting results of using no-flux boundary condition

I am solving for solute transport in 1 D. $$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2} - v\frac{\partial C}{\partial x}$$ No-flux boundary condition is imposed at both the ...
1
vote
0answers
14 views

Live audio processing using c++ (standard or external libs 'ue4')

My goal is to get audio from the input of another device (either connected to computer throught aux or audio interface threw rca or coaxil(from an external device playing audio live) adapters to line ...
4
votes
1answer
37 views

Low rank update of QR of inverse

I am in a situation where as part of a sort of inverse power method scheme, I want to very often perform the following step: Apply a symmetric rank one update $uu^\top$ to my inverse matrix $A^{-1}$ ...
1
vote
1answer
58 views

Implementing Robin Boundary condition (finite difference)

I'm interested in applying Robin boundary condition to a convection-diffusion problem in 1D. In the following system, $$\frac{\partial C}{\partial t} = D\frac{\partial ^2 C}{\partial x^2} - v\frac{\...
0
votes
0answers
22 views

Splitting coupled non-linear diffusion equations into blocks

Two coupled linear diffusion equations $$\begin{split}\partial_ta&=\nabla(\nabla a)\\ \partial_tb&=\nabla(\nabla b)\end{split}$$ can be split into blocks by putting everything onto one side, ...
1
vote
1answer
42 views

Why am I getting this DCPError?

I'm trying to optimize a binary portfolio vector to be greater than a benchmark using CVXPY. ...
0
votes
1answer
138 views

Split-step Fourier method applied on Schrodinger equation

I'm trying to solve a Schrodinger equation of the form $i\frac{\partial}{\partial t}\psi=-\frac{\partial^2}{\partial x^2}\psi + (V(x)+\alpha|\psi|^2)\psi$ using the split-step Fourier method ...
1
vote
1answer
63 views

Manual for library Libxc

Where can I find the manual for software library Libxc for exchange-correlation functionals? Links with domain www.tddft.org don't work.
3
votes
0answers
41 views

Efficient evaluation of spherical harmonic expansions

Assume I know that I can express an approximation of a function by $$ \sum_{l=0}^{k}\left( \sqrt{A_l} z_{l,0}^1 L_{l,0}(\theta)+\sqrt{2A_l}\sum_{m=1}^l L_{l,m}(\theta)(z_{l,m}^1 \cos(m\phi)+z_{l,m}^2\...
2
votes
2answers
139 views

Does iterative method work for singular consistent linear system Ax=b?

Recently, I have been studied iterative methods for large sparse linear system Ax=b, where A is nonsingular, so there is a unique solution x. And the stopping criterion is usually chosen with norm(b-...
-1
votes
0answers
75 views

Solving one dimensional diffusion equation

This is a followup to my previous post here. I'm solving a 1 D diffusion equation using Dirichlet boundary conditions on both the boundaries, left and right. $$\frac{\partial C}{\partial t} = D\...
0
votes
1answer
102 views

Chip testing problem

An engineer has n supposedly identical integrated-circuit chips that in principle are capable of testing each other. The engineer test jig accommodates two chips at a time. When the jig is loaded, ...
0
votes
1answer
61 views

Robin Boundary Condition with Implicit Upwind - Finite Difference Method for 2D Convection-Diffusion Equation

I am trying to solve a problem with 2D Convection-Diffusion equation with U = Concentration ($mg/m^{2}$) using Implicit Upwind Finite Difference Method like this $$ \frac{\partial U}{\partial t} + ...
1
vote
1answer
29 views

Why the iteration steps become twice if the step size reduces half for CG methods?

For CG method for SPD matrices, (Ax = b arising from Poisson equation with homogeneous boundary condition) we know that the convergence theorem: After m steps of iteration, the error $e^{(m)}=x-x_m$ ...
3
votes
2answers
52 views

Optimal line such that maximum points are between an upper and lower boundary

I have some 2D data and would like to find a line $y = mx + b$ such that a maximum number of points from the data is captured within the area between $y = mx + b + margin$ and $y = mx + b - margin$. ...
-1
votes
0answers
15 views

Counting number of calls to union operation while creating disjoint set from an undirected graph

I am working through an algorithms book, and I am having trouble understanding the solution to a problem in the book. This is found in the Introductions to Algorithms book in Chapter 21 on disjoint ...
1
vote
0answers
29 views

How to use matlab **fft** function or other fast methods to solve a convection-diffusion system quickly?

for a convection-diffusion equation with Dirichlet boundary conditions as follows: $$-u''+qu'=f$$ Using centered difference for $u''$ and $u'$, we get a linear system $$Ax=b$$where matrix $A$ is ...
2
votes
0answers
70 views

Extracting FEM matrices in matlab pde toolbox

I am trying to follow the dynamic linear elasticity in Matlab, link here. My goal is to extract the FE Matrices using the function assembleFEMatrices in matlab and solve the resulting system of second-...
0
votes
1answer
35 views

Dealing neighbor list in NVT Monte Carlo (MC) simulation

I'm making a NVT Monte Carlo (MC) simulation code with only short range interaction. I found many MC tutorial codes (usually Lennard-Jones system) in online. However, most of them are doing energy ...
2
votes
1answer
83 views

Numerical derivative in python

I am trying to take the numerical derivative of a dataset. My first attempt was to use the gradient function from numpy but in that case the graph of the derivative ...
1
vote
0answers
55 views

Solving diffusion equation using finite difference method

I am solving an 1-dimensional diffusion equation with Neumann boundary condition at outlet and constant concentration, C, at the inlet. In the end, I want to observe how the concentration diffuses ...
-1
votes
1answer
88 views

Imposing periodic boundary condition for linear advection equation - Node problem

I've spent the whole day trying to figure out what is the correct way to impose (and implement) periodic boundary conditions $u(0,t)=u(1,t)$ for all $t>0$ for the simple advection equation $u_t + v ...
5
votes
2answers
123 views

How to solve calculus of variations problems numerically?

For example, how to solve the well-known isoperimetric problem (i.e., to enclose the largest area with a fixed-length curve)? We can simplify things a bit and fix the two ends of the curve at $[a,0]$,...
1
vote
1answer
38 views

stretch elliptic mesh to fit a circle

I've generated a 2D O-mesh around an airfoil. Unfortunately, the mesh O shape is not a perfect circle as you can see in the figure below (in the figure I plotted only the mesh nodes in blue). The red ...
-3
votes
0answers
67 views

Newton-Krylov on GPGPU

I have questions on Newton-Krylov method implementations. What is the fastest implementation of this method which uses sparse matrices and utilizes GPGPUs? What is the fastest open-source ...
0
votes
1answer
34 views

How to find the nearest point inside a list in a given direction

Being $\bar{\mathbf{x}} \in \mathbb{R}^3$ a point and $S =\{\mathbf{x}\}_{i=1}^N \in \mathbb{R}^3$ a sample of N points. I am looking for a simple algorithm to determine the nearest point in $S$ in ...
2
votes
1answer
60 views

Why should one use a tree structure to represent discrete function spaces?

In FEM/FV codebases, I stumbled upon the fact that the discretized functionspaces are represented within the code as a tree structure. I find this very puzzling. Example: lets say somebody wants to ...
-3
votes
1answer
79 views

Does a new proposed method for solving Ax=b must beat matlab command 'A\b' be a successful method?

I have a question about direct and iterative method. Many people including me often say that for very large sparse linear system, Ax=b, an iterative method is necessary because of cpu memory. I also ...
2
votes
1answer
229 views

Which SciPy nonlinear solver when Jacobian is analytically known and sparse?

I have a nonlinear function fun with n inputs and n outputs. I also have a function jac which calculates the Jacobian, which is ...
26
votes
10answers
7k views

Robust algorithm for $2 \times 2$ SVD

What is a simple algorithm for computing the SVD of $2 \times 2$ matrices? Ideally, I'd like a numerically robust algorithm, but I'll like to see both simple and not-so-simple implementations. C code ...
0
votes
0answers
109 views

Jacobian-free approach for time-dependent equations for implicit time-stepping

When solving time-dependent non-linear equations, such as the non-linear diffusion equation $$\partial_tu=\nabla\left(D(u)\nabla u\right)$$ usually Newton's method is applied, with (coupled with the ...
0
votes
0answers
28 views

Solving Parabolic PDE using Matlab

I have the following pde (Burger's equation) for $\epsilon>0: u_t+u.u_x=\epsilon.u_{xx}$ and $x\in \mathbb{R},t>0$ and the initial condition: $u(x,0)=\phi(x)=1_{(-\infty,0)}(x)$. I want ...
2
votes
3answers
107 views

What is the flaw in my stability analysis?

The ODE $${d^2x\over dt^2}=-kx; k>0$$can be converted in the system of linear equations as $$\begin{align} {dx\over dt} & =v\\ {dv\over dt} &= -kx\\ \end{align}$$ Using Euler’s method, ...
0
votes
1answer
76 views

Getting started with Computational Chemistry

I´m now a chemistry grad student and I feel the need to get involved with computational chemistry and coding in the chemical field (in general). I have a very simple question: What is the best way to ...
1
vote
1answer
37 views

Gmsh meshes flat faces incorrectly for cylindrical faces

I have some C++ code that generates meshes from step files and then analyses these meshes for visibility of the faces from different viewing directions. I currently use CGAL but I would like to switch ...
0
votes
1answer
50 views

Analytic formula for $\arg\max_{\|z\|_\infty \le 1}z^T A z$, where $A=uu^T+vv^T$

Let $u$ and $v$ be column vectors of size $n \gg 1$ (not both zero), and consider the matrix $A:=uu^T+vv^T$ Question What is an analytic formula for $\arg\max_{\|z\|_\infty \le 1}z^TAz=\arg\max_{\|z\...
-2
votes
0answers
32 views

Are 2nd spatial derivatives useful for integrating ODEs?

In discussion of adaptive integrators for ODEs, I see a lot of discussion of how second derivatives in time can be approximated using finite differences, i.e., take several steps, and use numerical ...
0
votes
0answers
24 views

How to ensure values stay within range?

e.g. water in a height map Choosing a range with a margin of error for typical model behaviour seems practical. Could we instead (1). predict maximum values; or (2). have a natural maximum? 1. ...
3
votes
1answer
84 views

Analytic formula for leading eigenvector of $uu^T + vv^T$?

Let $u$ and $v$ be nonzero column vectors of size $n$ and consider the $n \times n$ positive-definite matrix $A:=uu^T + vv^T$. In this post https://math.stackexchange.com/a/112201/168758, the ...
0
votes
0answers
44 views

Determining the indices of a VTK mesh

I am trying to assign fixed constraint at specific indices of VTK mesh, however, I only can view STL file in a blender as follows: Upon assigning the favored indices in my scene at the SOFA physics ...
3
votes
1answer
66 views

Efficient computation of leading eigenvector of a matrix product of the form $ADA^T$, where $D$ is diagonal

Let $A=[A_1|\ldots|A_m] \in \mathbb R^{n \times m}$ with $n \gg m \gg 1$ and $D=\text{diag}(d_1,\ldots,d_m)$ where $d_1,\ldots,d_m > 0$, and consider the $n\times n$ positive-definite matrix $X=\...

15 30 50 per page