BioNB 441: Homework 2

  1. The logistic equation simulates a very simple model of animal reproduction. If x(n) is the number of animals in generation n then under a couple of assumptions the number of animals in generation n+1 is x(n+1)=r*x(n)*(1-x(n)) where r is the reproduction rate. As r varies between 0 and 4 the behavior of this equation varys from stable (settles down to one value) to chaotic (never repeats itself). The following Matlab program implements a simulation of this equation.
  2. %logistic.m - this MATLAB file solves the 
    %discrete logistic equation x(i+1)=r*x(i)*(1-x(i))
    
    clear all
    r=3.7;        %the rate parameter range 0-4
    n=4000;       %the number of point to generate
    x(1)=0.55;    %initial value for x
    
    for i=1:n-1
       x(i+1)=r*x(i)*(1-x(i));
    end
    
    sound(x,4000);
    clf
    %plot a chunk in the middle of the waveform
    plot(1000:1100,x(1000:1100));

    Modify the program so that it automatically steps through a range of values of r. Start with the range 2.9 to 4 in steps of 0.1. Design the program so that is will be easy to change the beginning, end and step size. At each step, the modified program should play the sound and make a plot. Write out the modified program, but actually test it during lab.

  3. You receive a file containing a few seconds of extracellular recordings from the midbrain of a fish. The file has voltage readings taken at a rate of 10000/sec for 5 seconds. Plotting the data file should convince you that the signal-to-noise ratio is good enough to identify action potentials by an amplitude threshold. Write a program to determine when action potentials occur and then produce a histogram of the inter-spike intervals (ISI).



August 2002 Copyright Cornell University