def size_footing_for_capacity(sl, vertical_load, fos=<NUM_LIT:1.0>, length_to_width=<NUM_LIT:1.0>, verbose=<NUM_LIT:0>, **kwargs):
method = kwargs.get("<STR_LIT>", '<STR_LIT>')<EOL>depth_to_width = kwargs.get("<STR_LIT>", <NUM_LIT:0>)<EOL>depth = kwargs.get("<STR_LIT>", <NUM_LIT:0>)<EOL>use_depth_to_width = <NUM_LIT:0><EOL>if not depth:<EOL><INDENT>use_depth_to_width = <NUM_LIT:1><EOL><DEDENT>fd = models.FoundationRaft()<EOL>fd.width = <NUM_LIT>  <EOL>for i in range(<NUM_LIT:50>):<EOL><INDENT>fd.length = length_to_width * fd.width<EOL>if use_depth_to_width:<EOL><INDENT>fd.depth = depth_to_width * fd.width<EOL><DEDENT>capacity_method_selector(sl, fd, method)<EOL>q = fd.q_ult<EOL>bearing_capacity = q * fd.length * fd.width<EOL>fs_actual = bearing_capacity / vertical_load<EOL>if fs_actual < fos:<EOL><INDENT>fd.width += <NUM_LIT:0.5><EOL><DEDENT>else:<EOL><INDENT>if verbose:<EOL><INDENT>log("<STR_LIT>", fs_actual)<EOL>log("<STR_LIT>", fd.width)<EOL><DEDENT>break<EOL><DEDENT><DEDENT>width_array = []<EOL>fs_array = []<EOL>for j in range(<NUM_LIT:11>):<EOL><INDENT>width_array.append(fd.width)<EOL>fd.length = length_to_width * fd.width<EOL>if use_depth_to_width:<EOL><INDENT>fd.depth = depth_to_width * fd.width<EOL><DEDENT>capacity_method_selector(sl, fd, method)<EOL>q = fd.q_ult<EOL>capacity = q * fd.length * fd.width<EOL>fs_array.append(capacity / vertical_load)<EOL>fd.width = fd.width - <NUM_LIT:0.5> / <NUM_LIT:10><EOL><DEDENT>if verbose:<EOL><INDENT>log("<STR_LIT>", fos)<EOL>log("<STR_LIT>", width_array)<EOL>log("<STR_LIT>", fs_array)<EOL><DEDENT>for fs in range(len(fs_array)):<EOL><INDENT>if fs_array[fs] < fos:<EOL><INDENT>fd.width = width_array[fs - <NUM_LIT:1>]<EOL>fd.length = length_to_width * fd.width<EOL>if use_depth_to_width:<EOL><INDENT>fd.depth = depth_to_width * fd.width<EOL><DEDENT>capacity_method_selector(sl, fd, method)<EOL>break<EOL><DEDENT>if fs == len(fs_array) - <NUM_LIT:1>:<EOL><INDENT>DesignError("<STR_LIT>")<EOL><DEDENT><DEDENT>return fd<EOL>
Determine the size of a footing given an aspect ratio and a load
:param sl: Soil object
:param vertical_load: The applied load to the foundation
:param fos: The target factor of safety
:param length_to_width: The desired length to width ratio of the foundation
:param verbose: verbosity
:return: a Foundation object