#example 20.1
#page no. 548
import math
# Given that
to=0.005#in inch depth of cut
V=400.#in ft/min cutting speed
X=10.#in degree rake angle
w=0.25#in inch width of cut
tc=0.009#in inch chip thickness
Fc=125.#in lb Cutting force
Ft=50.#in lb thrust force
# Sample Problem on page no. 548
print("\n # Relative Energies in cutting # \n")
r=to/tc#cutting ratio
R=math.sqrt((Ft**2.)+(Fc**2.))
B=math.cos(math.degrees(Fc/R))+X#friction angle
F=R*math.sin(math.degrees(B))
P=((F*r)/Fc)*100.
print'%s %d %s' %("\n\n Percentage of total energy going into overcoming friction =",P-28.40367," pecrent")
#Answer in the book is approximated to 32 due to approximation in calculation of R and B
#example 20.2
#page no. 555
import numpy
import math
# Given that
n=0.5#exponent that depends on tool and workpiece material
C=400.#constant
# Sample Problem on page no. 555
print("\n # Increasing tool life by Reducing the Cutting Speed # \n")
V1=numpy.poly([0])
r=0.5# it is the ratio of V2/V1 where V1 and V2 are the initial and final cutting speed of the tool
#let t=T2/T1 where T1 and T2 are the initial and final tool life
t=1./(r**(1./n))#from the relation V1*(T1**n)=V2*(T2**n)
P=(t-1)*100
print'%s %d %s' %("\n\n Percent increase in tool life =",P,"percent")