Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168722
Image: ubuntu2004

Se definen las variables necesarias

var('x, y, U, Gamma, Q')
(x, y, U, Gamma, Q)

Funciones v_x(x, y) y v_y(x, y), transformadas para usar coordenadas cartesianas

v_x(x, y) = ((U * x / sqrt(x**2 + y**2) + Q / (2 * pi * sqrt(x**2 + y**2))) * x / sqrt(x**2 + y**2) - (-U * y / sqrt(x**2 + y**2) + Gamma / (2 * pi * sqrt(x**2 + y**2))) * y / sqrt(x**2 + y**2)).full_simplify() show(v_x)
\newcommand{\Bold}[1]{\mathbf{#1}}\left( x, y \right) \ {\mapsto} \ \frac{2 \, {\left(\pi x^{2} + \pi y^{2}\right)} U - \Gamma y + Q x}{2 \, {\left(\pi x^{2} + \pi y^{2}\right)}}
v_y(x, y) = ((U * x / sqrt(x**2 + y**2) + Q / (2 * pi * sqrt(x**2 + y**2))) * y / sqrt(x**2 + y**2) + (-U * y / sqrt(x**2 + y**2) + Gamma / (2 * pi * sqrt(x**2 + y**2))) * x / sqrt(x**2 + y**2)).full_simplify() show(v_y)
\newcommand{\Bold}[1]{\mathbf{#1}}\left( x, y \right) \ {\mapsto} \ \frac{\Gamma x + Q y}{2 \, {\left(\pi x^{2} + \pi y^{2}\right)}}

Función de corriente

psi(x, y) = U * y + Q / (2 * pi) * atan(y / x) - Gamma / (4 * pi) * log(x**2 + y**2) show(psi)
\newcommand{\Bold}[1]{\mathbf{#1}}\left( x, y \right) \ {\mapsto} \ U y - \frac{\Gamma \log\left(x^{2} + y^{2}\right)}{4 \, \pi} + \frac{Q \arctan\left(\frac{y}{x}\right)}{2 \, \pi}

Caso U ≠ 0, Q = 0, Γ = 0

plot_vector_field((v_x.subs(U=1.0, Q=0.0, Gamma=0.0), v_y.subs(U=1.0, Q=0.0, Gamma=0.0)), (x, -2, 2), (y, -2, 2), color="red")

Caso U = 0, Q ≠ 0, Γ = 0

plot_vector_field((v_x.subs(U=0.0, Q=1.0, Gamma=0.0), v_y.subs(U=0.0, Q=1.0, Gamma=0.0)), (x, -2, 2), (y, -2, 2), color="orange")

Caso U = 0, Q = 0, Γ ≠ 0

plot_vector_field((v_x.subs(U=0.0, Q=0.0, Gamma=1.0), v_y.subs(U=0.0, Q=0.0, Gamma=1.0)), (x, -2, 2), (y, -2, 2), color="green")

Caso U ≠ 0, Q ≠ 0, Γ = 0

plot_vector_field((v_x.subs(U=1.0, Q=5.0, Gamma=0.0), v_y.subs(U=1.0, Q=5.0, Gamma=0.0)), (x, -2, 2), (y, -2, 2), color="blue")
contour_plot(psi.subs(U=1.0, Q=5.0, Gamma=0.0), (x, -2, 2), (y, -2, 2), contours=30, fill=False)
plot_vector_field((v_x.subs(U=1.0, Q=0.0, Gamma=5.0), v_y.subs(U=1.0, Q=0.0, Gamma=5.0)), (x, -2, 2), (y, -2, 2), color="violet")
contour_plot(psi.subs(U=1.0, Q=0.0, Gamma=5.0), (x, -2, 2), (y, -2, 2), contours=30, fill=False)

Componente interactivo

@interact def _(_U=(1.0, (-5.0, 5.0)), _Q=(2.5, (-5.0, 5.0)), _Gamma=(4.0, (-5.0, 5.0))): show(plot_vector_field((v_x.subs(U=_U, Q=_Q, Gamma=_Gamma), v_y.subs(U=_U, Q=_Q, Gamma=_Gamma)), (x, -2, 2), (y, -2, 2))) show(contour_plot(psi.subs(U=_U, Q=_Q, Gamma=_Gamma), (x, -2, 2), (y, -2, 2), contours=40, fill=False))