All Questions

0
votes
1answer
57 views

Fast Poisson solver (with Dirichlet BC zero) on a *truncated* Cartesian 3D grid

I find myself in the position of having to solve $-\Delta u = f$ on a subset of Cartesian grid points that don't necessarily form a cuboid domain subject to a homogenious Dirichlet boundary condition ...
5
votes
1answer
329 views

Is there a database/website with Butcher tableaus?

I have started investigating in mostly Runge Kutta and Runge Kutta Nyström methods and there one of the only differences between the methods of the same type is their Butcher tableu. For the most ...
3
votes
1answer
28 views

Poisson image blending artifacts

I am trying to implement Poisson image blending as in the paper Poisson Image Editing. This is the task of filling in a masked region of an image by minimizing $$\min_f\int_\Omega \left | \nabla f - \...
0
votes
0answers
19 views

work/memory ratio for product of two square matrices

From Scientific Parallel Computing by Scott Ridgway: Definition: The work/memory ratio of an algorithm is the ratio $\rho_{wm}$ of the number of floating point operations to the number of memory ...
2
votes
1answer
54 views

Problem of multiplication of big (sparse) matrix with numpy (python)

I wanted to multiply two simple (big and sparse) matrix with numpy. And I saw that the calculation fails when matrices are too big. If i take $X$ a random vector (size $n$). With pandas, I ...
3
votes
1answer
102 views

Time integration of wave equation

