All Questions
23 questions
2
votes
2
answers
109
views
Creating a short, d-dense list of points on the sphere S^4 in Python
I am a mathematician and this is my first time using Stack Overflow, sorry if the question is not adequate or there is some better place to ask this. I would like to know if there is a standard way ...
0
votes
0
answers
410
views
How the mod() function works internally in languages like Java, Python, etc?
in Java or Python this function is given by the % operator.
I would like to know the mathematical algorithm that uses this function.
0
votes
1
answer
312
views
Minimize number of shops while reaching all customers
In this particular issue, I have an imaginary city divided into squares - basically a MxN grid of squares covering the city. M and N can be relatively big, so I have cases with more than 40,000 square ...
1
vote
0
answers
431
views
Efficient algorithm to find number density of points in 3D space
I have the position data for particles in 3D space. The particles are in random positions in the 3D box and I am trying to find the position of the maximum number density. Is there a simple algorithm ...
2
votes
1
answer
2k
views
Finding Fourier coefficients algorithm
Ok, so I have been trying to code a "naive" method to calculate the coefficients for a standard Fourier Series in complex form. I am getting very close, I think, but there are some odd behaviors. This ...
2
votes
1
answer
96
views
How to use positional arguments appropriately for a complex problem
I am revisiting a school project, which I did not complete to my satisfaction. Namely, I wrote an algorithm that takes an ALMOST arbitrary size set of equations and solves them iteratively. The ...
2
votes
1
answer
889
views
Fastest algorithm for computing 3-D curl
I'm trying to write a section of code that computes the curl of a vector field numerically to second order with periodic boundary conditions. However, the algorithm I made is very slow and I'm ...
14
votes
2
answers
2k
views
Solving PDE with implicit euler in python - incorrect output
I will try and explain exactly what's going on and my issue.
This is a bit mathy and SO doesn't support latex, so sadly I had to resort to images. I hope that's okay.
I don't know why it's inverted, ...
-1
votes
1
answer
2k
views
Algorithms to find min/max of a single variable function in fixed domain
I was looking for a numerical algorithm to find global minimum or maximum of a function in "given interval [a, b]", for example finding minimum and maximum of function
f(x) = sin(x)
in domain [3*pi/...
-1
votes
1
answer
2k
views
How are 2nd order ODEs solved in python? With two variables in each of two second order differentials?
I have been given two second order ODEs and I've been asked to solve them with odeint in python.
These are the equations:
d^x(t)/dt^2 = 10dy(t)/dt + x(t) - (k + 1)(x(t))/z^3
d^2y(t)/dt^2 = - 10dy(t)...
3
votes
0
answers
378
views
Gradient Descent code used to minimize a convex function not finding minima
I am trying to find the geometric median for a set of of n points. For this I have to minimize the sum of sqrt((x-xn)^2+(y-yn)^2).
To do this I decided to try a method of Gradient Descents. The ...
1
vote
1
answer
326
views
Approximating an unknown value in Python
I need to approximate an unknown value, a bound that separates divergent values from those that converge.
I'm trying to do so like this:
# dont worry about the value of i, its one of many bounds ...
-1
votes
4
answers
3k
views
Using Python for loop to solve an equation with numerical method
I am learning Python and Probabilities.
I have as a given that the expression:
c = n! /((n-1)!1!) + 2*n! /((n-2)*2!) + 3*n!/((n-3)*3!) + ...+ n*n!/((n-n)*n!
where 0! = 1 and ! signifies 'factorial', ...
1
vote
2
answers
2k
views
Divide a stream into bins with equal counts
Ideally, I want the following without reading the data from hard disk for too many times. The data is big and memory can't hold all of the data at the same time.
Input is a stream x[t] from hard disk. ...
5
votes
4
answers
389
views
Construct an array spacing proportional to a function or other array
I have a function (f : black line) which varies sharply in a specific, small region (derivative f' : blue line, and second derivative f'' : red line). I would like to integrate this function ...