CH-01 (523167), страница 2

Файл №523167 CH-01 (Pao - Engineering Analysis) 2 страницаCH-01 (523167) страница 22013-09-15СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 2)

That is:{V} = {V}T {V} = v11 + v22 + … + v322(6)For a L-by-M matrix having elements eij where the row index i ranges from 1to L and the column index j ranges from 1 to M, the transpose of this matrix whenits elements are designated as trc will have a value equal to ecr where the row indexr ranges from 1 to M and the column index c ranges from 1 to M because thistranspose matrix is of order M by L. As a numerical example, here is a pair of a3 × 2 matrix [G] and its 2 × 3 transpose [H]:6[G] = 53× 24−3−2  and−16−3[H] = [G]T = 2 ×35−24−1If the elements of [G] and [H] are designated respectively as gij and hij, thenhij = gji.

For example, from above, we observe that h12 = g21 = 5, h23 = g32 = –1, andso on. There will be more examples of applications of Equations 5 and 6 in theensuing sections and chapters.Having introduced the transpose of a matrix, we can now conveniently revisitthe addition of {D} and {E} in Figure 1 in algebraic form as {F} = {D} + {E} =[4 –3]T + [–3 1]T = [4+(–3) –3+1]T = [1 –2]T. The resulting sum vector is indeedcorrect as it is graphically verified in Figure 1.

The saving of space by use oftransposes of vectors (row matrices) is not evident in this case because all vectorsare two-dimensional; imagine if the vectors are of much higher order.Another noteworthy application of matrix multiplication and transposition is toreduce a system of linear algebraic equations into a simple, (or, should we say asingle) matrix equation. For example, if we have three unknowns x, y, and z whichare to be solved from the following three linear algebraic equations:© 2001 by CRC Press LLCx + 2 y + 3z = 45x + 6y + 7z = 8−2 x − 37 = 9(7)Let us introduce two vectors, {V} and {R}, which contain the unknown x, y,and z, and the right-hand-side constants in the above three equations, respectively.That is:x TV=xyz={ } [] y z and4TR=489={ } [] 89 (8)Then, making use of the multiplication rule of matrices, Equation 5, the systemof linear algebraic equations, 7, now can be written simply as:[C]{V} = {R}(9)where the coefficient matrix [C] formed by listing the coefficients of x, y, and z infirst equation in the first row and second equation in the second row and so on.

That is,1[C] =  5−226−3370 There will be more applications of matrix multiplication and transposition inthe ensuing chapters when we discuss how matrix equations, such as [C]{V} = {R},can be solved by employing the Gaussian Elimination method, and how ordinarydifferential equations are approximated by finite differences will lead to the matrixequations. In the abbreviated matrix form, derivation and explanation of computational methods becomes much simpler.Also, it can be observed from the expressions in Equation 8 how the transpositioncan be conveniently used to define the two vectors not using the column matriceswhich take more lines.FORTRAN VERSIONSince Equations 1 and 2 require repetitive computation of the elements in thesum matrix [S] and difference matrix [D], machine could certainly help to carry outthis laborous task particularly when matrices of very high order are involved.

Forcovering all rows and columns of [S] and [D], looping or application of DO statementof the FORTRAN programming immediately come to mind. The following programis provided to serve as a first example for generating [S] and [D] of two givenmatrices [A] and[B]:© 2001 by CRC Press LLCThe resulting display on the screen is:To review FORTRAN briefly, we notice that matrices should be declared asvariables with two subscripts in a DIMENSION statement. The displayed results ofmatrices A and B show that the values listed between // in a DATA statment will befilling into the first column and then second column and so on of a matrix. To instructthe computer to take the values provided but to fill them into a matrix row-by-row,a more explicit DATA needs to be given as:DATA ((A(I,J),J = 1,3),I = 1,3)/1.,4.,7.,2.,5.,8.,3.,6.,9./When a number needs to be repeated, the * symbol can be conveniently appliedin the DATA statement exemplified by those for the matrix [B].Some sample WRITE and FORMAT statements are also given in the program.The first * inside the parentheses of the WRITE statement when replaced by anumber allows a device unit to be specified for saving the message or the values ofthe variables listed in the statement.

* without being replaced means the monitorwill be the output unit and consequently the message or the value of the variable(s)will be displayed on screen. The second * inside the parentheses of the WRITE© 2001 by CRC Press LLCstatement if not replaced by a statement number, in which formats for printing thelisted variables are specified, means “unformatted” and takes whatever the computerprovides. For example, statement number 15 is a FORMAT statement used by theWRITE statement preceding it. There are 18 variables listed in that WRITE statementbut only six F5.1 codes are specified.

F5.1 requests five column spaces and one digitafter the decimal point to be used to print the value of a listed variable. / in aFORMAT statement causes the print/display to begin at the first column of the nextline. 6F5.1 is, however, enclosed by the inner pair of parentheses that allows it tobe reused and every time it is reused the next six values will be printed or displayedon next line.

