Third Project

    (due Thur. 7/28/10 5:00 p.m. CST)


    Use MatLab as a means to present a mathematical concept (such as limit definition of derivative, local minimum of a function of two variables, finding a root of a nonlinear function, etc): The basic components of project 3 will be to:
    1. Introduce a mathematical topic
    2. Give an elementary example
    3. Develop a solution strategy or algorithm
    4. Illustrate the concepts graphically
    5. Contain at least one animation (if possible)
    6. Allows the students to interactively change parameters

    The goal of project 3 is to build on what you know so far of HTML, technical documents, graphics and MatLab, to make a series of web pages that teach a mathematical concept.

    To this end, you should use your HTML creativity to

    Use MatLab to create one or more animations (using techniques discussed in video lecture) and put it in the web page.

    Create interactive m-files in MatLab, which the user can download and run. They should be internally commented and provide user feedback through sprintf/fprintf/input commands.

    You can also include a transcript of sample matlab sessions, using the "diary" command in MatLab.

    The result should be a series of web pages that incorporate all that you have learned so far, and using Matlab as the primary interactive computational tool ...


    A very simple example of an interactive m-file would be:
    function slope_tangent(f,x0)
    % graphical depiction of the approach of the secant
    % to the limit
    
    x = linspace(x0-5,x0+5);
    h = 4.0;
    for i=1:10
        h=h/2;
        m=(f(x0+h)-f(x0))/h;
        sprintf('h=%f',h)
        sprintf('slope=%f',m)
        plot(x,f(x),x,f(x0)+m*(x-x0));
        pause;
    end
    
    It can be called as
    >> slope_tangent(@cos,1)
    
    from the Matlab command window. Note, you can pass an arbitrary function (or your own function defined by an m-file) using the @f or 'f' notation. Note the use of the "pause" and "sprintf" commands to get user feedback. Use the "input" command to get actual user input, e.g.
    >> h=input('enter in value for h')
    
    You can enter a function as a string (and then plot it) through the following statemenets:
    R = input('enter your function as a function of t ...','s') % but don't enter with quotes
    y = inline(R,'t')
    plot(t,y(t)) 
    
    Try it and see...