Differences between revisions 56 and 59 (spanning 3 versions)
 ⇤ ← Revision 56 as of 2012-05-09 01:38:57 → Size: 58534 Editor: jason Comment: ← Revision 59 as of 2013-04-24 18:48:29 → ⇥ Size: 61041 Editor: travis Comment: Deletions are marked like this. Additions are marked like this. Line 968: Line 968: == Multivariate Limits by Definition FIXME == == Multivariate Limits by Definition == Line 971: Line 971: http://www.sagenb.org/home/pub/2828/ http://sagenb.mc.edu/home/pub/97/ Line 981: Line 981: ## An updated version of this worksheet may be available at http://sagenb.mc.edu Line 986: Line 985: var('x,y,z')Rmin=1/10 Line 988: Line 988: @interactdef _(f=input_box(default=(x^3-y^3)/(x^2+y^2)),R=slider(0.1/10,Rmax,1/10,2),x0=(0),y0=(0)): @interact(layout=dict(top=[['f'],['x0'],['y0']], bottom=[['in_3d','curves','R','graphjmol']]))def _(f=input_box((x^2-y^2)/(x^2+y^2),width=30,label='$f(x)$'),        R=slider(Rmin,Rmax,1/10,Rmax,label=',   $R$'),        x0=input_box(0,width=10,label='$x_0$'),        y0=input_box(0,width=10,label='$y_0$'),        curves=checkbox(default=false,label='Show curves'),        in_3d=checkbox(default=false,label='3D'),        graphjmol=checkbox(default=true,label='Interactive graph')):    if graphjmol:        view_method = 'jmol'    else:        view_method = 'tachyon' Line 997: Line 1008: Line 999: Line 1010: limit = plot3d(g,(t,0,2*pi),(r,1/100,R),transformation=cylinder,rgbcolor=(0,1,0)) collapsing_surface = plot3d(g,(t,0,2*pi),(r,1/100,R),transformation=cylinder,rgbcolor=(0,1,0)) Line 1001: Line 1012: show(surface+limit)    print html('Enter $(x_0 ,y_0 )$ above and see what happens as R approaches zero.')    print html('The surface has a limit as $(x,y)$ approaches ('+str(x0)+','+str(y0)+') if the green region collapses to a point') G = surface+collapsing_surface    html('Enter $(x_0 ,y_0 )$ above and see what happens as $R \\rightarrow 0$.')    html('The surface has a limit as $(x,y) \\rightarrow$ ('+str(x0)+','+str(y0)+') if the green region collapses to a point.')# If checked, add a couple of curves on the surface corresponding to limit as x->x0 for y=x^(3/5),# and as y->y0 for x=y^(3/5). Should make this more robust but perhaps using # these relatively obtuse curves could eliminate problems.    if curves:        curve_x = parametric_plot3d([x0-t,y0-t^(3/5),f(x=x0-t,y=y0-t^(3/5))],(t,Rmin,Rmax),color='red',thickness=10)        curve_y = parametric_plot3d([x0+t^(3/5),y0+t,f(x=x0+t^(3/5),y=y0+t)],(t,Rmin,Rmax),color='red',thickness=10)        R2 = Rmin/4        G += arrow((x0-Rmin,y0-Rmin^(3/5),f(x=x0-Rmin,y=y0-Rmin^(3/5))),(x0-R2,y0-R2^(3/5),f(x=x0-R2,y=y0-R2^(3/5))),size=30 )        G += arrow((x0+Rmin^(3/5),y0+Rmin,f(x=x0+Rmin^(3/5),y=y0+Rmin)),(x0+R2^(3/5),y0+R2,f(x=x0+R2^(3/5),y=y0+R2)),size=30 )         limit_x = limit(f(x=x0-t,y=y0-t^(3/5)),t=0)        limit_y = limit(f(x=x0+t^(3/5),y=y0+t),t=0)        text_x = text3d(limit_x,(x0,y0,limit_x))        text_y = text3d(limit_y,(x0,y0,limit_y))        G += curve_x+curve_y+text_x+text_y              html('The red curves represent a couple of trajectories on the surface. If they do not meet, then')        html('there is also no limit. (If computer hangs up, likely the computer can not do these limits.)')        html('\n
$\lim_{(x,?)\\rightarrow(x_0,y_0)} f(x,y) =%s$'%str(limit_x)+' and $\lim_{(?,y)\\rightarrow(x_0,y_0)} f(x,y) =%s$
'%str(limit_y))            if in_3d:        show(G,stereo="redcyan",viewer=view_method)    else:        show(G,perspective_depth=true,viewer=view_method) Line 1336: Line 1374: == Lateral Surface Area FIXME == == Lateral Surface Area == Line 1340: Line 1378: http://www.sagenb.org/home/pub/2826/ http://sagenb.mc.edu/home/pub/89/ Line 1347: Line 1385: ## Line 1349: Line 1388: @interactdef _(f=input_box(default=6-4*x^2-y^2*2/5,label='$f(x,y) =$'),        g=input_box(default=-2+sin(x)+sin(y),label='$g(x,y) =$'),        u=input_box(default=cos(t),label='$u(t) =$'),        v=input_box(default=2*sin(t),label='$v(t) =$'),        a=input_box(default=0,label='$a =$'),        b=input_box(default=3*pi/2,label='$b =$'), @interact(layout=dict(top=[['f','u'],['g','v']], left=[['a'],['b'],['in_3d'],['smoother']],bottom=[['xx','yy']]))def _(f=input_box(default=6-4*x^2-y^2*2/5,label='Top = $f(x,y) =$',width=30),        g=input_box(default=-2+sin(x)+sin(y),label='Bottom = $g(x,y) =$',width=30),        u=input_box(default=cos(t),label='   $x = u(t) =$',width=20),        v=input_box(default=2*sin(t),label='   $y = v(t) =$',width=20),        a=input_box(default=0,label='$a =$',width=10),        b=input_box(default=3*pi/2,label='$b =$',width=10), Line 1358: Line 1399: smoother=checkbox(default=false)): in_3d = checkbox(default=true,label='3D'), smoother=checkbox(default=false),        auto_update=true): Line 1360: Line 1403: ds = sqrt(derivative(u(t),t)^2+derivative(v(t),t)^2) ds = sqrt(derivative(u,t)^2+derivative(v,t)^2) Line 1364: Line 1407: A = (f(x=u(t),y=v(t))-g(x=u(t),y=v(t)))*ds.simplify_trig().simplify() A = (f(x=u,y=v)-g(x=u,y=v))*ds.simplify_trig().simplify() Line 1369: Line 1412: line_integral = integral(A,t,a,b) # If you want Sage to try, uncomment the lines below.# line_integral = integrate(A,t,a,b)# html(r'Lateral Surface Area = $%s$ '%latex(line_integral)) Line 1371: Line 1418: html(r'

