In [ ]:
import numpy as np
import matplotlib.pyplot as plt

from sympy.abc import rho
from sympy.interactive import printing
from sympy import Eq, Derivative, Function
from sympy import symbols, integrate, lambdify, dsolve

printing.init_printing()

In [ ]:
t, z, g = symbols('t z g', nonzero=True, constant=True)
w = Function('w')(t)
p = Function('p')

In [ ]:
dwdt = Eq(Derivative(w, t), -1/rho*Derivative(p(z), z) - g)
dwdt

In [ ]:
dwdt = dwdt.subs(w, 0).doit()

In [ ]:
P = integrate(dwdt, (z, -z, 0))
P

In [ ]:
P = P.subs(p(0), 0)
P

Re-arranjando temos:


In [ ]:
P = Eq(p(-z), rho*g*z)
P

In [ ]:
depth = -np.linspace(0, 11e3, 100)
subs = [(g, -9.8), (rho, 1023)]

func = P.subs(subs)
func = lambdify(z, func.rhs, "numpy")
pressure = func(depth)

In [ ]:
fig, ax = plt.subplots(figsize=(4, 4))
ax.grid(True)
ax.plot(pressure, depth/1e3)
ax.set_xlabel(r'Pressão [Pa ou N m$^{-2}$]')
ax.set_ylabel(r'Profundidade [km]')

Qual seria a força exercida em 1 m$^2$ no fundo das fossas das Marianas?