Target function created
Restrictions added
The problem is what initial premise I use, minimization functions just keep using that number. for example: if I use 15 for the initial guess, then the solver will not try another number and say that the answer is 15. I'm sure the problem is with the code, but I'm not sure where.
CODE BELOW:
from scipy.optimize import minimize import numpy as np from pandas import *
List of possible values:
2 = 0.142857142857,
3 = 0.25641025641,
4 = 0.333333333333333,
5 = 0.363636363636,
6 = 0.333333333333333,
7 = 0.31746031746,
8 = 0.3125,
9 = 0.31746031746,
10 = 0.333333333333333,
11 = 0.363636363636,
12 = 0.416666666667,
13 = 0.487179487179,
14 = 0.571428571429,
15 = 0.666666666667
source share