def capacity_hansen_1970(sl, fd, h_l=<NUM_LIT:0>, h_b=<NUM_LIT:0>, vertical_load=<NUM_LIT:1>, slope=<NUM_LIT:0>, base_tilt=<NUM_LIT:0>, verbose=<NUM_LIT:0>, **kwargs):
if not kwargs.get("<STR_LIT>", False):<EOL><INDENT>models.check_required(sl, ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>"])<EOL>models.check_required(fd, ["<STR_LIT>", "<STR_LIT:width>", "<STR_LIT>"])<EOL><DEDENT>area_foundation = fd.length * fd.width<EOL>horizontal_load = np.sqrt(h_l ** <NUM_LIT:2> + h_b ** <NUM_LIT:2>)<EOL>c_a = <NUM_LIT> - <NUM_LIT:1.0> * sl.cohesion<EOL>fd.nq_factor = ((np.tan(np.pi / <NUM_LIT:4> + sl.phi_r / <NUM_LIT:2>)) ** <NUM_LIT:2> * np.exp(np.pi * np.tan(sl.phi_r)))<EOL>if sl.phi_r == <NUM_LIT:0>:<EOL><INDENT>fd.nc_factor = <NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>fd.nc_factor = (fd.nq_factor - <NUM_LIT:1>) / np.tan(sl.phi_r)<EOL><DEDENT>fd.ng_factor = <NUM_LIT> * (fd.nq_factor - <NUM_LIT:1>) * np.tan(sl.phi_r)<EOL>if sl.phi_r == <NUM_LIT:0>:<EOL><INDENT>s_c = <NUM_LIT> * fd.width / fd.length<EOL><DEDENT>else:<EOL><INDENT>s_c = <NUM_LIT:1.0> + fd.nq_factor / fd.nc_factor * fd.width / fd.length<EOL><DEDENT>s_q = <NUM_LIT:1.0> + fd.width / fd.length * np.sin(sl.phi_r)<EOL>s_g = <NUM_LIT:1.0> - <NUM_LIT> * fd.width / fd.length<EOL>if fd.depth / fd.width > <NUM_LIT:1>:<EOL><INDENT>k = np.arctan(fd.depth / fd.width)<EOL><DEDENT>else:<EOL><INDENT>k = fd.depth / fd.width<EOL><DEDENT>d_c = <NUM_LIT:1> + <NUM_LIT> * k<EOL>if sl.phi == <NUM_LIT:0>:<EOL><INDENT>d_c = <NUM_LIT> * k<EOL><DEDENT>d_q = <NUM_LIT:1> + <NUM_LIT:2> * np.tan(sl.phi_r) * (<NUM_LIT:1> - np.sin(sl.phi_r)) ** <NUM_LIT:2> * k<EOL>d_g = <NUM_LIT:1.0><EOL>if sl.phi_r == <NUM_LIT:0>:<EOL><INDENT>i_q = <NUM_LIT:1.0><EOL>i_c = <NUM_LIT:0.5> - <NUM_LIT:0.5> * np.sqrt(<NUM_LIT:1> - horizontal_load / area_foundation * c_a)<EOL>i_g = <NUM_LIT:1.0><EOL><DEDENT>else:<EOL><INDENT>i_q = ((<NUM_LIT:1.0> - <NUM_LIT:0.5> * horizontal_load /<EOL>(vertical_load + area_foundation * c_a / np.tan(sl.phi_r))) ** <NUM_LIT:5>)<EOL>i_c = i_q - (<NUM_LIT:1> - i_q) / (fd.nq_factor - <NUM_LIT:1>)<EOL>i_g = ((<NUM_LIT:1> - (<NUM_LIT> * horizontal_load) /<EOL>(vertical_load + area_foundation * c_a / np.tan(sl.phi_r))) ** <NUM_LIT:5>)<EOL><DEDENT>if sl.phi_r == <NUM_LIT:0>:<EOL><INDENT>g_c = (slope / np.pi * <NUM_LIT>) / <NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>g_c = <NUM_LIT:1.0> - (slope / np.pi * <NUM_LIT>) / <NUM_LIT><EOL><DEDENT>g_q = <NUM_LIT:1> - <NUM_LIT:0.5> * np.tan(slope) ** <NUM_LIT:5><EOL>g_g = g_q<EOL>if sl.phi_r == <NUM_LIT:0>:<EOL><INDENT>b_c = (base_tilt / np.pi * <NUM_LIT>) / <NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>b_c = <NUM_LIT:1.0> - (base_tilt / np.pi * <NUM_LIT>) / <NUM_LIT><EOL><DEDENT>b_q = (np.exp(-<NUM_LIT> * (base_tilt / np.pi * <NUM_LIT>) * np.tan(sl.phi_r)))<EOL>b_g = (np.exp(-<NUM_LIT> * (base_tilt / np.pi * <NUM_LIT>) * np.tan(sl.phi_r)))<EOL>if verbose:<EOL><INDENT>log("<STR_LIT>", fd.nc_factor)<EOL>log("<STR_LIT>", fd.nq_factor)<EOL>log("<STR_LIT>", fd.ng_factor)<EOL>log("<STR_LIT>", s_c)<EOL>log("<STR_LIT>", s_q)<EOL>log("<STR_LIT>", s_g)<EOL>log("<STR_LIT>", d_c)<EOL>log("<STR_LIT>", d_q)<EOL>log("<STR_LIT>", d_g)<EOL>log("<STR_LIT>", i_c)<EOL>log("<STR_LIT>", i_q)<EOL>log("<STR_LIT>", i_g)<EOL>log("<STR_LIT>", g_c)<EOL>log("<STR_LIT>", g_q)<EOL>log("<STR_LIT>", g_g)<EOL>log("<STR_LIT>", b_c)<EOL>log("<STR_LIT>", b_q)<EOL>log("<STR_LIT>", b_g)<EOL><DEDENT>q_d = sl.unit_dry_weight * fd.depth<EOL>if sl.phi_r == <NUM_LIT:0>:<EOL><INDENT>fd.q_ult = (sl.cohesion * fd.nc_factor *<EOL>(<NUM_LIT:1> + s_c + d_c - i_c - g_c - b_c) + q_d)<EOL><DEDENT>else:<EOL><INDENT>fd.q_ult = (sl.cohesion * fd.nc_factor *<EOL>s_c * d_c * i_c * g_c * b_c +<EOL>q_d * fd.nq_factor * s_q * d_q * i_q * g_q * b_q +<EOL><NUM_LIT:0.5> * fd.width * sl.unit_dry_weight *<EOL>fd.ng_factor * s_g * d_g * i_g * g_g * b_g)<EOL><DEDENT>
Calculates the foundation capacity according Hansen (1970)
Ref: http://bestengineeringprojects.com/civil-projects/
hansens-bearing-capacity-theory/

:param sl: Soil object
:param fd: Foundation object
:param h_l: Horizontal load parallel to length
:param h_b: Horizontal load parallel to width
:param vertical_load: Vertical load
:param slope: ground slope
:param base_tilt: The slope of the underside of the foundation
:param verbose: verbosity
:return: ultimate bearing stress