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

learn more… | top users | synonyms

0
votes
0answers
37 views

NUMERICAL METHODS FOR SOLUTION OF COUPLED DIFFERENTIAL EQUATIONS (STUDY OF Xe-135 REACTOR POISONING)

I'm building a python code to solve couple differential equations governing Iodine - 135 and Xenon - 135 poisoning in nuclear reactor operation. The code is given below. When I run it I get this ...
3
votes
2answers
81 views

Python environments for AMG and Gauss Seidel as solvers instead of preconditioners

I am working on block preconditioning and seemingly it is common to write customised Krylov solvers for them. Within each solver, the individual block linear system with preconditioners are ...
1
vote
1answer
75 views

Vectorizing list of different functions for Gradient Descent

I am new to machine learning and statistical analysis and am having trouble figuring how I should go about a problem I have. I believe that I understand the gradient descent algorithm and how it ...
1
vote
0answers
18 views

Computing 3-term Connection Coefficients for Wavelets

I am trying to calculate the three-term connection coefficients $$ Λ_{l,m}^{d_1,d_2,d_3} = ∫_{-∞}^∞ φ^{(d_1)}(x) φ^{(d_2)}_l(x) φ^{(d_3)}_m(x) dx $$ for Daubechies wavelets numerically using Python. ...
0
votes
1answer
48 views

Meaning of this minimal python and FEniCS based wave propagation code? [closed]

This is a question about understanding a piece of random code that does not necessarily require knowledge of it's theory. This is very specific and may not be of use to the community in general but ...
0
votes
2answers
87 views

Help implementing finite difference scheme for heat equation

I am trying to solve the following problem via a finite difference approximation: $u_t = k \, u_{xx}$, on $0 < x < L$ and $t > 0$; $u(0,t) = u(L,t) = 0$; $u(x,0) = f(x)$. I take $u(x,0) = ...
3
votes
2answers
131 views

Zero Eigenvalues in Lanczos Algorithm

I need to find the smallest few eigenvalues of a Hamiltonian (exact diagonalization) I use Python, and SciPy's built-in sparse eigenvalue solver. I notice, however, that for my small system (only a ...
1
vote
0answers
29 views

Python DFT library using MPI

I am looking for a discrete Fourier transform (DFT) library that can be run with MPI on Python. Usually, in other language (C, fortran) FFTW is used. There's a Python wrapper for FFTW called pyFFTW, ...
8
votes
3answers
185 views

What does Python offer for distributed/parallel/GPU computing?

Using the SciPy/NumPy libraries, Python is a pretty cool and performing platform for scientific computing. I just wonder: When I have to go parallel (multi-thread, multi-core, multi-node, gpu), what ...
0
votes
0answers
26 views

Solving nonlinear coupled PDE using FiPy

I have recently been trying to solve these 6 coupled, nonlinear PDEs of the general form: $ \frac {\partial N_1}{\partial t} = -a(P_2E_1 + P_1E_2) - bN_1 \\ \frac {\partial N_2}{\partial t} = -c ...
2
votes
0answers
23 views

Efficiently creating an adjacency matrix from a lattice in numpy

I have an $n$ by $m$ numpy array representing a rectangular lattice $L$, where each site contains a one or a zero, representing two different materials. I'm modelling heat flow across this lattice. ...
0
votes
0answers
29 views

Problem with Levenberg-Marquardt for FEMU case

I m trying to implement a Levenberg-Marquart on python to identify 2 material parameters via Finite Elements calculations and full-field measurements as called FEMU (Finite Elements Model Updating). ...
3
votes
1answer
149 views

State of the art in parallel data structures

I'm currently evaluating how I could implement several algorithms on a parallel computer with a large number of nodes, each also equipped with a powerful GPU. It turns out that for many algorithms, it ...
1
vote
1answer
46 views

Preconditioning of two step iteration for dense matrices

