All Questions

Filter by
Sorted by
Tagged with
2
votes
3answers
142 views

Clustering with points lying along different 3D planes

I have a bunch of data points in 3D that lie along a few planes. What would be the best approaches to estimate the normals of these planes? Edit: There are roughly equal number of points lying along ...
0
votes
2answers
83 views

What's a nice simple PDE to play with in Matlab?

I want to learn a very simple PDE to gain physical and mathematical intuition—a PDE with just one spatial dimension $x$ and a time dimension $t$. And, I want to write code for it in Matlab and use a ...
0
votes
1answer
101 views

Multi-domain 3D Geometries for MATLAB PDE Toolbox

In principle the PDE Toolbox in MATLAB can handle multi-domain 3D geometries as noted here. This feature and the associated function geometryfromMesh were introduced in MATLAB R2018a. The associated ...
2
votes
1answer
67 views

Defining Current Density in a FEM model (MATLAB)

I'm attempting to solve the Poisson equation in 3D for a magnetic vector potential in the presence of a current source. To validate my code, I'm initially looking to reproduce the model described in ...
2
votes
1answer
35 views

Find index for submatrix with maximum sum

Given an N-dimensional matrix A, I want to find an M<N dimensional index array I such ...
1
vote
1answer
86 views

Average value divergence in spectral method for Poisson equation

I'd like to know how to deal with a divergence when trying to solve the Poisson equation for electrostatics with a simple spectral method. I'm not sure how to best state my problem, so I'll explain ...
2
votes
1answer
154 views

How to optimize sampling for parameter estimation

I have a computer model with a number of parameters that need to be calibrated based on experimental results. It's also important to understand the sensitivity of the results to each parameter ...
-1
votes
0answers
23 views

non premixed Combustion by using oxygen droplets

I am trying to simulate a case in ANSYS FLUENT for combustion of methane and oxygen where oxygen enters the domain in the form of droplets. There is a change in temperature but there is no formation ...
2
votes
1answer
86 views

Null space for smoothed aggregation algebraic multigrid

I do not really get the point of null space usage for creating the prolongation operator for smoothed aggregation algebraic multigrid. I know what the null space is per definition and I know that the ...
2
votes
0answers
71 views

Unforeseen behaviour of fix() in Octave and Scilab

I encountered some odd results when using the function fix() in Octave and Scilab. The following is input and output of the Scilab console but the exact same thing happens in Octave. I start with the ...
0
votes
1answer
76 views

Optimize multivariable function with interdependent variables

I have a cost function with 2 parameters. The variables are dependent on each other. So, if I just take a partial derivative with respect to one variable the slope is in terms of the other variable ...
1
vote
0answers
53 views

Radial Hartree and exchange-correlation potentials

According to [1] the one-dimensional Kohn-Sham equation is given by $$ \left( -\frac{1}{2} \frac{d^2}{dr^2} + \frac{l(l+1)}{2r^2} + V[\rho;r]\right) rR_{nl}(r) = \varepsilon_{nl} rR_{nl}(r) $$ where $$...
1
vote
0answers
79 views

Solve a nonlinear system of equations with condition symbolically

