Python solver of the equation presented below usining Finite Element Method. User should pass number of subdomains as input during operation of the program.
Mathematical paper with calculations used to obtain matrix form of the problem can be found there.
Plot of the solution calculated using this script where input value was 200.
As G = 6.67 * 10-11 which is approximately 0, the plot of the solution has to be a line segment. Try changing G value to see that the script actually calculates the solution correctly. Below plot of the solution where G=2 and input value was 200.