Skip to main content

All Questions

0 votes
0 answers
45 views

Why doesn’t the barycenter method detect subpixel displacements where correlation does?

I’m working with X-ray imaging data. I have a reference image containing a structured pattern, and a sample image where this pattern is slightly distorted due to the presence of a physical sample. My ...
PortorogasDS's user avatar
3 votes
5 answers
233 views

Why no floating point error occurs in print(0.1* 100000) vs (Decimal(0.1)*100000) due to FP representation of 0.1?

I am studying numerical analysis and I have come across this dilemma. Running the following script, from decimal import Decimal a = 0.1 ; N = 100000 ; # product calculation P = N*a # Print product ...
Nicola Sergio's user avatar
2 votes
2 answers
97 views

Find correct root of parametrized function given solution for one set of parameters

Let's say I have a function foo(x, a, b) and I want to find a specific one of its (potentially multiple) roots x0, i.e. a value x0 such that foo(x0, a, b) == 0. I know that for (a, b) == (0, 0) the ...
schtandard's user avatar
-1 votes
0 answers
18 views

PySHtools library script

I have two perfectly defined sets of SH coefficients obtained through rigorous models in two text files. I have read that PyShtools has the necessary classes and functions to plot them in a restricted ...
Miguel Miranda's user avatar
0 votes
0 answers
53 views

Phase Portrait of Coupled ODEs Not Matching Expected Graph in Python (SciPy)

I’m trying to generate a phase portrait for a system of coupled ordinary differential equations (ODEs) using Python’s scipy.integrate.solve_ivp. The system models the frequency of cooperators (x) and ...
Emon Hossain's user avatar
0 votes
1 answer
50 views

Producing bifurcation diagram of logistic map including unstable points

I'm trying to produce a bifurcation diagram such as this one. Typical bifurcation diagrams only include stable fixed points, which are attractive (nearby points get pulled towards the fixed point upon ...
Koen's user avatar
  • 1
0 votes
1 answer
62 views

Difference in output of sympy.binomial vs scipy.special.comb

Why does the following code that calls comb produce the wrong output? from scipy.special import comb from sympy import binomial def coup(n=100, m=10): expectation = 0 for j in range(1, n + 1): ...
bettersayhello's user avatar
0 votes
0 answers
45 views

How to simulate in python the superconducting density of states of a BCS superconductor with YSR (yu-shiba-rusinov) with 1D chain tight binding model

I try to simulate the following problem: Compute the density of states numerically of a BCS superconductor with magnetic impurities using the tight binding model of 1D chain with periodically border ...
ivana curci's user avatar
0 votes
0 answers
80 views

Minimum image convention for a MD simulation in Python

I'm trying to implement a simple molecular dynamic simulation in Python for N atoms with periodic boundary conditions using minimum image convention. Here is my code: import numpy as np import ...
Lana.s's user avatar
  • 47
0 votes
0 answers
33 views

Simple MD simulation for N atoms with PBC in Python

I'm trying to implement a simple molecular dynamic simulation in Python for N atoms with periodic boundary conditions while allowing coordinate wrapping to visualize the atoms interacting through ...
Lana.s's user avatar
  • 47
0 votes
1 answer
65 views

Molecular dynamic simulation using velocity verlet in Python

I'm trying to implement a simple MD simulation in Python (I'm new to this),I'm using LJ potential and force equations along with Verlet method. I posted another question about the same code yesterday ...
Lana.s's user avatar
  • 47
1 vote
1 answer
50 views

MD simulation using velocity verlet in Python

I'm trying to implement a simple MD simulation in Python (I'm new to this),I'm using LJ potential and force equations along with Verlet method: def LJ_VF(r): #r = distance in Å #Returns V in (...
Lana.s's user avatar
  • 47
0 votes
1 answer
35 views

Steps approximation for time series scatter with mean changing every K number of steps using BIC

First, the synthetic data used is generated the following the way: import sympy as sp import numpy as np import matplotlib.pyplot as plt import random import math np.random.seed(2) n_samples = 180 ...
Mea12's user avatar
  • 71
0 votes
0 answers
35 views

Optimizing a numerical integration that involves matrices using sympy

The expression I'm integrating is Where the latent variables are sampled from the a multivariate distribution as following: And the random variables w_n given a latent variable is sampled from a ...
Mea12's user avatar
  • 71
2 votes
1 answer
89 views

How to solve the derivative of the expression with respect to D?

The integral is Where the variables follow the following distribution: Thus, the integral becomes: Now, my code in python is to integrate the expression with \(W_{1:3}\) being \(1,2,3\) ...
Mea12's user avatar
  • 71

15 30 50 per page
1
2 3 4 5
51