Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. -22.0780076747 = A + B*2^{-x}
  2. -24.3957157406 = A + B*3^{-x}
  3. -25.4414515613 = A + B*4^{-x}
  4.  
  5. #!/usr/bin/env python
  6. import numpy as np
  7. from scipy.optimize import root
  8.  
  9. def your_funcs(X):
  10.  
  11. A, B, x = X
  12.  
  13. f = [21.7424698112-A-B*(1/2**x),
  14. 22.4531418345-A-B*(1/3**x),
  15. 23.8033967265-A-B*(1/4**x)]
  16.  
  17. return f
  18.  
  19. sol = root(your_funcs, [1.0, 1.0, 1.0])
  20. print(sol.x)
  21.  
  22. [ 22.66633613 -50.69139062 105.89893632]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement