Differences between revisions 44 and 52 (spanning 8 versions)
Revision 44 as of 2012-03-16 06:46:28
Size: 57805
Editor: jason
Comment:
Revision 52 as of 2012-04-07 01:19:41
Size: 57661
Editor: jason
Comment: make interacts live.
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
{{{#!html
<script type="text/javascript" src="http://aleph.sagemath.org/static/jquery.min.js"></script>
<script type="text/javascript" src="http://aleph.sagemath.org/embedded_sagecell.js"></script>
    <script>
$(function() {
    var makecells = function() {
        sagecell.makeSagecell({
            inputLocation: '#interact1',
            evalButtonText: 'Interact'});
    }
    sagecell.init(makecells);
})</script>

}}}
Line 24: Line 10:
{{{#!html
<div id="interact1"><script type="text/code">
{{{#!sagecell
Line 64: Line 49:
</script></div>
Line 75: Line 59:
{{{ {{{#!sagecell
Line 117: Line 101:
{{{ {{{#!sagecell
Line 133: Line 117:
{{{ {{{#!sagecell
Line 153: Line 137:
{{{ {{{#!sagecell
Line 181: Line 165:
{{{ {{{#!sagecell
Line 254: Line 238:
{{{ {{{#!sagecell
Line 267: Line 251:
{{{ {{{#!sagecell
Line 365: Line 349:
{{{ {{{#!sagecell
Line 471: Line 455:
{{{ {{{#!sagecell
Line 513: Line 497:
{{{ {{{#!sagecell
Line 536: Line 520:
{{{ {{{#!sagecell
Line 563: Line 547:
{{{ {{{#!sagecell
Line 589: Line 573:
{{{ {{{#!sagecell
Line 604: Line 588:
{{{ {{{#!sagecell
Line 650: Line 634:
{{{
from scipy.special.orthogonal import p_roots
{{{#!sagecell
import scipy
import numpy

from scipy.special.orthogonal import p_roots, t_roots, u_roots
Line 660: Line 646:
            'Chebyshev': {'w': 1/sqrt(1-x**2), 'xmin': -1, 'xmax': 1, 'func': t_roots},
                'Chebyshev2': {'w': sqrt(1-x**2), 'xmin': -1, 'xmax': 1, 'func': u_roots},
                'Trapezoid': {'w': 1, 'xmin': -1, 'xmax': 1, 'func': lambda n: (linspace(-1r,1,n), numpy.array([1.0r]+[2.0r]*(n-2)+[1.0r])*1.0r/n)},
                'Simpson': {'w': 1, 'xmin': -1, 'xmax': 1, 'func': lambda n: (linspace(-1r,1,n), numpy.array([1.0r]+[4.0r,2.0r]*int((n-3.0r)/2.0r)+[4.0r,1.0r])*2.0r/(3.0r*n))}}
     'Chebyshev': {'w': 1/sqrt(1-x**2), 'xmin': -1, 'xmax': 1, 'func': t_roots},
     'Chebyshev2': {'w': sqrt(1-x**2), 'xmin': -1, 'xmax': 1, 'func': u_roots},
     'Trapezoid': {'w': 1, 'xmin': -1, 'xmax': 1,          'func': lambda n: (linspace(-1r,1,n), numpy.array([1.0r]+[2.0r]*(n-2)+[1.0r])*1.0r/n)},
     'Simpson': {'w': 1, 'xmin': -1, 'xmax': 1,          'func': lambda n: (linspace(-1r,1,n),
            
numpy.array([1.0r]+[4.0r,2.0r]*int((n-3.0r)/2.0r)+[4.0r,1.0r])*2.0r/(3.0r*n))}}
Line 667: Line 656:
    return polygon([(center-width2,0),(center+width2,0),(center+width2,height),(center-width2,height)],**kwds)     return polygon([(center-width2,0),
        
(center+width2,0),(center+width2,height),(center-width2,height)],**kwds)
Line 671: Line 661:
def weights(n=slider(1,30,1,default=10),f=input_box(default=3*x+cos(10*x)),show_method=["Legendre", "Chebyshev", "Chebyshev2", "Trapezoid","Simpson"]): def weights(n=slider(1,30,1,default=10),f=input_box(default=3*x+cos(10*x),type=SR),
    
show_method=["Legendre", "Chebyshev", "Chebyshev2", "Trapezoid","Simpson"]):
Line 680: Line 671:
    scaled_ff = fast_float(scaled_func)     scaled_ff = fast_float(scaled_func, 'x')
Line 688: Line 679:
    stems = sum(line([(x,0),(x,scaled_ff(x))],rgbcolor=(1-y,1-y,1-y),thickness=2,markersize=6,alpha=y) for x,y in coords_scaled)
    points = sum([point([(x,0),(x,scaled_ff(x))],rgbcolor='black',pointsize=30) for x,_ in coords])
    stems = sum(line([(x,0),(x,scaled_ff(x))],rgbcolor=(1-y,1-y,1-y),
        
thickness=2,markersize=6,alpha=y) for x,y in coords_scaled)
    points = sum([point([(x,0),
        
(x,scaled_ff(x))],rgbcolor='black',pointsize=30) for x,_ in coords])
Line 694: Line 687:
    show(graph,xmin=plot_min,xmax=plot_max)     show(graph,xmin=plot_min,xmax=plot_max,aspect_ratio="auto")
Line 702: Line 695:
    html("$$\sum_{i=1}^{i=%s}w_i\left(%s\\right)= %s\\approx %s =\int_{-1}^{1}%s \,dx$$"%(n,latex(f.subs(x="x_i")), approximation, integral, latex(scaled_func)))     html("$$\sum_{i=1}^{i=%s}w_i\left(%s\\right)= %s\\approx %s =\int_{-1}^{1}%s \,dx$$"%(n,
        
latex(f), approximation, integral, latex(scaled_func)))
Line 715: Line 709:
{{{ {{{#!sagecell
Line 827: Line 821:
{{{ {{{#!sagecell
Line 955: Line 949:
{{{ {{{#!sagecell
Line 990: Line 984:
{{{ {{{#!sagecell
Line 1027: Line 1021:
{{{ {{{#!sagecell
Line 1080: Line 1074:
{{{
%hide
%auto
{{{#!sagecell
Line 1141: Line 1133:
{{{ {{{#!sagecell
Line 1179: Line 1171:
{{{ {{{#!sagecell
Line 1219: Line 1211:
{{{ {{{#!sagecell
Line 1326: Line 1318:
{{{ {{{#!sagecell
Line 1383: Line 1375:
{{{ {{{#!sagecell
Line 1404: Line 1396:
{{{ {{{#!sagecell

Sage Interactions - Calculus

goto interact main page

Root Finding Using Bisection

by William Stein

bisect.png

Newton's Method

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

by William Stein

http://sagenb.org/home/pub/2824/

newton.png

A contour map and 3d plot of two inverse distance functions

by William Stein

http://sagenb.org/home/pub/2823/

mountains.png

A simple tangent line grapher

by Marshall Hampton

tangents.png

Numerical integrals with the midpoint rule

by Marshall Hampton

num_int.png

Numerical integrals with various rules

by Nick Alexander (based on the work of Marshall Hampton)

num_int2.png

Some polar parametric curves

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

polarcurves1.png

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.

funtool.png

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.

newtraph.png

Coordinate Transformations

by Jason Grout

coordinate-transform-1.png coordinate-transform-2.png

Taylor Series

by Harald Schilly

taylor_series_animated.gif

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.

snapshot_epsilon_delta.png

A graphical illustration of sin(x)/x -> 1 as x-> 0

by Wai Yan Pong

sinelimit.png

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.

quadrics.png

The midpoint rule for numerically integrating a function of two variables

by Marshall Hampton

numint2d.png

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.

quadrature1.png quadrature2.png

Vector Calculus, 2-D Motion

By Rob Beezer

A fast_float() version is available in a worksheet

motion2d.png

Vector Calculus, 3-D Motion

by Rob Beezer

Available as a worksheet

motion3d.png

Multivariate Limits by Definition

by John Travis

http://www.sagenb.org/home/pub/2828/

3D_Limit_Defn.png

3D_Limit_Defn_Contours.png

Directional Derivatives

This interact displays graphically a tangent line to a function, illustrating a directional derivative (the slope of the tangent line).

directional derivative.png

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

3Dgraph_with_points.png

Approximating function in two variables by differential

by Robert Marik

3D_differential.png

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).

taylor-3d.png

Volumes over non-rectangular domains

by John Travis

http://www.sagenb.org/home/pub/2829/

3D_Irregular_Volume.png

Lateral Surface Area

by John Travis

http://www.sagenb.org/home/pub/2826/

Lateral_Surface.png

Parametric surface example

by Marshall Hampton

parametric_surface.png

Line Integrals in 3D Vector Field

by John Travis

http://www.sagenb.org/home/pub/2827/

3D_Line_Integral.png

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