Department of Mathematics

 

Math 312 - Applied Mathematics: Social Sciences
Spring 2006


Nonlinear Map Demonstration Using Scilab

The Scilab program that I used to demonstrate the iterations of a nonlinear map is here: iterate_example.sci. Save this file somewhere convenient, and run Scilab in the same directory as where the file is saved. Then give the Scilab command
-->exec("iterate_example.sci")
This will define the function iterate_example(ics,N,b,bounds), where the arguments are The map is
x(n+1) = (1-x(n))x(n) + b y(n)
y(n+1) = y(n)/2 + x(n)

Example. The following command will plot the first 20 iterations for the initial conditions (0,1/4), (0,1/2), (0,3/4) and (0,1), using b=-1/4, and restricting the data display to -1 < x < 0.4 and -1.2 < y < 1.
-->iterate_example([0 0.25; 0 0.5; 0 0.75; 0 1],20,-0.25,[-1 -1.2; 0.4 1])
You should see a plot like this:

If you call the function again, it will add the new plots to the existing plot. To clear the current plot, use the clf command:
-->clf