The use (*,*) in a WRITE statement has the convenience of viewingthe results and then making a hardcopy on a connected printer by pressing the PrtSc(Print Screen) key.INTERACTIVE OPERATIONProgram MatxAlgb.1 only allows the two particular matrices having their elements specified in the DATA statement to be added and subtracted.

For finding thesum matrix [S] and difference matrix [D] for any two matrices of same order N, weought to upgrade this program to allow the user to enter from keyboard the orderN and then the elements of the two matrices involved. This is interactive operationof the program and proper messages should be given to instruct the user what to dowhich means the program should be user-friendly.

The program MatxAlgb.2 listedbelow is an attempt to achieve that goal:© 2001 by CRC Press LLCThe interactive execution of the problem solved by the previous version Matxalgb.1now can proceed as follows:© 2001 by CRC Press LLCThe results are identical to those obtained previously. The READ statementallows the values for the variable(s) to be entered via keyboard. A WRITE statementhas no variable listed serves for need of skipping a line to provide better readabilityof the display. Also the I and E format codes are introduced in the statement 10. Iwwhere w is an integer in a FORMAT statement requests w columns to be providedfor displaying the value of the integer variable listed in the WRITE statement, inwhich the FORMAT statement is utilized.

Ew.d where w and d should both be integerconstants requests w columns to be provided for display a real value in the scientificform and carrying d digits after the decimal point. Ew.d format gives more feasibilitythan Fw.d format because the latter may cause an error message of insufficient widthif the value to be displayed becomes too large and/or has a negative sign.MORE PROGRAMMING REVIEWBesides the operation of matrix addition and subtraction, we have also discussedabout the transposition and multiplication of matrices.

For further review of computerprogramming, it is opportune to incorporate all these matrix algebraic operationsinto a single interactive program. In the listing below, three subroutines for matrixaddition and subtraction, transposition, and multiplication named as MatrixSD,Transpos, and MatxMtpy, respectively, are created to support a program calledMatxAlgb (Matrix Algebra).© 2001 by CRC Press LLC© 2001 by CRC Press LLCThe above program shows that Subroutines are independent units all started witha SUBROUTINE statement which includes a name followed by a pair of parenthesesenclosing a number of arguments.

The Subroutines are called in the main programby specifying which variables or constants should serve as arguments to connect tothe subroutines. Some arguments provide input to the subroutine while other arguments transmit out the results determined by the subroutine. These are referred toas input arguments and output arguments, respectively. In many instances, an argument may serve a dual role for both input and output purposes. To construct as anindependent unit, a subprogram which can be in the form of a SUBROUTINE, orFUNCTION (to be elaborated later) must have RETURN and END statements.It should also be remarked that program MatxAlgb is arranged to handle anymatrix having an order of no higher than 25 by 25.

For this restriction and for havingthe flexibility of handling any matrices of lesser order, the Lmax, Mmax, and Nmaxarguments are added in all three subroutines in order not to cause any mismatch ofmatrix sizes between the main program and the called subroutine when dealing withany L, M, and N values which are interactively entered via keyboard.Computed GOTO and arithmetic IF statements are also introduced in the program MatxAlgb. GOTO (i,j,k,…) C will result in going to (execute) the statementnumbered i, j, k, and so on when C has a value equal to 1, 2, 3, and so on, respectively.IF (Expression) a,b,c will result in going to the statement numbered a, b, or c if thevalue calculated by the expression or a single variable is less than, equal to, or,greater than zero, respectively.It is important to point out that in describing any derived procedure of numericalcomputation, indicial notation such as Equation 5 should always be preferred tofacilitate programming.

In that notation, the indices are directly used, or, literallytranslated into the index variables for the DO loops as can be seen in SubroutineMatxMtpy which is developed according to Equation 5. Subroutine MatrixSD isanother example of literally translating Equations 1 and 2. For defining the valuesof the element in the following tri-diagonal band matrix:© 2001 by CRC Press LLC1−3[C ] =  00 021−300021−300021−300021 we ought not to write 25 separate statements for the 25 elements in this matrix butderive the indicial formulas for i,j = 1 to 5:cij = 0,if j > i + 2, or, j < i − 2ci,i +1 = 2,andci,i −1 = −3Then, the matrix [C] can be generated with the DO loops as follows:The above short program also demonstrates the use of the CONTINUE statement for ending the DO loop(s), and the logical IF statements.

Характеристики

Тип файла
PDF-файл
Размер
821,54 Kb
Тип материала
Учебное заведение
Неизвестно

Список файлов книги

Свежие статьи
Популярно сейчас
Почему делать на заказ в разы дороже, чем купить готовую учебную работу на СтудИзбе? Наши учебные работы продаются каждый год, тогда как большинство заказов выполняются с нуля. Найдите подходящий учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6361
Авторов
на СтудИзбе
310
Средний доход
с одного платного файла
Обучение Подробнее