Contact Us!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: sagemathinc/cocalc-example-files
Path: blob/master/sage/interact/DiffEq/heatFourier.sagews
Views: 1142
var('x') x0 = 0 k=1 f = x*exp(-x^2) p = plot(f,0,2*pi, thickness=2) c = 1/pi orden=10 alpha=[(n,c*numerical_integral(f*sin(x*n/2),0,2*pi)[0] ) for n in range(1,orden)] @interact def _(tiempo = (0.1*j for j in (0..10)) ): ft = sum( a*sin(x*n/2)*exp(-k*(n/2)^2*tiempo) for n,a in alpha) pt = plot(ft, 0, 2*pi, color='green', thickness=2) show( p + pt, ymin = -.2)
x
Interact: please open in CoCalc