Consider the following system of nonlinear non-dimensional ODE : \begin{align*} \frac{d\bar{x}(\tau)}{d\tau}=\quad&\bar{x}\left[1-\bar{x}-\frac{\bar {y}_{1}}{\bar{m}_{1}\bar {y}_{1}+\bar{x}}-\...
0
votes
0answers
43 views

Troullier-Martins pseudopotential with nonzero angular momentum quantum number

According to [1] the Troullier-Martins pseudopotential for quantum number $l$ is computed by $$ V^{\textrm{KB}}_{\textrm{nonlocal},l}(r) = \frac{\vert{}V_{\textrm{nonlocal},l}(r)\Phi^{\textrm{PP},0}_l(...
0
votes
1answer
84 views

List of Tersoff potentials?

I would like to know some GNU libraries or lists of downloadable Tersoff potentials. I couldn't find that many of them, and I also would like to know if there is a reason as to why this is the case.
2
votes
1answer
88 views

Solving system equation

Given matrix $K_{n \times n}, H_{n \times n},M_{n \times n}$, I want to solve for $B_{n \times n} $ and $V_{n \times 1}$ from the nonlinear system of equations: \begin{aligned} &H_{i j}=\frac{B_{i ...
1
vote
1answer
78 views

Disciplined convex programming expression of $x\sqrt{1-x}$

Anyone have an idea for a DCP (disciplined convex programming) representation of the concave function $x\sqrt{1-x}$, which is has domain $[0,1]$? The Taylor series about $x=0$ is $$x - \frac{x^2}{2}...
2
votes
1answer
60 views

Optimization with the constraint of rank=1

I have the following matrix $$ A = [x_1, x_2, ..., x_n], $$ where $x_i \in \mathbb R^n$. But I know the relationship that \begin{align} x_2 = s_2 x_1 \\ x_3 = s_3 x_3 \\ ... \end{align} where $s_i$...
5
votes
1answer
116 views

Fastest way to calculate the $2$-norm (or an upper bound for the $2$-norm) of the inverse of a matrix $A\in \mathbb{C}^{N\times N}$

I have a matrix $A\in \mathbb{C}^{N\times N}$ and I need to calculate $||A^{-1}||_{2}$ efficiently. Can it be done without having to evaluate the inverse explicitly? In general, I am looking for ...
4
votes
1answer
582 views

Help with Fourier beam propagation method

I am working on implementing the Fourier beam propagation method in C++. I am really more of a programmer than a physicist but I think I have a good understanding of what I am trying to do. Here is ...
1
vote
1answer
172 views

Lower bound for bilinear form in FEM

I'm searching for lower bounds of bilinear forms arising in FEM for elliptic second order PDEs with mixed boundaries. I did some research and found: $$\max_{v_{h}\in\mathcal{V}_h(\mathcal{\Omega})}a(...
0
votes
1answer
61 views

Singularity in gradient caused by Dirichlet boundary condition

I am looking for a mathematical explanation for the singularity caused by a Dirichlet boundary condition partially imposed at a boundary. For instance $$ \nabla^2u=0 ~ \text{in}~\Omega $$ where $\...
11
votes
3answers
4k views

How much more work is it to code math models in Python, compared to working with Matlab?

If one had to code up a new dynamical system for a research group at a university, and the university has a Matlab total headcount license so that one could code in Matlab, are there any benefits to ...
5
votes
3answers
4k views

Performance of kd-tree vs brute-force nearest neighbor search on GPU?

I wonder if there is any study that compares the performance of kd-tree vs brute-force nearest neighbor search on GPU. Post #4 on this page suggests that kd-tree may not be the optimal algorithm for ...
2
votes
2answers
630 views

Convergence problem for Poisson equation with periodic BC

I have written Poisson solvers using two different methods: A classic Jacobi scheme and one using the multigrid solver Hypre. I made up a couple of test cases ensuring the validity of those solvers. ...
2
votes
1answer
60 views

What is the correct way to calculate deviatoric stress tensor in lattice Boltzmann method?

Due to my previous question, where I asked about flux calculation in lattice Boltzmann (LB) method here, I have more or less same question for deviatoric stress tensor calculation due to pseudo-...
2
votes
0answers
33 views

How to account for a corner node with zero-flux condition at an extrapolated distance

I am trying to implement a numerical solver and am having troubles dealing with boundary conditions, especially in the corners. I have a 2D mesh, and on the left I have a Dirichlet condition, on the ...
14
votes
1answer
2k views

How to Run MPI-3.0 in shared memory mode like OpenMP

I am parallelizing code to numerically solve a 5 Dimensional population balance model. Currently I have a very good MPICH2 parallelized code in FORTRAN but as we increase parameter values the arrays ...
14
votes
1answer
964 views

Conserving Energy in Physics Simulation with imperfect Numerical Solver

I am creating a C++ Physics Simulation where I need to move an rigid body through an acting force field. Problem: simulation does not conserve energy. Quesiton: abstractly, how is conservation of ...
1
vote
2answers
145 views

Second derivative using Fornberg finite difference method

I have some discrete data, non-equispaced in $x$, $y=f(x)$. I want to use a numerical finite difference method to calculate the second derivatives of $y$, at some point. I am using the Fornberg ...
1
vote
2answers
128 views

How to compute 16 different simulations on parallel with pbs script on the same machine

I have a 32 cores machine, and I need to run 16 different dynamics simulations in parallel on it. I want the 16 jobs to run in parallel, not sequentially, on the same machine. The 16 dynamics input ...
0
votes
1answer
95 views

What's a time centered Riemann problem?

I am trying to understand the meshless methods as described in https://arxiv.org/pdf/1409.7395.pdf. I'm having trouble understanding the following step: (Page 7, just after equation 17) Now, rather ...
2
votes
0answers
52 views

Processing time steps in chunks with Fortran [closed]

My PDE simulation program written in Fortran has to make about 2 million variable time steps. But with each time step it slows down more and more, so that if it initially makes 1000 time steps per ...
2
votes
1answer
204 views

Efficiently generate a random subgraph (Gs) with maximum degree K, using only edges from an existing graph G

I am looking find a way of efficiently generating a random, undirected subgraph $G_s$ with $N$ vertices, using a subset of edges from an exisiting undirected graph $G$, also of size $N$, where the ...
0
votes
1answer
115 views

temperature profile on axial direction of a chamber

I have a task to plot average temperature profile at each cross-section in the axial direction of a combustion chamber. I have $x$, $y$, $z$ coordinates data in excel as well as the corresponding ...
1
vote
1answer
167 views

Integrating direct dynamics form more than 1 second does not give back the correct result

I am trying to simulate a robot manipulator dynamics in SciLab. Basically, I generated a step function that has constant acceleration for half of the time and then the same acceleration but negative ...
2
votes
2answers
48 views

Implementing Gelfand’s formula for the spectral radius in Python - lack of convergence

For context: Gelfand's formula for the spectral radius is $\lim_{k\rightarrow \infty}|A^k|^{1/k}$ where $|\cdot|$ is any well-defined operator norm. I naively coded a function to calculate the $k$th ...
0
votes
2answers
333 views

Imposing total pressure over surface in FEM

I am trying to solve Stokes problem using Finite element method. My question is how to impose that total pressure over the surface is zero to remove the constant pressure mode?
2
votes
1answer
40 views

Could the convex problem be tackled by CVX?

I want to solve the convex optimization as follows: \begin{align} \underset{X_1,X_2}{\min} &\ -\frac{1}{N}\sum_{i=1}^N\log\det\left(I+H_i^HX_2H_i\right)-\log\left[1+h^H(X_1+X_2)h\right]\\ &\...
2
votes
0answers
28 views

Computing convolution of two characteristic function over a 1D Cartesian mesh

I am trying to compute the convolution of two characteristic functions over a Cartesian mesh. First, I define my Cartesian mesh of the interval $[0,1]$ as follows $$ x_{i} = i \Delta x, i = 0, 1, 2\...
3
votes
0answers
60 views

Computation of Troullier-Martins pseudowavefunctions

The computation of Troullier-Martins pseudowavefunctions has been described in [1]. The pseudowavefunction $R^{\textrm{PP}}_l$ is defined by $$ R^{\textrm{PP}}_l(r) = \left\{ \begin{array}{ll} R^{\...
2
votes
0answers
29 views

Fitting a plane with the Prewitt gradient operator

Prewitt gradient operator Show that the Prewitt gradient operator can be obtained by fitting the least-squares plane through the 3 × 3 neighborhood of the intensity function. Hint: Fit a plane to ...
0
votes
0answers
92 views

Numerically solving a partial differential equation in python with Runge Kutta 4

I'm supposed to solve the following partial differential equation in python using Runge-Kutta 4 method in time. $$ \frac{\partial}{\partial t}v(y,t)=Lv(t,y) $$ where $L$ is the following linear ...
10
votes
3answers
378 views

Linear algebraic research direction that's not to do with differential equations and physics?

So I've found some interesting linear algebraic research areas that's both pure-ish, with a numerical bent to it, too -- e.g. inverse eigenvalue problems have both interesting theoretical and ...
0
votes
1answer
128 views

Prescribing variables as an excitation in Runge-Kutta method

I am using Runge-Kutta to solve a $3 \times 3$ 2nd order linear ODE $$M x'' + C x' + K x = 0$$ and initial conditions are all zeros. Then I prescribe the 2nd variable to follow a given path. As for ...
0
votes
1answer
27 views

Change of random variables and check by plot

Question As a test, I transform a uniform distribution over the unit square. But when I check the transformed distribution with Monte Carlo, it is wrong. What went wrong? Thanks. Problem Random ...
0
votes
1answer
96 views

Numerov method for Schrodinger equation

While learning about numerical methods for solving the Schrödinger equation I came across Numerov's method. I want to get the solution for the harmonic oscillator by alreading giving the eigenvalues. ...
2
votes
1answer
56 views

Testing a block tridiagonal system of equations

In 1D problems, tridiagonal systems of equations are obtained when we use finite-difference or finite-volumes in a structured mesh. A wide solver is the TDMA algorithm here. In two-dimensional ...
5
votes
1answer
487 views

Finite volume a posteriori error estimation

I'm wondering what alternatives there are to a grid convergence study to judge solution accuracy for a given grid resolution when doing steady-state RANS simulations on an automatically generated ...
1
vote
0answers
1k views

Finding eigenvectors and eigenvalues of large matrices in Python's numpy

I am running a PCA analysis on a data set using Python's (v2.7.10) NumPy. I validated that my program works by running the PCA analysis on a smaller dataset and then confirming that I get similar ...

15 30 50 per page