Scroll to Top

Virtual Math Learning Center

Virtual Math Learning Center Texas A&M University Virtual Math Learning Center

Calculating Work in Python: Pumping Liquid from a Tank

Author: David Manuel

In this video, we use Python to calculate the work done in pumping the liquid from a tank whose ends are semicircles. We setup the definite integral for the work by hand and then use Python to evaluate it.

Transcript 24

Problem: Find the work required to pump water from a 0.5m spout at the top of a tank 6m long whose ends are semicircles with radius 2m.

Python Code: 
Work required to pump water from a 0.5m spout at the top of a tank 6m long whose ends are semicircles with radius 2m

from sympy import *

y=symbols('y')
dW=9800*6*(2*sqrt(4-y**2))*(y+0.5)
W=integrate(dW,(y,0,2))
print('The work required is',W.evalf(),'Joules')

Open Python Notebook File

See more videos from this section