Matlab for Engineers And Scientist (third edition)

Page 225

Essential MATLAB for Engineers and Scientists

Halley’s Comet, which visited us in 1985/6, moves in an elliptical orbit about the Sun (at one focus) with a semi-major axis of 17.9 A.U. (A.U. stands for Astronomical Unit, which is the mean distance of the Earth from the Sun: 149.6 million km.) The eccentricity of the orbit is 0.967276. Write a program which draws the orbit of Halley’s Comet and the Earth (assume the Earth is circular). 7.6 A very interesting iterative relationship that has been studied a lot recently is defined by yk+1 = ryk (1 − yk ) (this is a discrete form of the well-known logistic model). Given y0 and r, successive yk ’s may be computed very easily, e.g. if y0 = 0.2 and r = 1, then y1 = 0.16, y2 = 0.1334, and so on. This formula is often used to model population growth in cases where the growth is not unlimited, but is restricted by shortage of food, living area, etc. yk exhibits fascinating behavior, known as mathematical chaos, for values of r between 3 and 4 (independent of y0 ). Write a program which plots yk against k (as individual points). Values of r that give particularly interesting graphs are 3.3, 3.5, 3.5668, 3.575, 3.5766, 3.738, 3.8287, and many more that can be found by patient exploration. 7.7 A rather beautiful fractal picture can be drawn by plotting the points (xk , yk ) generated by the following difference equations xk+1 = yk (1 + sin 0.7xk ) − 1.2 |xk |, yk+1 = 0.21 − xk , starting with x0 = y0 = 0. Write a program to draw the picture (plot individual points; do not join them).

204


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.