Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 566014.7604 6575670.0925 52.5728
- 566016.8032 6575663.6837 51.9256
- 566018.8461 6575657.2748 51.3135
- 566020.8889 6575650.8659 50.7367
- 566022.9318 6575644.4571 50.1951
- 566024.9746 6575638.0482 49.6888
- 566027.0175 6575631.6394 49.2176
- 566029.0603 6575625.2305 48.7816
- 566031.1032 6575618.8216 48.3808
- 566033.1460 6575612.4128 48.0153
- 566035.1888 6575606.0039 47.6849
- 566037.2317 6575599.5950 47.3898
- 566039.2745 6575593.1862 47.1298
- 566041.3174 6575586.7773 46.9051
- 566043.3602 6575580.3684 46.7155
- 566045.4031 6575573.9596 46.5612
- 566047.4459 6575567.5507 46.4421
- 566049.4888 6575561.1418 46.3582
- 566051.5316 6575554.7330 46.3095
- 566053.5745 6575548.3241 46.2960
- 566055.6173 6575541.9152 46.3177
- 566057.6602 6575535.5064 46.3746
- 566059.7030 6575529.0975 46.4667
- 566061.7459 6575522.6886 46.5940
- 566063.7887 6575516.2798 46.7566
- 566065.8315 6575509.8709 46.9543
- 566067.8744 6575503.4620 47.1873
- 566069.9172 6575497.0532 47.4554
- 566071.9601 6575490.6443 47.7588
- 566074.0029 6575484.2354 48.0973
- 566076.0458 6575477.8266 48.4711
- 566078.0886 6575471.4177 48.8801
- 566080.1315 6575465.0088 49.3242
- 566082.1743 6575458.6000 49.8036
- 566084.2172 6575452.1911 50.3182
- 566086.2600 6575445.7823 50.8680
- 566088.3029 6575439.3734 51.4530
- 566090.3457 6575432.9645 52.0732
- 566092.3886 6575426.5557 52.7287
- 566094.4450 6575420.1510 53.4190
- import sympy as sp
- import numpy as np
- from IPython.display import display
- import matplotlib.pyplot as plt
- #init_printing(use_unicode=False, wrap_line=False, no_global=True)
- x,x0,y0,A=sp.symbols('x x_0 y_0, A', real=True)
- sp.init_printing()
- expr=(A*sp.cosh((x-x0)/A)+y0-A)**2
- new_expr=(A*(sp.exp((x-x0)/A)+sp.exp(-(x-x0)/A))/2+y0-A)**2
- diff_of_expr=sp.simplify(sp.diff(expr, x))
- diff_of_new_expr=sp.simplify(sp.diff(new_expr, x))
- solution=sp.solvers.solve(diff_of_expr, x)
- print('DERIVATIVE OF')
- display(expr)
- print('OR alternatively')
- display(new_expr)
- print('IN x IS:')
- display(diff_of_expr)
- print('OR alternatively:')
- display(diff_of_new_expr)
- #sp.nonlinsolve has lost
- print('ROOTS OF THIS EXPRESSION IS:')
- display(solution)
- print('THIS EXPRESSIONS IS WHAT WE''VE GOT SETTING SOLUTIONS INTO EXPRESSION:')
- print('-'*80)
- for n in solution:
- display(diff_of_expr.subs(x, n))
- print('AFTER SIMPLIFICATIONS:')
- display(sp.simplify(diff_of_expr.subs(x, n)))
- if not(sp.simplify(diff_of_expr.subs(x, n))==0):
- print('TRYING TO RESOLVE:')
- display(sp.simplify(diff_of_new_expr.subs(x, n)))
- print('-'*80)
- #solution must return minimum value of x
- '''
- s=np.linspace(0,4,100)
- _x0,_y0,_A=2,3,1
- plt.plot(s,_A*np.cosh((s-_x0)/_A)+_y0-_A)
- _A=2
- plt.plot(s,_A*np.cosh((s-_x0)/_A)+_y0-_A)
- _A=3
- plt.plot(s,_A*np.cosh((s-_x0)/_A)+_y0-_A)
- plt.show()'''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement