Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
34 views
Kernel: SageMath (stable)

Sistemas de ecuaciones diferenciales

A continuación, bosquejaremos las soluciones de algunas ecuaciones diferenciales fundamentales en las ciencias

Ecuación logística

La función logística, curva logística o curva en forma de S es una función matemática que aparece en diversos modelos de crecimiento de poblaciones, propagación de enfermedades epidémicas y difusión en redes sociales.

t,x = var("t,x") r = 1 x_t = r*(1-x)*x intervalo_t = (t,-10,10) intervalo_x = (x,-1,2) campo = plot_vector_field((1,x_t), intervalo_t, intervalo_x, color="red") campo.show(gridlines=True)
Image in a Jupyter notebook

Sistemas gradientes

(x˙,y˙)=−∇V(x,y) (\dot{x},\dot{y}) = -\nabla V(x,y)

x,y=var("x,y") V(x,y)=x^2*(1-x)^2+y^2 xt = -V.diff(x) yt = -V.diff(y) intervalo_x = (x,-1,2) intervalo_y = (y,-2,2) campo = plot_vector_field((xt,yt), intervalo_x, intervalo_y, color="red") campo += contour_plot(V(x,y), intervalo_x, intervalo_y, fill=False, cmap="jet", colorbar=True) campo.show(gridlines=True)
Image in a Jupyter notebook
cm = colormaps.jet def c(x,y): return x^2*(1-x)^2+y^2 print(latex(c(x,y))) superficie = plot3d(V(x,y), (x,-.5,1.5), (y,-1,1), adaptative=True, color=(c,cm)) superficie.show(aspect_ratio=1) superficie.save('tmp.png',aspect_ratio=1)
{\left(x - 1\right)}^{2} x^{2} + y^{2}
heatmap = density_plot(V(x,y), intervalo_x, intervalo_y, cmap='jet') heatmap.show(gridlines=True)
Image in a Jupyter notebook

Sistemas Hamiltonianos

x,y=var("x,y") H(x,y)=(1/2)*y^2+(1/2)*x^2 xt = H.diff(y) yt = -H.diff(x) intervalo_x = (x,-5,5) intervalo_y = (y,-5,5) show("H(x,y)=",H(x,y)) campo = plot_vector_field((xt,yt), intervalo_x, intervalo_y) campo += contour_plot(H(x,y), intervalo_x, intervalo_y, fill=False, cmap="jet") campo.show(gridlines=True)
Image in a Jupyter notebook
cm = colormaps.jet def c(x,y): return (1/2)*y^2+(1/2)*x^2 print(latex(c(x,y))) superficie = plot3d(H(x,y), (x,-1,1), (y,-1,1), adaptative=True, color=(c,cm)) superficie.show(aspect_ratio=1) superficie.save('oscilador.png',aspect_ratio=1)
\frac{1}{2} \, x^{2} + \frac{1}{2} \, y^{2}
x,y=var("x,y") H(x,y)=(1/2)*y^2-x*y+(1/2)*x^2 xt = H.diff(y) yt = -H.diff(x) intervalo_x = (x,-10,10) intervalo_y = (y,-5,5) show("H(x,y)=",H(x,y)) campo = plot_vector_field((xt,yt), intervalo_x, intervalo_y) campo += contour_plot(H(x,y), intervalo_x, intervalo_y, fill=False, cmap="jet") campo.show(gridlines=True)
Image in a Jupyter notebook
x,y=var("x,y") m = (1/2)^4 H(x,y)=(1/(2*m))*y^2-(1/2)*cos(2*pi*x) xt = H.diff(y) yt = -H.diff(x) intervalo_x = (x,-2,2) intervalo_y = (y,-1,1) show("H(x,y)=",H(x,y)) campo = plot_vector_field((xt,yt), intervalo_x, intervalo_y, color="purple") campo += contour_plot(H(x,y), intervalo_x, intervalo_y, fill=False, cmap="jet") campo.show(gridlines=True)
Image in a Jupyter notebook