Models with Unique Solutions Using Systems of Linear Equations
Let’s use the method of joints to analyze the Warren truss from the Introduction.
Example 5.3. Analysis of a Truss by the Method of Joints.
A segment of a Warren truss with vertical supports that is fixed at the lower left endpoint pi, and can move horizontally at the lower right endpoint pi is displayed in Figure 5.5. The pin-joints of the truss are at p, p2, рз, and Pi. A load of 10 kilonewtons (lcN) is placed at joint рз; the forces on the truss with magnitudes fi, /2, /3, /4, and /5 are indicated in the figure. The stationary support member has a horizontal force F and a vertical force F2: the horizontally movable support member has only a vertical force F3.
FIGURE 5.5: A Warren Truss with Vertical Supports Segment
Since the truss is in static equilibrium, Newton’s Law for equilibrium of forces implies that the sum of the force vectors at each joint must be the zero vector. Therefore, the sum of the horizontal components of the forces and the sum of the vertical components must each be zero.
Begin with joint pi, the fixed joint at the lower left of the truss. Both f and /2 are forces into p, while forces F and F2 pull away from pi. Force /1 acts at angle of 7t/4 which resolves into the horizontal component (/2/2)/i and vertical component (p/2/2)f. These forces are at equilibrium, so that
Next, we consider joint P2 at the top of the truss segment. Both /1 and /3 pull away, while /4 acts into the joint. Resolving the angular forces and summing gives
Complete the model for the forces at each joint and place the force vector equations in Table 5.1. Verify that these are correct!
TABLE 5.1: Forces on the Truss’s .Joints
Write this model as a system of equations in matrix notation Ax = b with 8 equations in 8 unknowns:
Enter the augmented matrix, and then reduce the matrix using ReducedRowEchelonForm. Interpret the results to solve the problem.
As this matrix is large (for entering by hand, that is), use the Matrix palette to enter it. Set the size to 8 x 9, click the “Insert Matrix” button, then fill in the entries.
Note that we used evalf to force decimal arithmetic.
We interpret the solution of the linear system as the magnitude of the forces: Fx = 0, F2 = -23660.25, F3 = -13660.25, /, = -33460.65, f2 = 23660.25, /3 = 10000, /4 = -27320.51, and /5 = 23660.25.
This problem is continued as an exercise at the end of the section.
Wassily Leontief, recipient of the 1973 Nobel Prize in Economics, explained his input-output model showing the interdependencies of the U.S. economy in the April 1965 issue of Scientific American. He organized the 1958 American economy into an 81 x 81 matrix. The 81 sectors of the economy, such as steel, agriculture, manufacturing, transportation, and utilities, each represented resources that rely on input from the output of other resources. For example, the production of clothing requires an input from manufacturing, transportation, agriculture, and other sectors. The following is a brief example of a Leontief model and its solution.
Example 5.4. A Leontief Input-Output Economic Model.
Consider an open production model, one that doesn’t consume all of its production, where to produce 1 unit of output (units are in millions of dollars):
Table 5.2 shows the technology matrix representing this model.
TABLE 5.2: Leontief Input-Output Table for Our Five-Sector Economy
The entries of Table 5.2 form the consumption matrix C for this economy. We use C to answer Leontief’s question, “Is there a production level that will balance the total demand?” Let the vector x be the total production of the economy, and let the vector d be the final demand, the demand external to production. Then Cx is the intermediate demand, the amount of production consumed internally by the individual sectors of the economy. The Leontief Exchange Input-Output model, or Production Equation, is
Let I be the identity matrix. We can solve for x as follows.
If the economy produces 900 million dollars of petroleum, 300 million dollars of textiles, 850 million dollars of transportation, 800 million dollars of chemicals, and 750 million dollars of manufacturing, how much of this production is internally consumed by the economy?
Use Maple to enter the augmented matrix L = [C | d] and row reduce it. Remember to load LinearAlgebra first.
We interpret the unique solution as the amounts the sectors need to produce to meet the total demand:
We studied the method of least squares in Chapter 5 of Volume 1. We used multivariable calculus to minimize the sum of squares of the errors leading to least squares in Chapter 4, Volume 2. Now, we will consider least squares curve fitting as solving a system of linear equations.
The sum of squares of the errors from fitting a parabola f(x) = ax2+bx+c is given by
To minimize S, first set the first partial derivatives equal to 0 and then solve the resulting system. After a little algebra, we have the normal equations
Rewrite these equations as a system of linear equations.
Observe the pattern in the equations; what would the system be for a cubic fit?
Example 5.5. A Least Squares Model as a System of Equations.
Fit a quadratic model fix) = ax2 + bx + c to the following data:
Substitute the following into (5.1). We have the linear system
Enter the augmented coefficient matrix for the system into Maple and row reduce to find the solution.
The output yields a = —197/111. b = —326/36, and c = 11557/185. Therefore, the quadratic model for our data is
Check the fit.
The plot shows visually that the fit captures the trend of the data.
Our next example of an application of systems of linear equations is a different method of fitting a curve to data: this time, smoothly connecting data points via cubic polynomials to form a piecewise curve. These curves are called “cubic splines,” cubic for the third degree and spline after the flexible draftsman’s ruler originally used to draw the curves. The data points are called “knots.” Pierre Bezier, a French design engineer at Renault, introduced using splines for designing auto bodies in the 1960s. Splines are ubiquitous today, appearing in numerous applications. TrueType, developed by Apple in the 1990s, uses two-dimensional quadratic splines to form the characters on your phone or computer screen, and PostScript, developed by Adobe in the 1980s, uses two-dimensional cubic splines for printed characters.
Example 5.6. Natural Cubic Splines as a System of Equations.
Fit a natural cubic spline to the data
We will need 5 third order equations.
There are 20 unknowns: so we need 20 equations to uniquely solve
for these unknowns. The (x, y) data pairs give 10 equations, ,$'i (7) = 125, Si(14) = 275, S2(14) = 275, S'2(21) = 800, and so forth. We need 10 more equations.
To make the spline smooth, we require the curve to have both first and second derivatives equal, i.e., match slope and concavity, at the knots (data points). So, for i = 1..4, make
These requirements give us 8 more equations. For the last two equations, use the condition for “natural” splines:
We have the requisite 20 equations. Let’s use Maple to build the equations, the augmented coefficient matrix, and find the spline.
First, we load the needed packages and enter the data.
We define the individual cubic functions using an “indexed procname” to make the code more general.
Now define the natural cubic spline function for our 6 point data set.
In order to avoid some convoluted statements, we’ll define the cubic segment’s derivative functions directly.
Let’s calculate the 3 sets of equations that make up the system of 20 linear equations.
Displaying the sets as vectors make them much easier to read.
Get a list of the variables of the system: the coefficients of the equations.
Use Linear Algebra's GenerateMatrix to create the augmented matrix for the system. (To see the full matrices, execute interface(rtablesize= 50) before executing the next Maple command.)
Compute the reduced row echelon form of A.
Use LinearAlgebra's GenerateEquations to capture the values of the coefficients.
Set the values of the coefficients. And plot the results.
The natural cubic spline fits the data very well. Caution: do not use the spline outside the data! Plot over a larger range to see why.
to verify that we have found the curve.
In general, to connect N knots (data points), we need N — 1 cubic equations. To set up the system of equations, we will need: 1
2(N — 2) equations matching the endpoints of the N — 1 connecting cubic curves,
Combining these equations gives a total of 4n — 4 equations for our system
with (N — 1) x 4 variables.
4. Use the least squares technique to fit the model W = kL3 to the following data:
5. Use cubic spline interpolation to fit the following sets of data points.
Project 1. One of the main decisions that manufacturers have is to choose how much of a product to produce. Considering that an economy consists of producers of many things, this problem gets very complex very quickly. Leontief received the Nobel Prize in Economics in 1973 “for the development of the input-output method and for its application to important economic problems.” What we will discuss now comes from his work, hence the name Leontief Model. An example of such a model follows.
First, divide an economy into certain sectors. In reality, there are hundreds of sectors, but for the sake of simplicity, we will posit three sectors: manufacturing (m), electronics (e), and agriculture (a). We must decide how many units of each sector to produce, expressing the amounts as a production vector
Now, let’s say that the public wants 100 units of manufacturing, 200 units of electronics, and 300 units of agriculture. Put this data into an (external) demand vector
Now, one might say that if this is what the economy wants, then this is what should be produced; i.e., x = d. The problem, however, is that the production of certain resources actually consumes resources as well. In other words, it takes stuff to make stuff. How much is consumed by production can be expressed by using an input-output matrix.
The matrix T indicates that the production of 1 unit of manufacturing uses up 0.1 units of manufacturing, 0.2 units of electronics, and 0.1 units of agriculture. The production of 1 unit of electronics uses up 0.2 units of manufacturing, 0.1 units of electronics, and 0.1 units of agriculture. Finally, the production of 1 unit of agriculture uses up 0.3 units of manufacturing, 0.3 units of electronics, and 0.1 units of agriculture. So, not only must we account for what the people want, but we must also make up for what is used up in the process of producing what the people want. The amount consumed by production is called internal demand, it is given by the product Tx. Hence, what we produce needs to satisfy both internal demand and external demand. That is,
Using the matrix T above, determine the production vector x, also called the total demand, and the internal demand Tx for our three-sector economy.
Project 2. Wassily Leontief (1906-1999), the Russian-born, Nobel Prize winning American economist who, aside from developing highly sophist icated economic theories, also enjoyed trout fishing, ballet and fine wines. In this project, we will look at a very simple special case of his work called a closed exchange model.
Long, long ago, far, far away in the land of Eigenbazistan, in a small country town called Matrixville, there lived a Farmer, a Tailor, a Carpenter, a Coal Miner and Slacker Bob. The Farmer produced food; the Tailor, clothes; the Carpenter, housing; the Coal Miner supplied energy; and Slacker Bob made High Quality 100-Proof Moonshine, half of which he drank himself. Let’s make the following assumptions:
This type of economy is called a closed exchange model. Table 5.3 specifies what fraction of each of the goods is consumed by each person in our town.
TABLE 5.3: Matrixville’s Closed Exchange Model
So for example, the Carpenter consumes 22% of all food, 19% of all clothes, 22% of all housing, 22% of all energy and 10% of all High Quality 100 Proof Moonshine.
If the matrix I — T is invertible, the total demand equation, x = 7 x + d can be solved for x.