My question is: how come that certain formulations of the wave equation can be time integrated more efficiently then others? Le me expand a bit on that. Consider the wave equation: $$ \frac{d^2 p(t,...
2
votes
0answers
28 views

ILUTP in sparse.linalg.spilu?

In Matlab, an ILU with threshold and pivoting (ILUTP) can be passed by default as: setup.type = 'ilutp'; [L, U] = ilu(A, setup); Looking for an equivalent in ...
2
votes
0answers
45 views

Cover a polygon with least amount of parallelograms [closed]

I am solving the task that is as follows: Input: a polygon. Can be any kind of polygon without self intersections. Can be a non-convex and with holes inside. Goal: to cover it with 2 (at least) or ...
0
votes
1answer
41 views

Gnuplot: How can I determine the maxima of a fit function in gnuplot?

I have a set of data data.txt which can be fit to a Gaussian function, f(x). I want to determine the coordinates of the point of ...
1
vote
1answer
32 views

Gnuplot: How can I fit a range of points (out of the entire data) to a function?

I have a set of data obtained for the I-V characteristics of an LED. ...
2
votes
2answers
66 views

Stability of Crank-Nicolson for $u_t = iu_{xx}+2iu$

I want to use the Crank-Nicolson scheme to solve the equation $$u_t = iu_{xx}+2iu$$ Here's the analysis: Suppose we make a grid, with $k = dt$ and $h = dx$, the usual notation, and also $u_j^n = u(...
1
vote
0answers
44 views

How to integrate the contents of a vector using an adaptive quadrature routine [duplicate]

I have a function which requires the return type to be a container. The problem is that I need to integrate the contents of the container as efficiently as possible and was hoping to use adaptive ...
6
votes
2answers
115 views

Positive root of $x^q + bx - b$

Is there either a closed-form expression or fast/elegant algorithm for computing the positive root of the polynomial $$f(x)=x^q + \beta x - \beta,$$ where $\beta>0$ and $q\geq2$? How about the $q\...
-1
votes
1answer
53 views

Simulating magnetic particles in a field free point generated by two opposing magnets

This is probably a long shot with such a short time, but I've been trying to get theoretical data for a project I'm working on. The project involves using a very simplified version of magnetic ...
2
votes
1answer
81 views

Which pseudo-inverse to compute when Inverse is not possible? (No linear solve)

Let us assume that we have a function, $f(A)=\text{vec}(A^{-1})^\intercal B$, dependent on $A^{-1}$. However, due to some machine-precision limitations, the programming language I'm using cannot ...
2
votes
0answers
24 views

Cell-segmentation from overstaining images Ask [closed]

I am currently trying to segment cells from digital pathology images. The method I use is an algorithm based on color distance. This works for most of the cases, however, when dealing with the images ...
0
votes
0answers
55 views

The final Boundary Condition is Unknown, Is Backward Euler is still valid to be implemented?

I am working on conductive polymer modeling and supposed to do one-dimensional diffusion model in the thickness of the polymer, however, due to the small value of thickness in micro, when I use the ...
0
votes
0answers
28 views

Inverse kinematics BFGS divergence

I am trying to implement inverse kinematics solver using BFGS as stated in the paper Xia2017. In the test experiment, i created 4 objects in 3-dimensional space: Node, Node1, Node2, Node3. Each Node ...
1
vote
0answers
29 views

Why does the correlation function of this stochastic differential equation starts at different points?

I am working with the following differential equation: The equation is $$x=\beta +\sqrt{2D} \xi(t)$$ where $\xi(t)$ is a white noise term, with a reflecting wall boundary conditions. After solving ...
2
votes
0answers
48 views

How to implement adaptive step size Runge-Kutta Cash-Karp?

Trying to implement an adaptive step size Runge-Kutta Cash-Karp but failing with this error: ...
0
votes
1answer
110 views

Finding a shortest path in a graph

If each edge of a graph $G$ is unweighted or has equal weights, then the shortest path between two nodes in that graph is the path that contains the fewest number of edges. Such a path can be obtained ...
3
votes
0answers
47 views

Calculate the Bloch wave

The eigenvalue problem $$\frac{d^2u}{dx^2}+2i k\frac{du}{dx}-[k^2-6\sin(x)^2]u(x)=-\mu u(x)$$ gives the first five eigenvalues with $k=0$ or $k=1$ which are $2.06$, $2.26$, $5.16$, $6.81$, and $7....
0
votes
1answer
26 views

Specifying mesh spacing for DFT in numpy

I was testing the .fft package of numpy 1.16.1 in Python 3.7.2. In particular I was trying to verify that the transform resembles the analytical one for: $$f(x) = \mathrm{exp}\left[-\left(\frac{x-5}{2}...
1
vote
1answer
60 views

FFT solver for the Poisson problem with Dirichlet boundary conditions

I am trying to solve the Poisson problem with Dirichlet boundary condition in 1D: \begin{equation} \begin{array}{rcl} - \mu \Delta u & = & f~in~[0,1], \\ u(0) & = & 0, \\ u(1) & = ...
0
votes
0answers
29 views

Parameter estimation using fmincon

This is a follow up to my previous question posted here. I am solving an optimization problem using fmincon in MATLAB. There are no equality constraints in my model....
2
votes
0answers
91 views

Computing the structure factor from positions and radial distribution function

I'm currently analysing some spatial point patterns that come from some fluid dynamics simulations and I'm having some difficulty computing the structure factor, $S(\pmb{k})$, from both the positions ...
7
votes
1answer
105 views

How to calculate the geodesic curvature of a discrete 3D curve?

I have coordinates of a set of points that form a closed loop that lies in a 3D surface. I know the equation of the surface and I can calculate it's surface normal at any point. I found that for a ...
1
vote
0answers
27 views

Boundary conditions for a Non-linear Schrödinger equation using an extended crank nicolson scheme

I try to solve numerically the following PDE for $E(r, z)$ with a cylindrical symmetrie (i. e. $E(r, z) = E(-r, z)$). $\frac{\partial E}{\partial z} = \frac{i}{2k} \Delta E + \mathcal{N}(E)$ Where $...
3
votes
1answer
45 views

Stability region of explicit midpoint method

Consider the explicit midpoint method, i.e $$y_{n+1}-y_{n-1} = 2hf(y_n).$$ I'm asked to apply this method to the linear test equation, $f(y_n) = \lambda y_n,$ in order to find the method's stability ...
5
votes
0answers
77 views

Numerical methods for the continuity equation with Sobolev vector field

Consider the continuity equation $$ \partial_t \rho(x,t) + \operatorname{div} (b(x,t) \rho(x,t)) = 0, \qquad t \in [0,T], \quad x \in \mathbb R^N, $$ with $b \in L^1((0,T), W^{1,p}(\mathbb R^N))$. ...
0
votes
0answers
33 views

Boundary conditions for solving the time-independent SE for the hydrogen atom

I am trying to solve the schrodinger equation for the hydrogen atom numerically, using finite elements, with matlab's solvepdeeig(). I have a hard time getting the solution to be right, and it seems ...
0
votes
0answers
42 views

Parameter estimation using shooting method

I want to do the following, I have a set of 20 first order differential equations and I want to estimate some of the parameters. I've got the following initial and boundary conditions. The initial ...
5
votes
2answers
169 views

Computing any element of the null space of a singular matrix

Given a singular matrix $A$, what is the fastest method to find a single non-zero solution to $Ax=0$? Note that we are not looking for the whole kernel, we just want any non-zero vector in it. I ...
0
votes
0answers
38 views

Time sampling changes solution

I'm currently trying to solve a problem using numerical methods. The set-up is rather long, so I apologize in advance... TL;DR: My solutions change depending on how big my steps are and I don't know ...
2
votes
1answer
66 views

Nonlinear conjugate gradient with orthogonality constraint

I have to solve a set of nonlinear optimization problems in the subspace defined as the orthogonal space to a given vector. More precisely, $$ \arg\min f(\vec x) \qquad \text{with} \qquad \vec x \...
0
votes
1answer
60 views

How to efficently plot a finite element mesh solution with matplotlib

I am looking for the most efficient way to plot a mesh using matplotlib given the following information, coordinates of each node, what nodes belong to each element, and the value each node has. Below ...
1
vote
1answer
47 views

Simplest way to precondition Uzawa iteration

I have a diffusion problem with an internal circular dirichlet constraint and a side condition which shall enforce a certain global volume integral. $\nabla(D \nabla u(x)) = 0$ outer boundary ...
0
votes
1answer
47 views

How to obtain linear tridiagonal system from PDE

I'm trying to re-solve the governing equations in hydraulic fracturing modeling as instructed step by step in a paper. After (A-9), the author stated that by substituting A-6, A-8 and A-9 into ...
3
votes
0answers
55 views

Solve ODE with non-negative and maximization constraints

My task is to solve $$\eta_k\frac{d^2C_k}{dz}(z)=-e_k, k = 1,2,3$$ $$C_k\ge0$$ $$C_1(0)=0, C_2(0)=A, C_3(0)=0$$ $$C_1(L)=B, \frac{dC_2}{dz}(L)=0, \frac{dC_3}{dz}(L)=0$$ with $$e_1 = -\beta_1-\beta_3$...
1
vote
2answers
68 views

CFL equation for non-linear equation

I am trying to solve numerically (obviously) inviscid Burgers' equation with the finite difference method. The equation is the following: $$ \displaystyle \partial_t u + u \, \partial_x u = 0 $$ ...
1
vote
1answer
42 views

Weak scaling for N-body simulations

I'm going to be doing some weak scaling of an $N$-body integrator on AWS. In the past when I've done weak scaling for this integrator I've fixed the number of particles per core ($N/n = {\rm const}$). ...
1
vote
1answer
36 views

How to obtain and form a 1st order differential equation for leapfrog integration from second order one in this example of coulomb drag

I am currently doing a computational physics homework which asked us to use leapfrog to give the relations between timevelocities and time-distance of these two objects. The full question is as ...
0
votes
1answer
71 views

Good C, C++ library for efficient grid search / tuples, ideally with bindings to Eigen

I have a $q$-dimensional grid, known at run, not compile-time, that has $50$ points in each direction and hence $50^3$ combinations that I would like to first build and then call a function with each ...
1
vote
1answer
78 views

Is there a name for this integer linear optimization problem?

I have an integer linear programming problem of the form: $$\DeclareMathOperator{\tr}{tr} \min \tr WX$$ subject to: $$\begin{align} \sum_j X_{ij} < c_i && \forall i \\ \sum_i X_{ij} = 1 &...
0
votes
0answers
37 views

Finding second excited state of Schrödinger equation with secant Runge Kutta method

In our assignment, we are required to find the energies of the ground state and the first two excited states of the Schrödinger equation in a harmonic potential: $$V = \frac{50 x^2}{(10^{-11})^2}\, .$...
0
votes
1answer
29 views

How to improve the efficiency of periodicity detection for long time based lined and gapped datasets

Our data set has $10^4$ data points, but has a long baseline and many gaps. As the histogram shows, the horizontal-axis is time and most of the time, there are no data. The vertical-axis is data ...
0
votes
0answers
35 views

extrapolation/interpolation in fmincg.m

Can you tell me these equations come from where in MATLAB fmincg.m? ...
4
votes
1answer
135 views

Is a symmetric bilinear form necessary to ensure a weak formulation has a solution?

Problem I want to convert the general second order linear PDE problem \begin{align} \begin{cases} a(x,y)\frac{\partial^2 u}{\partial x^2}+b(x,y) \frac{\partial^2 u}{\partial y^2} +c(x,y)\frac{\...
1
vote
0answers
38 views

Properly sizing ParaView plots for LaTeX [closed]

I would like to make a visualization with ParaView for a paper. In order to have a high quality look, I would like the image to be, say, 300 dpi (or vector graphics). Moreover, since I know the column ...
2
votes
1answer
106 views

A fast way to check if a Matrix is ill-conditioned, and turning it into well-conditioned

I'm running a simulation, and some linear solvers are returning a message of ill-conditioned matrix. Hence, I'm looking for a fast, easy to implement, method to detect if a matrix is ill-conditioned, ...

15 30 50 per page