CH-04 (523172), страница 2

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

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

This is left as a homework exercisegiven in the Problems set.CENTRAL-DIFFERENCE OPERATORFor the interest of completeness and later application in numerical solution ofordinary differential equations, we also introduce the central difference operator, .When it is operating on yi, the definition is:hδy i = y x i +  − y x i −2h2(16)The first-order central difference is seldom used and the second-order centraldifference is frequently applied, which is:h  h δ 2 y i = δ y x i +   − δ y x i −   = y(x i + h ) − 2 y(x i ) + y(x i − h )2  2= y i +1 − 2 y i + y i −1© 2001 by CRC Press LLC(17)DIFFERENTIATION OPERATORAnother important operator that needs to be introduced in connection with theapplication of difference table is the differentiation operator, D, which is defined as:Dy(x = x i ) ≡dy(x)dxx=xi≡ Dy i(18)As it is our intention to apply an available difference table for numerical differentiation at one of the listed x values, or, at an unlisted x value, by using either theforward or backward differences of y values.

For example, we may want to find Dyat x = 1.2, or, at x = 1.24. To derive an expression for D in terms of , we recallthe Taylor’s series of a function y(x = a + h) near the neighborhood of x = a for asmall increment of h:y(a + h ) = y(a ) +y ′( a )y′′(a ) 2y ( j ) (a ) jh+h +…+h +…1!2!j!(19)where y(j) is the jth derivative with respect to x. Using the notation of differentiationoperator D and the shifting operator E, the above expression can be written as:Ey(a ) = y(a ) +hDy(a ) h 2 D2 y(a )h jD jy(a )++…++…j!1!2![(20)]= 1 + hD + h 2 D2 + … + h jD j + … y(a ) = e hD y(a )or,E = e hDandD=1lnEh(21)In order to use the difference table for numerical differentiation, we substituteEquation 6 into Equation 21 to obtain:D=1ln(1 + ∆ )h(22)By substituting the logarithmic function in Equation 21 with an infinite series1and applying the D operator for yi, the result is:Dy i =111∆ − ∆2 + ∆3 − … y ih23(23)Hence, to find Dy(x = 1.2) by using the finite differences in Table 1, Equation23 can be applied to obtain:© 2001 by CRC Press LLCDy 2 =1 112.5865 − 0.5x 0.763 + 0.138 − 0.012 = 22.480.1 34Notice that the above result is when up to the fourth-order forward differencesof y2 are all utilized.

Linear, parabolic, and cubic numerical differentiations at x =1.2 could also be calculated by taking only one, two, and three terms inside theparentheses of the above expression. The respective results are 25.865, 22.05, and22.51. Since y(x) = 1–2x + 3x2–4x3 + 5x4 and y(x) = –2 + 6x–12x2 + 20x3, the exactvalue of y(x = 1.2) = –2 + 7.2–17.28 + 34.56 = 22.48 indicates that the fourth-ordercalculation is the best.When Dyi is needed for xi near the end of x list, it is better to express D in termsof the backward-difference operation , which based on Equations 14 and 21 is:Dy(x i ) =[]11(ln E)y i = ln(1 − ∇)−1 y ihh111−1 ∇ 2 ∇3 ∇ 4=−∇ − ∇2 − ∇3 − … y i =  ∇ ++++ … y i23234h h(24)The shifting operator E and differentiation operator D can be combined to deriveformulas for numerical differentiation of y(x) at x values unlisted in the differencetable either in terms of forward-difference operator or backward-difference.

First,let recall Equations 7 and 23 and apply them to find y(x = xi + rh) in terms of theforward-difference operator as follows:y′(x i + rh ) =114DE r y i = ln(1 + ∆ )(1 + ∆ ) y ihh=r( r − 1) 21∆2 ∆3∆ + … y i+ − … 1 + r∆ +∆ −h232=12 r − 1 2 3r 2 − 6 r + 2 3 2 r 3 − 9 r 2 + 11r − 3 4∆ +∆ +∆ + … y i∆ +h2612(25)Similarly, y(xi-rh) can be expressed in terms of backward-differential operator, as:y′(x i − rh ) =11rDE − r y i = [− ln(1 − ∇)](1 − ∇) y ihh=1r( r − 1) 2∇ 2 ∇3++ … 1 − r∇ +∇ + … y i∇ +h232=12 r − 1 2 3r 2 − 6 r + 2 3 2 r 3 − 9 r 2 + 11r − 3 4∇ +∇ −∇ + … y i∇ −h1226© 2001 by CRC Press LLC(26)It should be particularly pointed out that in using Equation 26 for finding y(x)where xi–1<x<xi, r is to be calculated as (xi-x)/h and not as (x-xi–1)/h. For example,in using Table 1, to calculate y(x = 1.56) based on Equation 26 r should be equalto (1.6–1.56)/0.1 = 0.4 and not equal to (1.56–1.5)/0.1 = 0.6, and i equal to 6 not 5because in Table 1 x6 = 1.6 and x5 = 1.5.Program DiffTabl has been prepared for interactive interpolation and differentiation using a difference table such as Table 1.