Lateral Surface Area = $%s$

'%latex(line_integral))    html(r'

Lateral Surface $\approx$ %s

'%str(line_integral_approx)) html(r'Lateral Surface $\approx$ %s'%str(line_integral_approx)) Line 1381: Line 1426: G += parametric_plot3d([u,v,g(x=u(t),y=v(t))],(t,a,b),thickness=2,color='red')    G += parametric_plot3d([u,v,f(x=u(t),y=v(t))],(t,a,b),thickness=2,color='red') G += parametric_plot3d([u,v,g(x=u,y=v)],(t,a,b),thickness=2,color='red')    G += parametric_plot3d([u,v,f(x=u,y=v)],(t,a,b),thickness=2,color='red') Line 1391: Line 1436: G += parametric_plot3d([u(w),v(w),s*f(x=u(w),y=v(w))+(1-s)*g(x=u(w),y=v(w))],(s,0,1),thickness=lat_thick,color='yellow',opacity=0.9)    show(G,spin=true) G += parametric_plot3d([u(t=w),v(t=w),s*f(x=u(t=w),y=v(t=w))+(1-s)*g(x=u(t=w),y=v(t=w))],(s,0,1),thickness=lat_thick,color='yellow',opacity=0.9)             if in_3d:        show(G,stereo='redcyan',spin=true)    else:        show(G,perspective_depth=true,spin=true)

# Sage Interactions - Calculus

## Root Finding Using Bisection

by William Stein ## Newton's Method

Note that there is a more complicated Newton's method below.

by William Stein ## A contour map and 3d plot of two inverse distance functions

by William Stein ## A simple tangent line grapher

by Marshall Hampton ## Numerical integrals with the midpoint rule

by Marshall Hampton ## Numerical integrals with various rules

by Nick Alexander (based on the work of Marshall Hampton) ## Some polar parametric curves

by Marshall Hampton. This is not very general, but could be modified to show other families of polar curves. ## Function tool

Enter symbolic functions f, g, and a, a range, then click the appropriate button to compute and plot some combination of f, g, and a along with f and g. This is inspired by the Matlab funtool GUI. ## Newton-Raphson Root Finding

by Neal Holtz

This allows user to display the Newton-Raphson procedure one step at a time. It uses the heuristic that, if any of the values of the controls change, then the procedure should be re-started, else it should be continued. ## Coordinate Transformations

by Jason Grout  ## Taylor Series

by Harald Schilly ## Illustration of the precise definition of a limit

by John Perry

I'll break tradition and put the image first. Apologies if this is Not A Good Thing. ## A graphical illustration of sin(x)/x -> 1 as x-> 0

by Wai Yan Pong ## Quadric Surface Plotter

by Marshall Hampton. This is pretty simple, so I encourage people to spruce it up. In particular, it isn't set up to show all possible types of quadrics. ## The midpoint rule for numerically integrating a function of two variables

by Marshall Hampton ## Gaussian (Legendre) quadrature

by Jason Grout

The output shows the points evaluated using Gaussian quadrature (using a weight of 1, so using Legendre polynomials). The vertical bars are shaded to represent the relative weights of the points (darker = more weight). The error in the trapezoid, Simpson, and quadrature methods is both printed out and compared through a bar graph. The "Real" error is the error returned from scipy on the definite integral.  ## Vector Calculus, 2-D Motion FIXME

By Rob Beezer

A fast_float() version is available in a worksheet ## Vector Calculus, 3-D Motion

by Rob Beezer

Available as a worksheet ## Multivariate Limits by Definition

by John Travis  ## Directional Derivatives

This interact displays graphically a tangent line to a function, illustrating a directional derivative (the slope of the tangent line). ## 3D graph with points and curves

By Robert Marik

This sagelet is handy when showing local, constrained and absolute maxima and minima in two variables. Available as a worksheet ## Approximating function in two variables by differential

by Robert Marik ## Taylor approximations in two variables

by John Palmieri

This displays the nth order Taylor approximation, for n from 1 to 10, of the function sin(x2 + y2) cos(y) exp(-(x2+y2)/2). ## Volumes over non-rectangular domains

by John Travis ## Lateral Surface Area

by John Travis ## Parametric surface example

by Marshall Hampton ## Line Integrals in 3D Vector Field

by John Travis interact/calculus (last edited 2020-08-11 14:10:09 by kcrisman)