Short answer
To calculate shallow-foundation bearing capacity in Python, call bearing_capacity from the open-source geoeq library with c, gamma, Df, B and phi. For a 2 m strip footing at 1.5 m depth on c = 25 kPa, phi = 30 degrees soil, the Meyerhof method gives q_u = 1829.29 kPa.
Steps
- 01
Install geoeq and define the inputs
Install the library, import it, and put the soil and footing data in one dictionary so the same inputs can be reused. The values are c = 25 kPa, phi = 30 degrees, gamma = 18 kN/m3, Df = 1.5 m and B = 2 m. With no L given, geoeq treats the footing as a strip.
# in a terminal: pip install geoeq import geoeq as ge inputs = dict(c=25, gamma=18, Df=1.5, B=2, phi=30) - 02
Calculate the ultimate bearing capacity
bearing_capacity returns a dictionary. The q_u entry is the ultimate bearing pressure in kPa. With method set to meyerhof, it prints 1829.29.
result = ge.bearing_capacity(**inputs, method="meyerhof") print(round(result["q_u"], 2)) # 1829.29 - 03
Read the bearing capacity factors
The same dictionary holds the factors used. Nc, Nq and Ngamma print as 30.14, 18.4 and 15.67 for phi = 30 degrees. The depth factors dc, dq and d_gamma print as 1.26, 1.13 and 1.13. The shape factors are 1.0 for a strip.
print(round(result["Nc"], 2), round(result["Nq"], 2), round(result["Ngamma"], 2)) # 30.14 18.4 15.67 print(round(result["dc"], 2), round(result["dq"], 2), round(result["d_gamma"], 2)) # 1.26 1.13 1.13 - 04
Convert to an allowable bearing pressure
bearing_allowable divides q_u by a factor of safety, 3.0 by default. With FS = 3 it prints 609.8 kPa. This is a bearing check only; settlement must be checked separately.
q_all = ge.bearing_allowable(result["q_u"], FS=3) print(round(q_all, 1)) # 609.8 - 05
Compare the four methods
The method argument accepts terzaghi, meyerhof, hansen and vesic. For the same inputs q_u is 1883.1, 1829.3, 1855.2 and 1987.2 kPa.
for m in ("terzaghi", "meyerhof", "hansen", "vesic"): print(m, round(ge.bearing_capacity(**inputs, method=m)["q_u"], 1)) # terzaghi 1883.1 # meyerhof 1829.3 # hansen 1855.2 # vesic 1987.2 - 06
Change the footing to a square
Pass L to describe a rectangular or square footing. With L = 2 m the shape factors sc, sq and s_gamma become 1.6, 1.3 and 1.3, and q_u rises to 2662.8 kPa.
sq = ge.bearing_capacity(**inputs, L=2) print(round(sq["q_u"], 1)) # 2662.8 print(round(sq["sc"], 2), round(sq["sq"], 2), round(sq["s_gamma"], 2)) # 1.6 1.3 1.3
Before you start
geoeq is open source: pip install geoeq, documented at docs.geoeq.org and published on PyPI. The inputs here match the worked example on the foundation design software page, so both pages show the same result, run with geoeq 0.1.3.
Use effective-stress parameters for a drained analysis. For an undrained (phi = 0) check, pass the undrained shear strength as c.
Checking the result
Check the Meyerhof number by hand. The overburden is q = 18 x 1.5 = 27 kPa. The three terms are 25 x 30.14 x 1.26 = 949.4 kPa, 27 x 18.40 x 1.13 = 561.4 kPa and 0.5 x 18 x 2 x 15.67 x 1.13 = 318.7 kPa. They sum to 1829.5 kPa with these rounded factors, which agrees with the printed 1829.29 within rounding.
The factors depend on the method, so compare like with like. The spread between methods in the fifth step is about 8 percent here, which is a reason to state which method a design check used.
What to do next
Wrap the call in a loop to sweep footing width or depth and tabulate q_u. Take the soil parameters from your borehole record; an SPT-based friction angle needs the corrected N-value, which the SPT correction tutorial produces. The allowable pressure from bearing_allowable is not a settlement check, so verify settlement separately before adopting a design pressure.
See Python for geotechnical calculations for more scripted workflows.
Frequently asked questions
Which bearing capacity methods does geoeq support?
bearing_capacity accepts method values terzaghi, meyerhof (the default), hansen and vesic. The Terzaghi option ignores the shape and depth switches and applies its own shape multipliers for square footings.
What equation does bearing_capacity evaluate?
The general form q_u = c Nc sc dc ic + q Nq sq dq iq + 0.5 gamma B Ngamma s_gamma d_gamma i_gamma, where q = gamma_above x Df. The reference given in the source is Das (2014), chapter 4.
Does geoeq check the water table?
bearing_capacity has a water_table argument, but in version 0.1.3 setting it to at_base did not change the result. Enter the effective (buoyant) unit weight yourself in gamma and gamma_above where the water table is at or above the footing base.
Can I turn off the shape and depth factors?
Yes. Pass shape=False or depth=False. A load inclination in degrees can be passed with the inclination argument.