All Questions
8 questions
8
votes
1
answer
1k
views
Genetic algorithm to guess coefficient of a polynomial
I have tried to code a genetic algorithm to guess the coefficients of a degree 4 polynomial. The information initially provided is values of y = f(x) for different x using the original polynomial. I ...
5
votes
3
answers
268
views
Optimizing an implementation of the RKF method
This is an algorithm regarding the RKF method:
...
3
votes
2
answers
3k
views
Implementing a Steepest Descent Algorithm
I am teaching myself some coding, and as my first "big" project I tried implementing a Steepest Descent algorithm to minimize the Rosenbrock function:
$$f(x, y) = 100 (y - x^2)^2 + (1 - x)^2$$
The ...
7
votes
1
answer
236
views
Implementing numerical integration in Python
I have this Python code that implements a rectangular numerical integration. It evaluates the (K-1)-dimensional integral for arbitrary integer \$K \geq 1\$
$$\int_{u_K = 0}^{\gamma}\int_{u_{K-1} = 0}^...
6
votes
2
answers
8k
views
Compute a numerical derivative
Since I could not get numpy.gradient() to compute a derivative successfully, I wrote a script to compute it manually. Running the script below will output a plot of ...
4
votes
1
answer
338
views
Numerical differentiation on sphere with Python
I have ported from Fortran to Python an algorithm that calculates the numerical derivative along the x direction (longitudinal) of a scalar function s on a ...
5
votes
2
answers
497
views
Runge-Kutta 4th order using Python numexpr.evaluate()
I am implementing an ODE solver, where the user provides rates and coefficients as a string. ODE solver has to work with vectors. The best implementation I got so far is the following:
...
2
votes
1
answer
3k
views
Multivariable Gradient Descent in Numpy
Just recently started learning ML, first I've gone through the notes of Ng's Coursera stuff. While I have nothing against Octave, I'm trying to solve exercises in Python. It's my beginning with that ...