fork download
  1. import math
  2.  
  3. def params(x_range, y0, y1, y2): #y1 in the middle
  4. t = (y2 - y0) / (y1 - y0) - 1
  5. c = math.log(t) * 2 / x_range
  6. b = (y1 - y0) / (t - 1)
  7. a = 1 - b
  8. return a, b, c
  9.  
  10. def formula(x,a,b,c):
  11. return(a + b * math.exp(x * c))
  12.  
  13. a,b,c = params(100, 1, 200000, 1931946)
  14. print(a, b, c)
  15.  
  16. for i in range(0, 101, 10):
  17. print(i, formula(i, a, b, c))# your code goes here
Success #stdin #stdout 0.02s 9180KB
stdin
Standard input is empty
stdout
-26109.302772223844 26110.302772223844 0.043173770885434115
0 1.0
10 14098.765851726315
20 35808.35465870108
30 69239.62675705353
40 120721.4841082625
50 199999.99999999994
60 322083.45629645145
70 510083.57377646235
80 799590.8112409151
90 1245412.0249069682
100 1931945.9999999988