Advertisement
miklis

titled

Feb 20th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. 566014.7604 6575670.0925 52.5728
  2. 566016.8032 6575663.6837 51.9256
  3. 566018.8461 6575657.2748 51.3135
  4. 566020.8889 6575650.8659 50.7367
  5. 566022.9318 6575644.4571 50.1951
  6. 566024.9746 6575638.0482 49.6888
  7. 566027.0175 6575631.6394 49.2176
  8. 566029.0603 6575625.2305 48.7816
  9. 566031.1032 6575618.8216 48.3808
  10. 566033.1460 6575612.4128 48.0153
  11. 566035.1888 6575606.0039 47.6849
  12. 566037.2317 6575599.5950 47.3898
  13. 566039.2745 6575593.1862 47.1298
  14. 566041.3174 6575586.7773 46.9051
  15. 566043.3602 6575580.3684 46.7155
  16. 566045.4031 6575573.9596 46.5612
  17. 566047.4459 6575567.5507 46.4421
  18. 566049.4888 6575561.1418 46.3582
  19. 566051.5316 6575554.7330 46.3095
  20. 566053.5745 6575548.3241 46.2960
  21. 566055.6173 6575541.9152 46.3177
  22. 566057.6602 6575535.5064 46.3746
  23. 566059.7030 6575529.0975 46.4667
  24. 566061.7459 6575522.6886 46.5940
  25. 566063.7887 6575516.2798 46.7566
  26. 566065.8315 6575509.8709 46.9543
  27. 566067.8744 6575503.4620 47.1873
  28. 566069.9172 6575497.0532 47.4554
  29. 566071.9601 6575490.6443 47.7588
  30. 566074.0029 6575484.2354 48.0973
  31. 566076.0458 6575477.8266 48.4711
  32. 566078.0886 6575471.4177 48.8801
  33. 566080.1315 6575465.0088 49.3242
  34. 566082.1743 6575458.6000 49.8036
  35. 566084.2172 6575452.1911 50.3182
  36. 566086.2600 6575445.7823 50.8680
  37. 566088.3029 6575439.3734 51.4530
  38. 566090.3457 6575432.9645 52.0732
  39. 566092.3886 6575426.5557 52.7287
  40. 566094.4450 6575420.1510 53.4190
  41.  
  42. import sympy as sp
  43. import numpy as np
  44. from IPython.display import display
  45. import matplotlib.pyplot as plt
  46. #init_printing(use_unicode=False, wrap_line=False, no_global=True)
  47. x,x0,y0,A=sp.symbols('x x_0 y_0, A', real=True)
  48. sp.init_printing()
  49.  
  50. expr=(A*sp.cosh((x-x0)/A)+y0-A)**2
  51. new_expr=(A*(sp.exp((x-x0)/A)+sp.exp(-(x-x0)/A))/2+y0-A)**2
  52. diff_of_expr=sp.simplify(sp.diff(expr, x))
  53. diff_of_new_expr=sp.simplify(sp.diff(new_expr, x))
  54. solution=sp.solvers.solve(diff_of_expr, x)
  55.  
  56. print('DERIVATIVE OF')
  57. display(expr)
  58. print('OR alternatively')
  59. display(new_expr)
  60. print('IN x IS:')
  61. display(diff_of_expr)
  62. print('OR alternatively:')
  63. display(diff_of_new_expr)
  64. #sp.nonlinsolve has lost
  65. print('ROOTS OF THIS EXPRESSION IS:')
  66. display(solution)
  67. print('THIS EXPRESSIONS IS WHAT WE''VE GOT SETTING SOLUTIONS INTO EXPRESSION:')
  68. print('-'*80)
  69. for n in solution:
  70. display(diff_of_expr.subs(x, n))
  71. print('AFTER SIMPLIFICATIONS:')
  72. display(sp.simplify(diff_of_expr.subs(x, n)))
  73. if not(sp.simplify(diff_of_expr.subs(x, n))==0):
  74. print('TRYING TO RESOLVE:')
  75. display(sp.simplify(diff_of_new_expr.subs(x, n)))
  76. print('-'*80)
  77. #solution must return minimum value of x
  78. '''
  79. s=np.linspace(0,4,100)
  80. _x0,_y0,_A=2,3,1
  81. plt.plot(s,_A*np.cosh((s-_x0)/_A)+_y0-_A)
  82. _A=2
  83. plt.plot(s,_A*np.cosh((s-_x0)/_A)+_y0-_A)
  84. _A=3
  85. plt.plot(s,_A*np.cosh((s-_x0)/_A)+_y0-_A)
  86. plt.show()'''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement