# A Guide to MATLAB for Beginners and Experienced Users - Brian R.H.

**Download**(direct link)

**:**

**54**> 55 56 57 58 59 60 .. 91 >> Next

X = itseq(f, 0.75, 100, 3.7); plot(X)

This is an example of what mathematicians call a chaotic phenomenon! It is not random — the sequence was generated by a precise, fixed mathematical procedure — but the results manifest no predictible pattern. Chaotic phenomena are unpredictable, but with modern methods (including computer analysis), mathematicians have been able to identify certain patterns of behavior in chaotic phenomena. For example, the last figure166 Chapter 9: Applications

suggests the possibility of unstable periodic cycles and other recurring phenomena. Indeed a great deal of information is known. The aforementioned book by Gulick is a fine reference, as well as the source of an excellent bibliography on the subject.

Rerunning the Model with SIMULINK

The logistic growth model that we have been exploring lends itself particularly well to simulation using SIMULINK. Here is a simple SIMULINK model that corresponds to the above calculations:

O

Scope

Discrete Pulse Generator

3.7

Product

Logistic Constant

Unit Delay

1-x

u

x

x

Let's briefly explain how this works. If you ignore the Discrete Pulse Generator block and the Sum block in the lower left for a moment, this model implements the equation

x at next time = ux(1 — x) at old time,

which is the equation for the logistic model. The Scope block displays a plot of x as a function of (discrete) time. However, we need somehow to build in the initial condition for x. The simplest way to do this is as illustrated here: We add to the right-hand side a discrete pulse that is the initial value of x at time t = 0 and is 0 thereafter. Since the model is discrete, you can achieve this by setting the period of the Discrete Pulse Generator block to something longer than the length of the simulation, and setting the width of the pulsePopulation Dynamics 167

to 1 and the amplitude of the pulse to the initial value of x. The outputs from the model in the two interesting cases of u = 3.4 and u = 3.7 are shown here:

Output with è = 3.4

Outputwith u = 3.7

In the first case of u = 3.4, the periodic behavior is clearly visible. However, when u = 3.7, we get chaotic behavior.168 Chapter 9: Applications

Linear Economic Models

MATLAB's linear algebra capabilities make it a good vehicle for studying linear economic models, sometimes called Leontiefmodels (after their primary developer, Nobel Prize-winning economist Wassily Leontief) or input-output models. We will give a few examples. The simplest such model is the linear exchange model or closed Leontief model of an economy. This model supposes that an economy is divided into, say, n sectors, such as agriculture, manufacturing, service, consumers, etc. Each sector receives input from the various sectors (including itself) and produces an output, which is divided among the various sectors. (For example, agriculture produces food for home consumption and for export, but also seeds and new livestock, which are reinvested in the agricultural sector, as well as chemicals that may be used by the manufacturing sector, and so on.) The meaning of a closed model is that total production is equal to total consumption. The economy is in equilibrium when each sector of the economy (at least) breaks even. For this to happen, the prices of the various outputs have to be adjusted by market forces. Let Oij denote the fraction of the output of the Jth sector consumed by the ith sector. Then the OiJ are the entries of a square matrix, called the exchange matrix A, each of whose columns sums to 1. Let Pi be the price of the output of the ith sector of the economy. Since each sector is to at least break even, Pi cannot be smaller than the value of the inputs consumed by the ith sector, or in other words,

But summing over i and using the fact that J2i aij = 1, we see that both sides must be equal. In matrix language, that means that (I — A)p = 0, where p is the column vector of prices. Thus p is an eigenvector of A for the eigenvalue 1, and the theory of stochastic matrices implies (assuming that A is irreducible, meaning that there is no proper subset E of the sectors of the economy such that outputs from E all stay inside E) that p is uniquely determined up to a scalar factor. In other words, a closed irreducible linear economy has an essentially unique equilibrium state. For example, if we have

A = [.3, «², .05, .2; .1, .2, «3, .3; .3, .5, .2, .3; .3,

.2, .45, .2]LinearEconomicModels 169

A

0.3000 0.1000 0.3000 0.3000

0.1000 0.2000 0.5000 0.2000

0.0500 0.3000 0.2000 0.4500

0.2000 0.3000 0.3000 0.2000

then as required,

sum(A)

ans

1

1

1

1

That is, all the columns sum to 1, and

[V, D] = eig(A); D(1, 1)

p = V(:, 1)

ans =

1.0000

P =

0.2739 0.4768 0.6133 0.5669

shows that 1 is an eigenvalue of A with price eigenvector p as shown.

Somewhat more realistic is the (static, linear) open Leontief model of an economy, which takes labor, consumption, etc., into account. Let's illustrate with an example. The following cell inputs an actual input-output transactions table for the economy of the United Kingdom in 1963. (This table is taken from Input-Output Analysis and its Applications by R. O'Connor and E. W. Henry, Hafner Press, New York, 1975.) Tables such as this one can be obtained from official government statistics. The table T is a 10 X 9 matrix. Units are millions of British pounds. The rows represent respectively, agriculture, industry, services, total inter-industry, imports, sales by final buyers, indirect taxes, wages and profits, total primary inputs, and total inputs. The columns represent, respectively, agriculture, industry, services, total inter-industry, consumption, capital formation, exports, total final demand, and output. Thus outputs from each sector can be read off along a row, and inputs into a sector can be read off along a column.170 Chapter 9: Applications

**54**> 55 56 57 58 59 60 .. 91 >> Next