Questions tagged [python]

A general purpose high-level programming language that emphasizes ease of code syntax and readability.

444 questions
494 views

Finding the first N roots of transcendental equation

I need to find the first $n$ roots of the transcendental equation $$F(k) = J_m'(kr)Y_m'(k)-J'_m(k)Y'_m(kr)$$ for integer values of $m$ and any $r \in [0,1)$ where $J'$ ...
260 views

2D Ising Model, heat capacity decreases with lattice size

The problem I'm trying to make a metropolis simulation of the 2D Ising model. Basically, it's the following, for each monte-carlo step: Visit each lattice site, Compute energy required to flip ...
56 views

140 views

Performing a random walk on a lattice that traps the particles

I am trying to solve this problem where we have a 1D-lattice of size 100 and the particle can start from any position in the lattice and moves randomly on it(with equal probability of moving to either ...
59 views

Wanting an explanation of the variables in Iterative PCA algorithm

I've been trying to implement the CPU GS-PCA algorithm in this paper . The code starts on page 28 I have a program written a script in python which gives the same output as the C++ program in the ...
974 views

Efficiently finding all (x,y,z) points within certain distance of point P

I am using Python, and I have a Pandas dataframe with hundreds of thousands, if not millions, of $(x,y,z)$ coordinates. I am looking to find an efficient method to index the original dataframe so that ...
388 views

Applying Neumann boundaries to Crank-Nicolson solution in python

Consider the heat equation $$u_t = \kappa u_{xx}$$ with boundary conditions of $$u(x,0)=0\\ u(0,t)=100\\ u(l,t)=0$$ Numerical analysis by pyton can be done with ...
149 views

Open source implementation of Multiscale Combinatorial Grouping

I would like to use Multiscale Combinatorial Grouping for my PhD research. However, I am restricted to use open-source implementations and this one runs on Matlab. Does anyone know of an equivalent ...
352 views

How to define the derivative for Scipy.Optimize.Minimize

I am trying to use scipy.optimize.minimize to minimise a quadratic objective function: $f(x) =x^\top Q x$. As a start, I have successfully implemented this using the built-in Nelder-Mead Simplex ...
79 views

Why does multithreaded code Segfault in 64-bit but not 32-bit [closed]

I have written some multithreaded code using PyOpenCL, which works fine under the following conditions: GPU 32-bit floating point values (Intel Iris GPU can only handle single precision values) CPU ...
512 views