adjustment = 2
power = 2
root = 0.34
linear = 0.98
initial = 330
def calculate(mass,power,root,linear,initial,adjustment):
result = power ** (-((mass/adjustment)**root))
value = (2 * initial) - (initial * result)
value += linear * mass
return value
# Ordinary loop.
mass = 0
while mass <= 6:
value = calculate(mass,power,root,linear,initial,adjustment)
print(int(value))
mass += 0.25
### Icy planets.
##datapoints = []
##datapoints.append([0.0161,374])
##datapoints.append([0.3202,435])
##datapoints.append([0.3391,437])
##datapoints.append([0.7693,461])
##datapoints.append([1.116,474])
##datapoints.append([1.9382,494])
##datapoints.append([2.6713,507])
##datapoints.append([5.3159,537])
##datapoints.append([7.2701,552])
##datapoints.append([22.149,615])
##datapoints.append([53.9221,677])
##datapoints.append([87.2401,715])
### ELW and WW/CFT
##datapoints = []
##datapoints.append([0.147,26344])
##datapoints.append([0.4208,28060])
##datapoints.append([0.4314,28105])
##datapoints.append([0.5042,28393])
##datapoints.append([0.6213,28765])
##datapoints.append([0.805,29314])
##datapoints.append([1.4701,30633])
##datapoints.append([1.4969,30674])
###AMW
##datapoints = []
##datapoints.append([0.1821,15989])
##datapoints.append([0.2204,16168])
##datapoints.append([0.3924,16751])
##datapoints.append([0.4394,16873])
##datapoints.append([0.4662,16938])
##datapoints.append([4.0172,19920])
##datapoints.append([49.6573,25488])
##datapoints.append([103.9279,27731])
##
### Main brute-force loop.
##results = []
##
##adjustment = 1.7
##while adjustment <= 2.5:
## initial = 325
## while initial <= 331:
## root = 0.3
## while root < 0.4:
##
## linear = 0
## while linear <= 1.5:
##
## goodfit = True
##
## for datapoint in datapoints:
## mass = datapoint[0]
## value = datapoint[1]
## gval = calculate(mass, power, root, linear, initial, adjustment)
## gdif = value - gval
## #print(mass,int(gval),int(gdif))
## if gval < (value - 4) or gval > (value + 4):
## goodfit = False
## break
##
## if goodfit == True:
## print(initial,round(root,3),round(linear,3),round(adjustment,3))
## results.append([initial,root,linear,adjustment])
##
## linear += 0.001
##
## root += 0.001
## initial += 1
## adjustment += 0.01
## print(round(adjustment,3))
##
##print('Done')
##
##for result in results:
## print(result[0],round(result[1],3),round(result[2],3),round(result[3],3))
# HMC
# Good fit: adjustment = 1
# power = 2, root = 1/3.4
# linear = 10, initial = 2000
# Std. GG
# Good fit: adjustment = 150
# power = 2, root = 1/2
# linear = 0.055, initial = 500
# GG Class I
# Good fit: adjustment = 150
# power = 2, root = 1/2
# linear = 0.2, initial = 1000
# WW
# Reasonable: adjustment = 1
# power = 2, root = 1/3
# linear = 30, initial = 8500
# ELW and WW/CFT
# Good fit: adjustment = 2.69
# power = 2, root = 0.33
# linear = 16, initial = 21350
# AMW
# Reasonable: adjustment = 5.5
# power = 2, root = 0.371
# linear = 22, initial = 13600
# Icy
# Good fit: adjustment = 2
# power = 2, root = 0.34
# linear = 0.98, initial = 330