I would like to solve a dense linear system the form in python $$ L\left(\boldsymbol{x}\right):=\left[\gamma^+\left[\boldsymbol{A}+\frac{1}{2}\boldsymbol{B}^{-1}\right] +\gamma^-\left[\boldsymbol{A}-\...
1
vote
0answers
64 views

Solve rate equations with different reaction orders using SciPy ode

The image below illustrates the kinetic scheme I am trying to model. My first example focuses on the conversion of the wood-oil to non-volatiles and volatiles. The rate equations are as follows: $$...
2
votes
0answers
51 views

Clustering similar words and mapping to numbers in Python

I'm familiar with kmeans to cluster data points, but not text.. So I have one column of words in cvs format, which I want to cluster those which have similar word or more, and then mapping those ...
0
votes
1answer
56 views

Solving coupled differential equations with multiple independent variables

I am currently using the wrapper odeintw for scipy.integrate.odeint to solve my equations since they are complex-valued. At the moment, I have 3 coupled first-order differential equations with 2 ...
1
vote
0answers
49 views

Generalized Hermite Function as eigenfunction of a differential operator

I'm going through this paper. The article defines function function $\phi_n^\mu(x)$ that is orthonormal on $L^2$ with measure $dm = dx$: \begin{equation} \phi^\mu_n =\left(\frac{\gamma_\mu(n)}{\...
2
votes
1answer
213 views

Why am I not seeing faster neural network training after upgrading to a vastly better GPU?

I was previously running my neural networks using the Lasagne library to build and train neural networks in Theano on an NVIDIA GTX 750 Ti. I'm using a genetic algorithm to tune the hyperparameters of ...
1
vote
0answers
48 views

Very long running time for Haase and Muller (2014) coded in Python + Gurobi

I have read the paper of Haase and Muller (2014) where they present the linear reformulations of the multinomial logit choice probabilities and compare different approaches. I have tried for an ...
1
vote
1answer
60 views

Repeated 1d minimization with similar parameters (scipy)

I have a function f(x,k1,k2) and I am trying to minimize it over x for different values of ...
1
vote
1answer
51 views

Probability of reconstructing a word using c substrings from a random sample

Consider a voice recording split into it's phonemes as our sample $S=(s_1,...,s_k) \in \Omega = P^k$. The number of phonemes is $|P| = 40$. Then I have a word $w = (w_1,...,w_n) \in P^n$. I want to ...
0
votes
0answers
21 views

petsc4py: AttributeError for Mat.createBAIJ method

I am trying to experiment how to set up a block linear system using the petsc4py port in fenics. Although there is no documentation available, I suppose BAIJ method should be a means to create a ...
1
vote
1answer
50 views

Common nodes in two FEM grids

There are two independent tetrahedral FEM grids. Second grid is subset of the first. By subset, I mean: nodes from the second grid are exactly in the same positions as some nodes from the first grid. ...
4
votes
2answers
136 views

How to Solve an Integral Equation for an Unknown Integrand numericlaly?

I am working on an astrophysical research in which we relate the cumulative number of Damped Lyman Alpha HI clouds/galaxies, namely their number densities, $\frac{dN_{DLA}}{dz}(>M, z=0),$ to the ...
5
votes
1answer
553 views

What determines the usual chemistry textbook plots of atom orbitals?

In elementary chemistry textbooks you often have pictures like the following one: Are there any conventions how to get them? I am not sure, but I guess that it are contour plots with only one iso-...
1
vote
1answer
52 views

How to make scatter plots of scalar fields with free software?

How can I make a scatter plot like the following, where the density of points represents the magnitude of the scalar field at that point. Consider for example the probability density for an atom: I ...
3
votes
3answers
173 views

What is the currently recommended way to install the SciPy ecosystem on OS X?

I just got a new Macbook and decided to install everything from scratch instead of migrating. Previously I've always installed SciPy etc. through MacPorts, but lately MacPorts as a whole seems not to ...
0
votes
1answer
168 views

Python Pandas / Numpy indexing faster than np.where between 2 arrays [closed]

I have 2 pandas datasets which have 'RF' field in common. The optionsdata variable is ~60K, which map to at most the histdata ...
0
votes
0answers
60 views

How to create a phase diagram using yt for python?

I'm trying to use yt to create a phase diagram in Python. I have three variables that I will call X,Y,Z from which I have a discrete set of triplets of values (x,y,z). I want to plot for each of these ...
1
vote
1answer
98 views

Addition and subtraction of two floats in Python

Yesterday I was wondering how floats are handled in a computer and what they look like in binary... I learnt about the single-precision floating-point and I tried to see the limit of that format... I ...
4
votes
1answer
178 views

Simulate electric fields due to surface charges in simple circuits using python

I want to simulate the electric fields in simple circuits using Python and only free software. My first goal is to reproduce the images given in (1) which are made by the commercial ANSYS Maxwell ...
5
votes
2answers
209 views

Numerical integration of a single integral

I am trying to evaluate this integral directly using numerical integration functions in Mathematica and Python. $$ \int_0^\infty {y^{-(n+1)}\prod_{i=1}^n \gamma(a_i+1,b_i y) }dy $$ where $\gamma(a,x)...
3
votes
1answer
89 views

(numpy/scipy) Build a random vector given mean vector and covariance matrix

After running several calculations with numpy, I end with the mean vector and covariance matrix for a state vector. Is there a way with numpy or scipy to sample a random vector around this mean and ...
4
votes
1answer
114 views

Open source tool comparable to MATLAB Neural Network Tool Box?

Background I am a graduate student and a researcher. I do not like to rely on commercial products due to cost and also because I feel more comfortable in using and extending existing tools based on ...
3
votes
0answers
58 views

scipy.linalg.sparse.eigsh does not work for generalised eigenvalues

I asked this question over at StackOverflow and someone told me that I'd get a better answer here. So here's my problem: I'm working on a machine learning project which involves doing a Principal ...
4
votes
2answers
602 views

Plot integral function with scipy and matplotlib

I want to plot a numerical integral function of some function $f$ using scipy and matplotlib. How can I do this? I tried the ...
1
vote
2answers
138 views

Programming language for HPC [closed]

I'm planning on building a program that will carry out HPC. I'm aware that C/C++ is significantly better than Python in terms of the speed of computation. However, I'm not yet proficient in C/C++, so ...
3
votes
1answer
188 views

Python Vectorizing a Function Returning an Array

I have the following function that has been vectorized so that for every element in input array t, an array is output: ...
0
votes
0answers
46 views

Solving a nonlinear problem with CDF

I'm trying to solve this problem: $\begin{cases} \partial_t E=-k\left([f(\rho)-i.\left[\delta+\frac{1}{2}a\left[\dfrac{\nabla^2_{\bot}}{4}+1-\rho^2\right]\right]]E - 2CP\right)\\ \partial_t P=-\...
5
votes
2answers
99 views

How to read the number of periods of this complicated graph?

I have two data sets that are quasi-periodic. They have the same period and can be seen clearly by eye. For example when $x\in(100,200)$, both of them have about 32 periods. Below is a zoom-in of ...
1
vote
1answer
35 views

How to use compiled python packages for matrix initialization

Assume I have an expression for an matrix initialization, for example the following: A[i,i-2*j+k] = B[i-k] * C[i] * D[i+j+k] In order to execute such a process, I could loop over all i, j and k. ...
0
votes
1answer
136 views

Finite-difference approximation of the 2nd derivative operator matrix for a staggered grid

I'm working on a computational physics assignment and I was looking for some help as I've got stuck! The question is: Write a function to create the finite-difference approximation of the 2nd ...
2
votes
0answers
112 views

Is it worth switching to timesteppers provided by PETSc if I can't write down a Jacobian for my problem? Case study with “the amoeba” toy problem

I am considering using petsc4py instead of scipy.integrate.odeint (which is a wrapper for Fortran solvers) for a problem ...
1
vote
2answers
332 views

Multiple Coupled Differential Equation solution in Python

I have 4 ordinary differential equations that are coupled. The variables in the 4 equations are functions of time and space and one of them is second order in space. \begin{equation} \frac{ \partial ...
1
vote
1answer
184 views

Heat Equation - PDE

I'm trying to model the Black-Scholes Equation (transformed into a heat equation) using method of lines in Python. The transformed formula is basically \begin{equation*} \frac{\partial u}{\partial ...
0
votes
0answers
118 views

Inverse quadratic method only makes one iteration - python

I'm tryin' to implement this method with python3 but i don't solve the problem. This is my code: ...
3
votes
2answers
89 views

How to separate text from the paper on a black and white page?

I tried to discretize an image into black and white and came into some difficult. The difference between the letters and paper is pretty clear to our eyes: However a simple thresholding trick ...
0
votes
2answers
182 views

Wave Equation PDE [closed]

I'm trying to solve the following PDE wave equation using method of lines: Wave Equation: u_tt = u_xx with initial condition: u(0,x) = sin*pi,u_t(0,x)=0, 0 < x < 1 boundary ...
3
votes
2answers
233 views

Hyperbolic Equation PDE (Python)

I'm trying to solve the following first order hyperbolic PDE problem using method of lines: Hyperbolic Equation: $u_t = -u_x$ with initial condition: $u(0,x) = 0, 0 < x < 1$ ...