# Questions tagged [python]

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

746 questions
Filter by
Sorted by
Tagged with
22 views

### How do you correctly implement Scipy's FFT procedures to produce a low-pass filter - image processing

I'm following this low-pass filter example in the text "Image Operators: Image Processing in Python 1st Edition" by Jason M. Kinser, but can't seem to duplicate their results. The text's ...
33 views

### What is the meaning of triangles color in the result of Tipping Problem in scikit-fuzzy (fuzzy logic)?

I am following this example https://scikit-fuzzy.github.io/scikit-fuzzy/auto_examples/plot_tipping_problem_newapi.html from documentation of scikit-fuzzy library,but I have a question in the figure ...
24 views

### 2D DFT for lower frequencies only; is there something significantly faster than numpy.fft.fft2 (throwing away high frequencies)?

I do a lot of 2D discrete FFT in python using np.fft.fftshift(np.fft.fft2(y)), then throw away 90% or more of the array, keeping only the central low-frequency area....
90 views

### Is there a Python version of the ODE tool pplane?

This is the same question as this one, except for Python instead of Mathematica. Basically, the MATLAB software pplane is a staple in ODE courses. Is there a Python equivalent? Sample outputs from ...
35 views

### Is there a way to generate a sample $(X_i, Y_i, Z_i)$ from custom distribution?

I'm newbie here. I'm wondering if it's possible to generate $(X_i, Y_i, Z_i)$ from my own distribution function? I know that there is a way to make own class for 1D variable. But what about 3D case?
66 views

### Lagrange multiplier for boundary conditions in pure Neumann problem

I'm trying to solve $-u''=\cos(2 \pi x)$ with boundary conditions $u'(0)=u'(1)=0$ and the constraint $\int_{0}^1 u = 0$ I have to use linear finite elements, so let's assume that I have $M$ degrees of ...
23 views

### Curve Fitting convoluted-exponential-gaussian-probability-function from Igor Pro

So I recently created this post which I answered about plotting point from a convoluted-exponential-gaussian-probability function. from: Convoluted exponential gaussian probability function from Igor ...
27 views

### Can constants and parameters in a Gekko model be simply Python variables?

I'm new to Gekko and I noticed that Gekko will still run even if I don't define fixed values in my model as Gekko constants and parameters. For example, this code still runs and gives an answer: ...
116 views

### How to compute the Eigenvalue and Eigenstates of Quantum well with Effective mass using finite difference method in Python?

I want to compute the eigenvalues and eigenstates of a quantum well with different effective masses of electron in the barrier and in the quantum well. As can be seen : https://github.com/mholtrop/...
105 views

### solve_ivp from scipy does not integrate the whole range of tspan

I'm trying to use solve_ivp from scipy in Python to solve an IVP. I specified the tspan ...
105 views

### Computation of the tensor of curvature on surface mesh

Is there a formula which enables the computation the tensor of curvature knowing the following at each vertex and cell of a triangulated mesh: Normal vector Two arbitrary vectors in the tangent space ...
88 views

...
28 views

### Logistic growth curve using scipy is not quite right

I'm trying to fit a simple logistic growth model to dummy data using Python's Scipy package. The code is shown below, along with the output that I get. The correct ...
209 views

### Storing large amounts of interpolation data

Overview and Prior Research I am looking for a way store a (in principle arbitrarily) large "3D-table" for interpolation/ lookup in combination with python. I have considered CSV files, but,...
39 views

### Numerically solving schrodinger equation [duplicate]

Consider the potential given above: $$U(r) = \frac{U_0}{\exp[(r - r_0)/\epsilon] + 1}\, .$$ How to solve the Schrodinger equation with this potential numerically and find the eigenvalues?
146 views

### Why Is This Python Code Faster Than Fortran Wrapper with F2PY?

I am writing a proof-of-concept implementation of Newton's method for minimizing the negative log-likelihood term in a logistic regression model. I'm comparing the performance of a native python ...
47 views

### Help with restart functionnality in sef-made GMRES solver in python

I am new to this forum and to computational science in general. I started to learn numerical liner algebra on my own and would like to code a GMRES solver in python (no preconditioner for the time ...