User can interactively specify thedata points and where the interpolation or differentiation is to be calculated and alsoup to what order of finite differences should the computation be performed. BothQuickBASIC and FORTRAN versions of the program are made available. Listingsare given below along with some sample applications. At present, the highest orderof finite difference allowed is the fourth.QUICKBASIC VERSION© 2001 by CRC Press LLCSample ApplicationFORTRAN VERSION© 2001 by CRC Press LLC© 2001 by CRC Press LLC© 2001 by CRC Press LLCSample ApplicationUsing the input data and difference table as for the QuickBASIC version, theinteractive application of the FORTRAN version gives a sample run as follows:MATLAB APPLICATIONA file DiffTabl.m can be created and added to MATLAB m files for printingout the difference table. This file may be written as:© 2001 by CRC Press LLCThis m file then can be applied as illustrated by the following examples:The statement format compact requests the results to be displayed withoutunnecessary line spaces on screen.It is appropriate at this time to demonstrate how some graphic capability ofMATLAB can be effectively utilized here in connection with the difference table.First, the calculation of the first derivatives can be graphically interpreted as theslope of the linear segments connecting the given points as shown in Figure 1 whichis obtained with the following interactively entered statements:© 2001 by CRC Press LLCFIGURE 1.

The calculation of the first derivatives can be graphically interpreted as the slopeof the linear segments connecting the given points.The first, X = , statement creates an array having 6 elements whose values startat 1.1 and ends at 1.6 and have a uniform increment of 0.1. In the plot statement,the character — inside the first set of single quotation signs requests that the givenset of points specified by the coordinates arrays X and Y are to be connected bysolid lines while the character * inside the second set of single quotation signs isfor marking those points.It also is appropriate at this time to introduce the bar graph feature of MATLABwhen we consider data set and difference table.

Figure 2 is presented to show theuse of bar and num2str commands of MATLAB. The bar command plots a seriesof vertical bars based on a set of coordinates arrays X and Y where X values mustbe equally spaced. The num2str command converts a numerical value into a string,it often facilitates the display of numerical values in conjunction with the textcommand. The following interactively entered statements have enabled Figure 2 tobe displayed:© 2001 by CRC Press LLCFIGURE 2.Notice that the first two arguments for text are where the text string should beplaced whereas the third argument converts the value of Y(I) to be printed as a string.The for-end loop allows all Y values to be placed at proper heights.MATHEMATICA APPLICATIONSTo produce a plot similar to Figure 3 in the program DiffTabl by application ofMathematica, we may enter statements and obtain the following:Input[1]: = X = Table[i,{i,1.1,1.6,0.1}; Y = Exp[X];Input[2]: = g1 = Show[Graphics[Line[Table[{X[[i]],Y[[i]]},{i,1,6}]]]]Input[3]: = g2 = Show[g1, Frame->True, AspectRatio->1,FrameLabel->{“X-axis”,”Y-axis”}]Input[4]: = g3 = Show[g2,Graphics[Table[Text[“X”,{X[[i]],Y[[i]]},{i,1,16}]]Input[5]: = Show[g3,Graphics[Text[“Linearly Connected”,{1.12,4.8},{–1,0}],Text[“Data Points”,{1.12,4.6},{–1,0}]]]© 2001 by CRC Press LLCFIGURE 3.Only the final plot is presented here.

The intermediate plots designated as g1,g2, and g3 can be recalled and displayed if necessary. The Line command in Input[3]directs the specified pairs of coordinates to be linearly connected.A bar graph can be drawn by application of Mathematica command Rectangleand their respective values by the command Text. The following statements recreateFigure 4 in the program DiffTabl.:Input[1]: = X = {1,2,3,4,5}; Y = {2,4,7,11,24};Input[2]: = g1 = Show[Graphics[Table[Rectangle[{X[[i]]–0.4,0},X[[i]] + 0.4,Y[[i]]}],{i,1,5}]]]Input[3]: = g2 = Show[g1,Graphics[Table[Text[Y[[i]],{X[[i]]–0.1,Y[[i]] + 1}],{i,1,5}]]]Input[4]: = g3 = Show[g2, Frame->True, AspectRatio->1]Input[5]: = g4 = Show[g3,Graphics[Text[“Bar Graph of X–Y Data”,{0.5,18},{–1,0}]]]Input[6]: = Show[%,FrameLabel->{“X-axis”,”Y-axis”}]© 2001 by CRC Press LLCFIGURE 4.FIGURE 5.Notice that when no expression inside a pair of doubt quotes is provided forthe command Text, the value of the specified variable will be printed at the desiredlocation.

This is demonstrated in Input[3].Mathematica also has a function called BarChart in its Graphics packagewhich can be applied to plot Figure 5 as follows (again, some intermediate Outputresponses are omitted):© 2001 by CRC Press LLCInput[1]: = Y = {2,4,7,11,24};Input[2]: = <<Graphics`Graphics`Input[3]: = g1 = BarChart[Y]Input[4]: = g2 = Show[g1,Graphics[Table[Text[Y[[i]],{i,Y[[i]] + 1}],{i,1,5}]]To print out a difference table of a given set of n y values, we can arrange they values and up to the n-1st order of their differences in a matrix form. The y valuesare to be listed in the first column and their ith-order diferences are to be listed inthe i + 1st column for i = 1,2,…,n–1.

The following Mathematica input and ouputstatements demonstrate the print out of a set of 6 y values:Input[1]: = y = {1,3,7,12,44,78};Input[2]: = n = Length[y]; yanddys = Table[x,{i,n},{j,n}];MatrixForm[yanddys]Output[2] =xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInput[3]: = Do[yanddys[[i,1]] = y[[i]]; MatrixForm[yanddys]Output[3] =137124478xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInput[4]: = Do[Do[yanddys[[i,j]] = yanddys[[i + 1,j–1]]-yanddys[[i,j–1],{i,n-j + 1}],{j,2,n}]; MatrixForm[yanddys]Output[4] =1371244782453234x© 2001 by CRC Press LLC2–1 27 –78126 –51x27 –25xx2xxxxxxxxxxxNotice that in Input[2], the Mathematica functions Length has been appliedto determine the number of components in the array y, Table is used to initialize amatrix of n by n with the character x, and MatrixForm allows the matrix, yanddys,to be printed in a matrix form.

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

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

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

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