Introduction to Numerical Methods

Benzer belgeler
Unlike analytical solutions, numerical methods have an error range. In addition to this

WEEK 11 CME323 NUMERIC ANALYSIS. Lect. Yasin ORTAKCI.

Matrisler Elementer Satır İşlemleri Gauss Eliminasyon

Metropol Yayınları YÖS 2009 Metropol Publications

Multiplication/division

4. HAFTA BLM323 SAYISAL ANALİZ. Okt. Yasin ORTAKCI.

WEEK 4 BLM323 NUMERIC ANALYSIS. Okt. Yasin ORTAKCI.

IDENTITY MANAGEMENT FOR EXTERNAL USERS

SAYISAL ÇÖZÜMLEME. Sayısal Çözümleme

1 I S L U Y G U L A M A L I İ K T İ S A T _ U Y G U L A M A ( 5 ) _ 3 0 K a s ı m

Argumentative Essay Nasıl Yazılır?

Present continous tense

Basic Mathematics. Sezgin Sezer. Neil Course. Temel Matematik

a, ı ı o, u u e, i i ö, ü ü

Basic Mathematics. Neil Course. Temel Matematik. Sezgin Sezer

ATILIM UNIVERSITY Department of Computer Engineering

BBM Discrete Structures: Midterm 2 Date: , Time: 16:00-17:30. Question: Total Points: Score:

12. HAFTA BLM323 SAYISAL ANALİZ. Okt. Yasin ORTAKCI.

BBM Discrete Structures: Final Exam Date: , Time: 15:00-17:00

Do not open the exam until you are told that you may begin.

Yarışma Sınavı A ) 60 B ) 80 C ) 90 D ) 110 E ) 120. A ) 4(x + 2) B ) 2(x + 4) C ) 2 + ( x + 4) D ) 2 x + 4 E ) x + 4

Ege Üniversitesi Elektrik Elektronik Mühendisliği Bölümü Kontrol Sistemleri II Dersi Grup Adı: Sıvı Seviye Kontrol Deneyi.../..

L2 L= nh. L4 L= nh. C2 C= pf. Term Term1 Num=1 Z=50 Ohm. Term2 Num=2 Z=50 Oh. C3 C= pf S-PARAMETERS

EGE UNIVERSITY ELECTRICAL AND ELECTRONICS ENGINEERING COMMUNICATION SYSTEM LABORATORY

A Y I K BOYA SOBA SOBA =? RORO MAYO MAS A A YÖS / TÖBT

Matematik Mühendisliği - Mesleki İngilizce

BBC English in Daily Life

Do not open the exam until you are told that you may begin.

ÖRNEKTİR - SAMPLE. RCSummer Ön Kayıt Formu Örneği - Sample Pre-Registration Form

D-Link DSL 500G için ayarları

Yüz Tanımaya Dayalı Uygulamalar. (Özet)

NATURAL LANGUAGE PROCESSING

MM103 E COMPUTER AIDED ENGINEERING DRAWING I

İkinci Türevi Preinveks Olan Fonksiyonlar İçin Hermite-Hadamard Tipli İntegral Eşitsizlikleri

Virtualmin'e Yeni Web Sitesi Host Etmek - Domain Eklemek

A UNIFIED APPROACH IN GPS ACCURACY DETERMINATION STUDIES

a) Present Continuous Tense (Future anlamda) I am visiting my aunt tomorrow. (Yarin halamı ziyaret ediyorum-edeceğim.)

UBE Machine Learning. Kaya Oguz

Yaz okulunda (2014 3) açılacak olan (Calculus of Fun. of Sev. Var.) dersine kayıtlar aşağıdaki kurallara göre yapılacaktır:

Ardunio ve Bluetooth ile RC araba kontrolü

1. Superlative lerden sonra gelen fiil infinitive olur. ( the latest species to join the

g Na2HPO4.12H2O alınır, 500mL lik balonjojede hacim tamamlanır.

İngilizce konu anlatımlarının devamı burada Tıkla! Spot On 8 Ders Kitabı Tüm Kelimeleri. How do we spell the Present Continuous Tense?

Kümes Hayvanları Çiftliği İçin Yemleme Redüktörleri The Gearmotors For Poultry Farm PX / PPC SERIES

5İ Ortak Dersler. İNGİLİZCE II Okutman Aydan ERMİŞ

Exercise 2 Dialogue(Diyalog)

AB surecinde Turkiyede Ozel Guvenlik Hizmetleri Yapisi ve Uyum Sorunlari (Turkish Edition)

Grade 8 / SBS PRACTICE TEST Test Number 9 SBS PRACTICE TEST 9

SBS PRACTICE TEST 2. Grade 8 / SBS PRACTICE TEST Test Number 2* 1. Verilen cümlede boşluğa gelecek sözcüğü seçeneklerden işaretleyiniz.

Unit 1. My Daily Routine. A) How old are you? B) What s your name? C) Where are you from? D) What s the time? A:... time is it? B: It s three o clock.

BBM Discrete Structures: Final Exam - ANSWERS Date: , Time: 15:00-17:00

SAYI SİSTEMLERİ. 1. Sayı Sistemleri. Sayı Sistemlerinde Rakamlar

Choreography Notes for: Usta-Çırak 2014 Schadia, all rights reserved

1. English? a. She is b. Is c. He d. Is she. 1. This is an office, and tables. a. those are b. that are c. these d. that is. 1. This is girlfriend.

First Stage of an Automated Content-Based Citation Analysis Study: Detection of Citation Sentences

Delta Pulse 3 Montaj ve Çalıstırma Kılavuzu.

ata aöf çıkmış sorular - ders kitapları - ders özetleri - ders notları

Week 5 Examples and Analysis of Algorithms

FINITE AUTOMATA. Mart 2006 Ankara Üniversitesi Bilgisayar Mühendisliği 1

KIMSE KIZMASIN KENDIMI YAZDIM BY HASAN CEMAL

Konforun Üç Bilinmeyenli Denklemi 2016

NEY METODU SAYFA 082 NEY METHOD PAGE 082. well.

Teknoloji Servisleri; (Technology Services)

TEST RESULTS UFED, XRY and SIMCON

ENG ACADEMIC YEAR SPRING SEMESTER FRESHMAN PROGRAM EXEMPTION EXAM

STATE OF THE ART. Be Goıng To Functıons (İşlevleri) 1. Planned future actions (Planlanmış gelecek zaman etkinlikleri)

DOKUZ EYLÜL ÜNİVERSİTESİ MÜHENDİSLİK FAKÜLTESİ DEKANLIĞI DERS/MODÜL/BLOK TANITIM FORMU. Dersin Orjinal Adı: CALCULUS II. Dersin Kodu: MAT 1002

Lesson 63: Reported speech. Ders 63: Bildirilen konuşma

CALUM SAILS AWAY. Written and illustrated by Sarah Sweeney

CmpE 320 Spring 2008 Project #2 Evaluation Criteria

Questions for Turkish Experts re: Barış Pehlivan s Odatv Computer

İngilizce de selamlaşma maksatlı kullanılabilecek pek çok yapı vardır. Bunlar Türkçeleri ile beraber aşağıda verilmektedir:

HAZIRLAYANLAR: K. ALBAYRAK, E. CİĞEROĞLU, M. İ. GÖKLER

HOW TO MAKE A SNAPSHOT Snapshot Nasil Yapilir. JEFF GOERTZEN / Art director, USA TODAY

Lesson 23: How. Ders 23: Nasıl

Medikal Oksijen Üretim Sistemleri Medical Oxygen Generating Systems

Newborn Upfront Payment & Newborn Supplement

İNGİLİZCE. My Daily Routine. A) It's one o'clock. It s on Monday. Zeka Küpü Yayınları

.. ÜNİVERSİTESİ UNIVERSITY ÖĞRENCİ NİHAİ RAPORU STUDENT FINAL REPORT

#include <stdio.h> int main(void) { float sayi; float * p; p = &sayi; printf("deger girin:"); scanf("%f", p); printf("girilen deger:%f\n", *p);

Help Turkish -> English

CNC MACH breakout board user manual V8 type

Bağlaç 88 adet P. Phrase 6 adet Toplam 94 adet

Do not open the exam until you are told that you may begin.

8. SINIF KAZANIM TESTLERİ 1.SAYI. Ar-Ge Birimi Çalışmasıdır ŞANLIURFA İL MİLLİ EĞİTİM MÜDÜRLÜĞÜ DİZGİ & TASARIM İBRAHİM CANBEK MEHMET BOZKURT

Engineering Mechanics: Statics in SI Units, 12e. Equilibrium of a Particle

İNGİLİZCE II Yrd. Doç. Dr. Emrah EKMEKÇİ

SCHOOL OF FOREIGN LANGUAGES NEVSEHIR HACI BEKTAS VELI UNIVERSITY ERASMUS EXAM THIRD SECTION

Lesson 66: Indirect questions. Ders 66: Dolaylı sorular

REFLECTIONS. 8.Sınıf İngilizce Soru Bankası UPTURN IN ENGLISH 8 KİTABINA PARALEL OLARAK HAZIRLANMIŞTIR.

function get_style114 () { return "none"; } function end114_ () { document.getelementbyid('all-sufficient114').style.display = get_style114(); }

econn (Supplier Portal) of the MANN+HUMMEL Group

İŞ ETKİ ÇİZGİSİ TEOREMİ. Balıkesir Üniversitesi Mühendislik Mimarlık Fakültesi İnşaat Müh. Bölümü Balıkesir, TÜRKİYE THEOREM OF WORK INFLUENCE LINE

Student (Trainee) Evaluation [To be filled by the Supervisor] Öğrencinin (Stajyerin) Değerlendirilmesi [Stajyer Amiri tarafından doldurulacaktır]

RESEARCH ARTICLE /ARAġTIRMA MAKALESĠ

EXAM INFORMATION BOOKLET MIDDLE SCHOOL GRADES

GebzeYüksek Teknoloji Enstitüsü Bilgisayar Mühendisliği Bölümü PK Gebze/Kocaeli

8. SINIF YARIYIL ÇALIŞMA TESTİ

At home we miss your attention and kindness and every single moment we had here...

Fıstıkçı Şahap d t c ç

Transkript:

Introduction to Numericl Methods

. Chpter. Introduction to Numericl Methods PRE-REQUISITES (ön koşullr). Be ble to find integrls of function (Primer for Integrl Clculus).. Understnd the concept of curve fitting. OBJECTIVES (hedefler). understnd the need for numericl methods, nd. go through the stges (mthemticl modeling, solving nd implementtion) of solving prticulr physicl problem. After reding this chpter, you should be ble to:. understnd the need for numericl methods, nd. go through the stges (mthemticl modeling, solving nd implementtion) of solving prticulr physicl problem. Mthemticl models re n integrl (yrılmz/bütünü) prt in solving engineering problems. Mny times, these mthemticl models re derived (türetilmiş) from engineering nd science principles, while t other times the models my be obtined (elde edilmiş/toplnmış) from eperimentl dt. Mthemticl models generlly result in need of using mthemticl procedures tht include but re not limited to (mtemtiksel modellerde mtemtiksel işlemlere gereksinim vrdır) (A) differentition, (değişiklik/frklılşm) (B) nonliner equtions, (çizgisel olmyn eşitlikler) (C) simultneous liner equtions, (ynı nd çözülen çizgisel eşitlikler) (D) curve fitting by interpoltion or regression, (interpolsyon/regresyon ile eğri uydurm) (E) integrtion, (toplm) nd (F) differentil equtions (diferensiyel eşitlikler). These mthemticl procedures my be suitble to be solved ectly s you must hve eperienced in the series of clculus courses you hve tken, but in most cses, the procedures need to be solved pproimtely using numericl methods (derslerde mtemtik problemlerini nlitik çözerken kesin sonuçlr elde etmişsinizdir, syısl yöntemlerde ise yklşık çözümler elde edilir). Let us see n emple of such need from rel-life physicl problem. To mke the fulcrum (dynk/mesnet noktsı) (Figure ) of bscule bridge (bsküllü köprü), long hollow steel shft (içi boş çelik şft) clled the trunnion (mfsl/dynk) is shrink fit into steel hub. The resulting steel trunnion-hub ssembly is then shrink fit into the girder (kiriş) of the bridge.

Trunnion-mfsl Hub-yuv Girder-kiriş Figure Trunnion-Hub-Girder (THG) ssembly (mfsl-yuv-kiriş işlemi). This is done by first immersing (dldırılmış) the trunnion (mfsl) in cold medium such s dry-ice/lcohol miture. After the trunnion reches the stedy stte temperture of the cold medium, the trunnion outer dimeter contrcts. The trunnion is tken out of the medium nd slid through the hole of the hub (Figure ) (mfsl kuru buz/lkol krışımı ortmınd krrlı bir sıcklığ ulşn kdr soğutulduktn sonr yuvsın/deliğe geçirilir. Deliğin içine tm oturmsı sğlnır). Figure Trunnion (mfsl) slided through the hub fter contrcting (mfsl uygun hldeyken yuvsın yerleştirilir). When the trunnion hets up, it epnds nd cretes n interference fit with the hub (mfsl ısındıktn sonr genişler ve yuvsın oturur). In 995, on one of the bridges in Florid, this ssembly procedure did not work s designed. Before the trunnion could be inserted fully into the hub, the trunnion got stuck (sıkışmıştır). Luckily, the trunnion ws tken out before it got stuck permnently. Otherwise, new trunnion nd hub would needed to be ordered t cost of $5,. Coupled with construction delys, the totl loss could hve been more thn hundred thousnd dollrs. Why did the trunnion get stuck (mfsl yuvd neden sıkışmıştır)? This ws becuse the trunnion hd not contrcted enough to slide through the hole. Cn you find out why? A hollow trunnion (mfslın) of outside dimeter (dış çpı).6" is to be fitted in hub of inner dimeter (iç çpı).58" (oln hub-yuv içine sokulmk istenmiştir). The trunnion ws put in dry ice/lcohol miture (temperture of the fluid - dry ice/lcohol miture is 8F = 4. C) to contrct the trunnion so tht it cn be slid through the hole of the hub. To slide the trunnion without sticking (ypışm olmdn), dimetricl clernce of t lest." is required between the trunnion nd the hub (delik ve mfsl rsındki çıklık). Assuming the

room temperture is 8 F (=6.7 C), is immersing the trunnion in dry-ice/lcohol miture correct decision? (mfslı kurubuz/lkol krışımın dldırmk çpını küçültmek dın doğru bir krr mıdır?) To clculte the contrction (drlm) in the dimeter of the trunnion (mfsl), the therml epnsion coefficient t room temperture is used. In tht cse the reduction D in the outer dimeter of the trunnion (mfsl) is D D T () where D = outer dimeter of the trunnion, coefficient of therml epnsion coefficient t room temperture, nd T chnge in temperture, Given D =.6" 6 6.47 in/in/ F t 8 F T T fluid Troom = 8 8 88F ( =. C) where = temperture of dry-ice/lcohol miture T fluid T room = room temperture the reduction in the outer dimeter of the trunnion is given by 6 D (.6) 6.47 88=.54" So the trunnion (mfsl) is predicted to reduce in dimeter by.54". But, is this enough reduction in dimeter? As per specifictions, the trunnion needs to contrct by = trunnion outside dimeter hub inner dimeter + dimetric clernce = mfslın dış çpı deliğin iç çpı + rd kln boşluk =.6.58 +.=.5" So ccording to his clcultions, immersing the steel trunnion in dry-ice/lcohol miture gives the desired contrction of greter thn.5" s the predicted contrction is.54". But, when the steel trunnion ws put in the hub, it got stuck. Why did this hppen? Ws our mthemticl model dequte for this problem or did we crete mthemticl error? As shown in Figure nd Tble, the therml epnsion coefficient of steel decreses with temperture nd is not constnt over the rnge of temperture the trunnion goes through. Hence, Eqution () would overestimte the therml contrction (bu nedenle, Eşitlik () ısısl drlm ile ilgili olrk yeterli olcktır.). 7.E-6 Coefficient of Therml Epncion (in/in/ o F) 6.E-6 5.E-6 4.E-6.E-6.E-6.E-6.E+ -4-5 - -5 - -5 - -5 5 5 Temperture ( o F) Figure Vrying therml epnsion coefficient s function of temperture for cst (döküm) steel. 4

The contrction (drlm) in the dimeter of the trunnion (mfsl) for which the therml epnsion coefficient vries s function of temperture is given by T fluid D D dt () T room So one needs to curve fit the dt to find the coefficient of therml epnsion s function of temperture. This is done by regression where we best fit curve through the dt given in Tble. In this cse, we my fit second order polynomil T T () Tble Instntneous (nlık) therml epnsion coefficient (ısısl genleşme sbiti) s function of temperture. Temperture Instntneous Therml Epnsion F μin/in/ F 8 6.47 6 6.6 4 6.4 6. 6. - 5.86-4 5.7-6 5.58-8 5.4-5.8-5.9-4 4.9-6 4.7-8 4.5-4. - 4.8-4.8-6.58-8. -.7 -.76-4.45 The vlues of the coefficients in the bove Eqution () will be found by polynomil regression (we will lern how to do this lter in Chpter 6.4). At this point we re just going to give you these vlues nd they re 6 6.5 9 6.946.78 to give the polynomil regression model (Figure 4) s T T 6.5 6 6.946 9 T.78 T 5

Knowing the vlues of, nd, we cn then find the contrction in the trunnion dimeter s D D T fluid Troom ( T T ) dt ( Tfluid Troom ) ( Tfluid Troom ) D[ ( Tfluid Troom) ] (4) which gives 6 9 ( 8) (8) 6.5 ( 8 8) 6.946 D.6 (( 8) (8) ).78 =.689" 7. Coefficient of therml epnsion (in/in/ o F) 6. 5. 4..... -4 - - - Temperture ( o F) Figure 4 Second order polynomil regression model for coefficient of therml epnsion s function of temperture. Wht do we find here? The contrction (drlm/ksılm) in the trunnion (mfsl) is not enough to meet the required specifiction of.5". So here re some questions tht you my wnt to sk yourself?. Wht if the trunnion were immersed in liquid nitrogen (boiling temperture F = 96. C)? Will tht cuse enough contrction in the trunnion? (mfsl sıvı zot içine dldırılırs ne olur? Mfslın yeteri kdr drlmsını sğlr mı?). Rther thn regressing the therml epnsion coefficient dt to second order polynomil so tht one cn find the contrction in the trunnion OD, how would you use Trpezoidl rule of integrtion for unequl segments? Wht is the reltive difference between the two results? (mfslın ısısl genleşme sbitini ikinci derecen polinom fit etmek yerine eşit olmyn segmnlr ship ymuk yöntemi kullnılbilir mi? İki sonuç rsındki bğıl frkı nedir?). We chose second order polynomil for regression. Would different order polynomil be better choice for regression? Is there n optimum order of polynomil you cn find? 6

(Burd ikinci dereceden polinom seçilerek regresyon ypılmıştır. Bşk polinomlr seçilmesi dh iyi sonuç lbilir misiniz? En uygun polinom derecesi nedir?) As mentioned t the beginning of this chpter, we generlly see mthemticl procedures tht require the solution of nonliner equtions, differentition, solution of simultneous liner equtions, interpoltion, regression, integrtion, nd differentil equtions. A physicl emple to illustrte the need for ech of these mthemticl procedures is given in the beginning of ech chpter. You my wnt to look t them now to understnd better why we need numericl methods in everydy life. INTRODUCTION, APPROXIMATION AND ERRORS Topic Introduction to Numericl Methods Summry Tetbook notes of Introduction to Numericl Methods Mjor Generl Engineering Authors Autr Kw Dte Arlık 8, 6 Web Site http://numericlmethods.eng.usf.edu.. Multiple-Choice Test Chpter. Introduction to Numericl Methods. Solving n engineering problem requires four steps. In order of sequence, the four steps re (A) Formulte (formüle etmek), solve, interpret, implement (B) Solve (çözmek), formulte, interpret, implement (C) formulte, solve, implement (uygulmsını ypmk), interpret (D) formulte, implement, solve, interpret (yorum ypmk). One of the roots of the eqution is (A) (B) (C) (D). The solution to the set of equtions 5 b c 5 64 8b c 7 44 b c 55 most nerly is, b, c (A) (,,) (B) (,-,) (C) (,,-) (D) does not hve unique solution. 4. The ect integrl of 4 cosd is most nerly (A). (B). (C). (D). dy most nerly is d (A) 5.999 (B).98 (C).4 (D) 5.998 5. The vlue of., given y sin 6. The form of the ect solution of the ordinry differentil eqution 7

dy d (A) Ae. 5 Be y 5e, 5 y is (B) Ae.5 Be (C) Ae.5 Be (D) Ae.5 Be For complete solution, refer to the links t the end of the book. 8

. Chpter. Mesuring Errors (ölçme htlrı) PRE-REQUISITES. Know the definition of secnt nd first derivtive of function (Primer for Differentil Clculus).. Understnd the representtion of trigonometric nd trnscendentl functions s Mclurin series (Tylor Series Revisited). OBJECTIVES. find the true nd reltive true error,. find the pproimte nd reltive pproimte error,. relte the bsolute reltive pproimte error to the number of significnt digits t lest correct in your nswers, nd 4. know the concept of significnt digits (nlmlı hneler). After reding this chpter, you should be ble to:. find the true nd reltive true error,. find the pproimte nd reltive pproimte error,. relte the bsolute reltive pproimte error to the number of significnt digits t lest correct in your nswers, nd 4. know the concept of significnt digits. In ny numericl nlysis, errors will rise during the clcultions. To be ble to del with the issue of errors, we need to (A) identify where the error is coming from, followed by (B) quntifying the error, nd lstly (C) minimize the error s per our needs. In this chpter, we will concentrte on item (B), tht is, how to quntify errors. Q: Wht is true error? A: True error denoted by E t is the difference between the true vlue (lso clled the ect vlue) nd the pproimte vlue. True Error True vlue Approimte vlue Emple The derivtive of function f () t prticulr vlue of cn be pproimtely clculted by f ( h) f ( ) f ( ) h.5 of f () For f ( ) 7e nd h., find ) the pproimte vlue of f () b) the true vlue of f () c) the true error for prt () Solution 9

) f ( ) f ( h) f ( ) h For nd h., f () f (.) f (). f (.) f ()..5(.).5() 7e 7e..7 9.8. 65. b) The ect vlue of f () cn be clculted by using our knowledge of differentil clculus. f ( ) 7e.5.5 f '( ) 7.5 e.5e. 5 So the true vlue of f '() is.5() f '().5e 9. 54 c) True error is clculted s E t = True vlue Approimte vlue 9.54.65. 756 The mgnitude of true error does not show how bd the error is. A true error of E t. 7.5 my seem to be smll, but if the function given in the Emple were f ( ) 7 6 e, the 6 true error in clculting f () with h., would be E t.756. This vlue of true error is smller, even when the two problems re similr in tht they use the sme vlue of the function rgument, nd the step size, h.. This brings us to the definition of reltive true error. Q: Wht is reltive true error? A: Reltive true error is denoted by t nd is defined s the rtio between the true error nd the true vlue. True Error Reltive True Error True Vlue Emple The derivtive of function f () t prticulr vlue of cn be pproimtely clculted by f ( h) f ( ) f '( ) h.5 For f ( ) 7e nd h., find the reltive true error t. Solution From Emple, E t = True vlue Approimte vlue 9.54.65. 756

Reltive true error is clculted s True Error t True Vlue.756. 78895 9.54 Reltive true errors re lso presented s percentges. For this emple, t.758895 % 7.58895% Absolute reltive true errors my lso need to be clculted. In such cses, t.75888 =.758895 = 7.58895% Q: Wht is pproimte error? A: In the previous section, we discussed how to clculte true errors. Such errors re clculted only if true vlues re known. An emple where this would be useful is when one is checking if progrm is in working order nd you know some emples where the true error is known. But mostly we will not hve the luury of knowing true vlues s why would you wnt to find the pproimte vlues if you know the true vlues. So when we re solving problem numericlly, we will only hve ccess to pproimte vlues. We need to know how to quntify error for such cses. Approimte error is denoted by E nd is defined s the difference between the present pproimtion nd previous pproimtion. Approimte Error Present Approimtion Previous Approimtion Emple The derivtive of function f () t prticulr vlue of cn be pproimtely clculted by ' f ( h) f ( ) f ( ) h.5 For f ( ) 7e nd t, find the following ) f () using h. b) f () using h. 5 c) pproimte error for the vlue of f () for prt (b) Solution ) The pproimte epression for the derivtive of function is f ( h) f ( ) f '( ). h For nd h., f (.) f () f '(). f (.) f ()..5(.).5() 7e 7e.

.7 9.8. 65. b) Repet the procedure of prt () with h.5, f ( h) f ( ) f ( ) h For nd h. 5, ' f (.5) f () f ().5 f (.5) f ().5.5(.5).5() 7e 7e.5.5 9.8 9. 8799.5 c) So the pproimte error, E is E Present Approimtion Previous Approimtion 9.8799.65. 8474 The mgnitude of pproimte error does not show how bd the error is. An pproimte error 6.5 of E. 8 my seem to be smll; but for f ( ) 7 e, the pproimte error in ' 6 clculting f () with h. 5 would be E.8474. This vlue of pproimte error is smller, even when the two problems re similr in tht they use the sme vlue of the function rgument,, nd h. 5 nd h.. This brings us to the definition of reltive pproimte error. Q: Wht is reltive pproimte error? A: Reltive pproimte error is denoted by nd is defined s the rtio between the pproimte error nd the present pproimtion. Approimte Error Reltive Approimte Error Present Approimtion Emple 4 The derivtive of function f () t prticulr vlue of cn be pproimtely clculted by f ( h) f ( ) f '( ) h.5 For f ( ) 7e, find the reltive pproimte error in clculting f () using vlues from h. nd h. 5. Solution From Emple, the pproimte vlue of f ( ). 6 using h. nd ' f () 9.88 using h. 5. Present Approimtion Previous Approimtion E

9.8799.65.8474 The reltive pproimte error is clculted s Approimte Error Present Approimtion.8474. 894 9.8799 Reltive pproimte errors re lso presented s percentges. For this emple,.894 % =.894% Absolute reltive pproimte errors my lso need to be clculted. In this emple.894. 894 or.894% Q: While solving mthemticl model using numericl methods, how cn we use reltive pproimte errors to minimize the error? A: In numericl method tht uses itertive methods (yinelemeli yöntem), user cn clculte reltive pproimte error t the end of ech itertion. The user my pre-specify minimum cceptble tolernce clled the pre-specified tolernce, s. If the bsolute reltive pproimte error is less thn or equl to the pre-specified tolernce s, tht is, s, then the cceptble error hs been reched nd no more itertions would be required. Alterntively, one my pre-specify how mny significnt digits they would like to be correct in their nswer. In tht cse, if one wnts t lest m significnt digits to be correct in the m nswer, then you would need to hve the bsolute reltive pproimte error,.5 %. (lterntif olrk cevbınızı nlmlı bsmk/hne syısı ile belirleyebilirsiniz. Bu durumd m mutlk göreli yklşık ht % cinsinden.5 denklemini kullnrk m istenilen nlmlı bsmk syısı belirlenebilir.) Emple 5.7 If one chooses 6 terms of the Mclurin series for e to clculte e, how mny significnt digits cn you trust in the solution? Find your nswer without knowing or using the ect nswer. Solution e...! Using 6 terms, we get the current pproimtion s 4 5.7.7.7.7.7 e.7. 6!! 4! 5! Using 5 terms, we get the previous pproimtion s 4.7.7.7.7 e.7.!! 4! The percentge bsolute reltive pproimte error is

.6..6957%.6 Since.5 %, t lest significnt digits re correct in the nswer of e.7.6 Q: But wht do you men by significnt digits (nlmlı bsmk ile ne nltılmk isteniyor)? A: Significnt digits re importnt in showing the truth one hs in reported number (nlmlı bsmklr ifde edilmek istenilen syıyı gerçek nlmınd ifde edebilir). For emple, if someone sked me wht the popultion of my county is, I would respond, The popultion of the Hillsborough county re is million (Örneğin birisi size yşdığınız şehrin nüfusunu sors on çok yklşık bir değer - milyon- söylersiniz). But if someone ws going to give me $ for every citizen of the county, I would hve to get n ect count (her yurttş için $ verileceği söylense bu durumd kesin rkm - yılı için,79,587 kişi şeklinde- belirtmek durumund klırsınız). Tht count would hve been,79,587 in yer. So you cn see tht in my sttement tht the popultion is million, tht there is only one significnt digit, tht is,, nd in the sttement tht the popultion is,79,587, there re seven significnt digits ( milyon şeklinde söylediğinizde nlmlı bsmğı oln nüfus syısı,79,587 rkmınd 7 nlmlı nüfus syısı ile ifde edilir). So, how do we differentite the number of digits correct in,, nd,79,587? Well for tht, one my use scientific nottion. For our dt we show 6,, 6,79,587.79587 to signify the correct number of significnt digits. Emple 5 Give some emples of showing the number of significnt digits. Solution ().459 hs three significnt digits (b) 4.59 hs four significnt digits (c) 48 hs four significnt digits (d) 48. hs five significnt digits (e).79 hs four significnt digits (f).79 hs five significnt digits (g).79 hs si significnt digits INTRODUCTION, APPROXIMATION AND ERRORS Topic Mesuring Errors Summry Tetbook notes on mesuring errors Mjor Generl Engineering Authors Autr Kw Dte Arlık 8, 6 Web Site http://numericlmethods.eng.usf.edu 4

.. Multiple-Choice Test Chpter. Mesuring Errors. True error is defined s (A) Present Approimtion Previous Approimtion (B) True Vlue Approimte Vlue (C) bs (True Vlue Approimte Vlue) (D) bs (Present Approimtion Previous Approimtion). The epression for true error in clculting the derivtive of the pproimte epression f h f f h is h cosh h cosh (A) (B) h h (C) cos h h sin t / 4 by using (D) sin h h. The reltive pproimte error t the end of n itertion to find the root of n eqution is.4%. The lest number of significnt digits we cn trust in the solution is (A) (B) (C) 4 (D) 5 4. The number.85 hs significnt digits (A) (B) 4 (C) 5 (D) 6 5. The following gs sttions were cited for irregulr dispenstion by the Deprtment of Agriculture. Which one cheted you the most? Sttion Actul gsoline dispensed Gsoline reding t pump Ser Cit Hus She 9.9 9.9 9.8 9.95.... (A) Ser (B) Cit (C) Hus (D) She 6. The number of significnt digits in the number 99 is (A) 4 (B) 5 (C) 6 (D) 4 or 5 or 6 For complete solution, refer to the links t the end of the book. 5

. Chpter. Sources of Error PRE-REQUISITES. Binry representtion of numbers (Binry representtion of numbers). Know the definition of secnt nd first derivtive of function (Primer for Differentil Clculus).. Know the Riemnn sum concept of integrtion (Primer for Integrl Clculus). 4. Understnd the representtion of trigonometric nd trnscendentl functions s Mclurin series (Tylor Series Revisited). OBJECTIVES. know tht there re two inherent (tbitındn) sources of error in numericl methods round-off (yuvrlm htsı) nd trunction error (kesme htsı),. recognize the sources of round-off nd trunction error, nd. know the difference between round-off nd trunction error. After reding this chpter, you should be ble to:. know tht there re two inherent sources of error in numericl methods round-off nd trunction error,. recognize the sources of round-off nd trunction error, nd. know the difference between round-off nd trunction error. Error in solving n engineering or science problem cn rise due to severl fctors. First, the error my be in the modeling technique. A mthemticl model my be bsed on using ssumptions tht re not cceptble. For emple, one my ssume tht the drg force on cr is proportionl to the velocity of the cr, but ctully it is proportionl to the squre of the velocity of the cr. This itself cn crete huge errors in determining the performnce of the cr, no mtter how ccurte the numericl methods you my use re. Second, errors my rise from mistkes in progrms themselves or in the mesurement of physicl quntities. But, in pplictions of numericl methods itself, the two errors we need to focus on re. Round off error. Trunction error. Q: Wht is round off error? A: A computer cn only represent number pproimtely. For emple, number like my be represented s. on PC. Then the round off error in this cse is... Then there re other numbers tht cnnot be represented ectly. For emple, nd re numbers tht need to be pproimted in computer clcultions. Q: Wht problems cn be creted by round off errors? A: Twenty-eight Americns were killed on Februry 5, 99. An Irqi Scud hit the Army brrcks in Dhhrn, Sudi Arbi. The ptriot defense system hd filed to trck nd intercept the Scud. Wht ws the cuse for this filure? 6

5 şubt 99 de Irk tn fırltıln bir scud füzesi Suudi Arbistn ın Dhrn kentindeki bd nin skeri kışlsın düşmüş, 8 meriklı sker ölmüş ve nü yrlmıştır. Abd nin Ptriot svunm sistemi scud lrı izleyememiş ve scud lrı hvd thrip edememiştir. Bu htnın slı ne idi? The Ptriot defense system consists of n electronic detection device clled the rnge gte (erim kpısı). It clcultes the re in the ir spce where it should look for Scud. To find out where it should im net, it clcultes the velocity of the Scud nd the lst time the rdr detected the Scud. Time is sved in register tht hs 4 bits length. Since the internl clock of the system is mesured for every one-tenth of second, / is epressed in 4 bit-register s.. However, this is not n ect representtion. In fct, it would need infinite numbers of bits to represent / ectly. So, the error in the representtion in deciml formt is Ptriot svunm sistemi menzil rlığı/kpısı denilen elektronik lgılm sistemidir. Bu elektronik sistem hvd bir scud un olup olmdığını belli bir lnı tryrk hesplmlr ypmktdır. Sistemin mcı scud un hızını belirlemek ve rdrd tnımlnn füzenin en son nını kyıt etmektir. O n/zmn yni sniyenin / i 4 bitlik. uzunlukt bir veri olrk sisteme kyıt edilmekteydi. Sistemin kendi stine göre bu kyıtlrı sniyenin / zmn rlıklrınd rk rky tekrrlnmkt ve kyıt ltın lınmktydı (/ lrı toplmktydı). Onluk sisteme göre her kyıtt Figure Ptriot missile (Courtesy of the US Armed Forces, http://www.redstone.rmy.mil/history/rchives/ptriot/ptriot.html) ( 4... 8 9.57 büyüklüğünde bir zmn frkı orty çıkmktydı. Sistemin külü güç kynğı st (yklşık 4 gün) boyunc sürekli kyıt ypıyordu. st sonund (bşlm nın göre) orty çıkn zmn frkı ise şğıdki gibidir: The bttery ws on for consecutive hours, hence cusing n inccurcy of 8 s 6s 9.57 hr.s hr.4s 4 ) 7

Ptriot sistemi hvd belirli bir çı içindeki kısmın trmsını (rştırm sfhsıserch ction) ypr () ve belirli bir süre (/ sniye) sonr ynı genişlikteki çı ile tekrr trm (onm sfhsı-vlidtion ction rnge gte-menzil geçit genişliği belirlenir) ypılır (). Bu trmlrdn (yni scud tn) sinyl gelirse bu sinyller kyıt edilir. Bu iki trmdn yrrlnrk Scud un olsı yerini (rnge gte re) tespit eder/tnımlr ve ptriotlrı ory yönlendirir () (Figure ). İsrilliler Ptriot Projesi Ofisi nden ldıklrı verileri incelediklerinde sistemin 8 st sürekli çlışınc menzil kpısı rlığınd % lik bir ht yptığını nldılr. Bu ht scud un menzil kpısı rlığının merkezinde olmdığını gösteriyordu. Scud menzil rlığının merkezinde ise sistem bşrılı olbiliyordu. Scud füzesi ptriot sisteminin menzilinde ise ptriotlr hemen teşleniyordu (Figure 4). 8

Ptriot Projesi Ofis çlışnlrı ptriot sisteminin menzil kpısı rlığınd %5 lik spm durumund scudlrı tkip etmediğini belirtmişlerdir. %5 lik menzil kpısı merkezleme htsın st sonr ulşılmktydı. st sonr rdr scud füzelerinin olsı yerini ynlış yerde gösteriyor ve sistem hrekete geçmiyord. Scudlr Ptriot sisteminin rdrlrının menzil kpısı rlığının dışınd klıyordu (Figure 5). 9

The shift clculted in the rnge gte due to.4s ws clculted s 58.6m. For the Ptriot missile defense system, the trget is considered out of rnge if the shift ws going to more thn 7 m. Scud lrın hızı yklşık 7 metre/sniye civrınddır (https://pediview.com/openpedi/scud). Hesplmdki kpı rlıklrındn kynklnn toplm kym.4 sniye ise bu 58.6metre lik bir rnge-gte (kpı genişliği/menzil geçit genişliği) ile trm ypılmsı demektir. Oys Ptriot füzeleri hedef 7m den büyük kpı genişliği dışınd ise etkisiz klıyordu. (https://www.im.umn.edu/~rnold/dissters/ptriot.html, http://fs.org/spp/strwrs/go/im96.htm) Ptriot sisteminin sürekli çlışmsı sonucu elde edilen değerler : Hours Seconds Clculted Time (Seconds) Inccurcy (Seconds) 6 599.9966.4 7 Approimte Shift In Rnge Gte (Meters) 88 8799.975.75 55 7 7999.9.687 7 48 78 7799.85.648 7 59 5999.758.47 494 b 6 59999.6667.4 687 Sistem sürekli çlışırs st sonr hedef menzil rlığının dışınd klıyor. b Alf küleri st boyunc sürekli çlışırs United Sttes Generl Accounting Office, GAO/IMTEC-9-6, Februry 99. Q: Wht is trunction error (Kesme htsı nedir)? A: Trunction error is defined s the error cused by truncting mthemticl procedure. For emple, the Mclurin series for e is given s e...!! This series hs n infinite number of terms but when using this series to clculte e, only finite number of terms cn be used. For emple, if one uses three terms to clculte e, then e.! the trunction error for such n pproimtion is Trunction error = e,! 4...! 4!

But, how cn trunction error (kesme htsı) be controlled in this emple? We cn use the concept (kvrm) of reltive pproimte error to see how mny terms need to be considered.. Assume tht one is clculting e using the Mclurin series, then... e....!! Let us ssume one wnts the bsolute reltive pproimte error to be less thn %. In Tble,. we show the vlue of e, pproimte error nd bsolute reltive pproimte error s function of the number of terms, n. n. e E %. e = - -. e. =.. 54.546.. e. =.9.7! 4.658 4.8.88 8.9776 5.944.864.66 6.5.76.655 Using 6 terms of the series yields < %. Q: Cn you give me other emples of trunction error? A: In mny tetbooks, the Mclurin series is used s n emple to illustrte trunction error. This my led you to believe tht trunction errors re just chopping prt of the series. However, trunction error cn tke plce in other mthemticl procedures s well. For emple to find the derivtive of function, we define f f f lim But since we cnnot use, we hve to use finite vlue of, to give f ( ) f ( ) f ( ) So the trunction error is cused by choosing finite vlue of s opposed to. For emple, in finding f () for f ( ), we hve the ect vlue clculted s follows. f ( ) From the definition of the derivtive of function, f ( ) f ( ) f ( ) lim ( ) ( ) lim ( ) lim lim( )

This is the sme epression you would hve obtined by directly using the formul from your differentil clculus clss d n n ( ) n d By this formul for f ( ) f ( ) The ect vlue of f () is f ( ) 6 If we now choose., we get f (.) f () f (). f (.) f ().. =..4 9..4. 6. We purposefully chose simple function f ( ) with vlue of nd. becuse we wnted to hve no round-off error in our clcultions so tht the trunction error cn be isolted. The trunction error in this emple is 6 6... Cn you reduce the truncte error by choosing smller? Another emple of trunction error is the numericl integrtion of function, b I f ( ) d Ect clcultions require us to clculte the re under the curve by dding the re of the rectngles s shown in Figure. However, ect clcultions requires n infinite number of such rectngles. Since we cnnot choose n infinite number of rectngles, we will hve trunction error. For emple, to find 9 d, we hve the ect vlue s 9 d 9

9 4 If we now choose to use two rectngles of equl width to pproimte the re (see Figure ) under the curve, the pproimte vlue of the integrl 9 d ( ) 9 ( ) (6 7 8 5 y (6 ) ( ) ) 6 (9 6) 6 y = 6 9 Figure Plot of y showing the pproimte re under the curve from to 9 using two rectngles. Agin, we purposefully chose simple emple becuse we wnted to hve no round off error in our clcultions. This mkes the obtined error purely trunction. The trunction error is 4 5 99 Cn you reduce the trunction error by choosing more rectngles s given in Figure? Wht is the trunction error?

y 9 6 y =.5 4.5 6 7.5 9.5 Figure Plot of y showing the pproimte re under the curve from to 9 using four rectngles. References Ptriot Missile Defense Softwre Problem Led to System Filure t Dhhrn, Sudi Arbi, GAO Report, Generl Accounting Office, Wshington DC, Februry 4, 99. INTRODUCTION, APPROXIMATION AND ERRORS Topic Sources of error Summry Tetbook notes on sources of error Mjor Generl Engineering Authors Autr Kw Dte Arlık 8, 6 Web Site http://numericlmethods.eng.usf.edu.. Multiple-Choice Test Chpter. Sources of Error. Trunction error is cused by pproimting (A) irrtionl numbers (B) frctions (C) rtionl numbers (D) ect mthemticl procedures. A computer tht represents only 4 significnt digits with chopping would clculte 66.666*. s (A) (B) (C).7778 (D). A computer tht represents only 4 significnt digits with rounding would clculte 66.666*. s (A) (B) (C).7778 (D) 4

4. The trunction error in clculting f for f h f f h with h. is (A). (B). (C) 4. (D) 4. 9 f by 5. The trunction error in finding d using LRAM (left end point Riemnn pproimtion) with eqully portioned points 6 9 is (A) 648 (B) 756 (C) 97 (D) 6 6. The number / is registered in fied 6 bit-register with ll bits used for the frctionl prt. The difference gets ccumulted every / th of second for one dy. The mgnitude of the ccumulted difference is (A).8 (B) 5 (C) 7 (D) 54 For complete solution, refer to the links t the end of the book. 5

.4 Chpter.4 Binry Representtion PRE-REQUISITES. Long Division OBJECTIVES. convert bse- rel number to its binry representtion,. convert binry number to n equivlent bse- number. After reding this chpter, you should be ble to:. convert bse- rel number to its binry representtion, 4. convert binry number to n equivlent bse- number. In everydy life, we use number system with bse of. For emple, look t the number 57.56. Ech digit in 57.56 hs vlue of through 9 nd hs plce vlue. It cn be written s 57.76 5 7 7 6 In binry system, we hve similr system where the bse is mde of only two digits nd. So it is bse system. A number like (.) in bse- represents the deciml number s 4 (.) ( ) ( ).875 in the deciml system. To understnd the binry system, we need to be ble to convert binry numbers to deciml numbers nd vice-vers. We hve lredy seen n emple of how binry numbers re converted to deciml numbers. Let us see how we cn convert deciml number to binry number. For emple tke the deciml number.875. First, look t the integer prt:.. Divide by. This gives quotient of 5 nd reminder of. Since the reminder is,.. Divide the quotient 5 by. This gives quotient of nd reminder of. Since the reminder is,.. Divide the quotient by. This gives quotient of nd reminder of. Since the reminder is,. 4. Divide the quotient by. This gives quotient of nd reminder of. Since the reminder is,. Since the quotient now is, the process is stopped. The bove steps re summrized in Tble. 6

Tble Converting bse- integer to binry representtion. Hence () ( ) Quotient Reminder / 5 5/ / ½ () For ny integer, the lgorithm for finding the binry equivlent is given in the flow chrt on the net pge. Now let us look t the deciml prt, tht is,.875.. Multiply.875 by. This gives.75. The number before the deciml is nd the number fter the deciml is.75. Since the number before the deciml is,.. Multiply the number fter the deciml, tht is,.75 by. This gives.75. The number before the deciml is nd the number fter the deciml is.75. Since the number before the deciml is,.. Multiply the number fter the deciml, tht is,.75 by. This gives.5. The number before the deciml is nd the number fter the deciml is.5. Since the number before the deciml is,. 4. Multiply the number fter the deciml, tht is,.5 by. This gives.. The number before the deciml is nd the number fter the deciml is. Since the number before the deciml is, 4. Since the number fter the deciml is, the conversion is complete. The bove steps re summrized in Tble. Tble. Converting bse- frction to binry representtion. Number Number fter Number before deciml deciml.875.75.75.75.75.75.75.5.5.5.. 4 7

Strt Input (N) Integer N to be converted to binry formt i = Divide N by to get quotient Q & reminder R i = i+ Hence (.875) ( ) 4 i = R No (.) The lgorithm for ny frction is given in flowchrt on the net pge. Hving clculted ( ) () Is Q =? nd (.875) (.), we hve Yes (.875) (.). In the bove emple, when we were converting the frctionl prt of the number, we were left n = i with fter the deciml number nd used tht s plce to stop. In mny cses, we re never (N) = (n...) left with fter the deciml number. For emple, finding the binry equivlent of. is summrized in Tble. Tble. Converting bse- frction to pproimte binry representtion. Number fter Number before Number STOP deciml deciml..6.6 8

.6....4.4.4.8.8 4.8.6.6 5 As you cn see the process will never end. In this cse, the number cn only be pproimted in binry formt, tht is, (.) ( 45 ) (.) Q: But wht is the mthemtics behinds this process of converting deciml number to binry formt? A: Let z be the deciml number written s z. y where is the integer prt nd y is the frctionl prt. We wnt to find the binry equivlent of. So we cn write 9

Strt Input (F) Frction F to be converted to binry formt i Multiply F by to get number before deciml, S nd fter deciml, T i i i = S No Is T =? Yes n = i (F) = (-...-n) STOP

n n n n... If we cn now find,...,n in the bove eqution then ( ) ( nn... ) We now wnt to find the binry equivlent of y. So we cn write y b b... b If we cn now find b,..., bm in the bove eqution then ( y) ( b b... bm ) Let us look t this using the sme emple s before. m m Emple Convert (.875) to bse. Solution To convert ( ) to bse, wht is the highest power of tht is prt of. Tht power is, s 8 to give Wht is the highest power of tht is prt of. Tht power is, s to give So Wht is the highest power of tht is prt of. Tht power is, s to give Hence ( ) ( ) To convert (.875) to the bse, we proceed s follows. Wht is the smllest negtive power of tht is less thn or equl to.875. Tht power is s. 5. So.875.65 Wht is the net smllest negtive power of tht is less thn or equl to.65. Tht power is 4 s 4. 65. So 4.875 Hence 4 4 (.875).65 (.) Since ( ) () nd (.875) (.) we get

(.875) (.) Cn you show this lgebriclly for ny generl number? Emple Convert (.875) to bse. Solution For ( ), conversion to binry formt is shown in Tble 4. Tble 4. Conversion of bse- integer to binry formt. Quotient Reminder / 6 6/ / / So ( ) (). Conversion of (.875) to binry formt is shown in Tble 5. Tble 5. Converting bse- frction to binry representtion. Number Number fter Number before deciml deciml.875.75.75.75.5.5.5.. So Hence (.875) (. ) (.875) (. ) INTRODUCTION TO NUMERICAL METHODS Topic Binry representtion of number Summry Tetbook notes on binry representtion of numbers Mjor Generl Engineering Authors Autr Kw Dte Arlık 8, 6 Web Site http://numericlmethods.eng.usf.edu

.4. Multiple-Choice Test Chpter.4 Binry Representtion. 5? (A) (B) (C) (D)? (A) (B) (C) 5 (D) 6.. 5.75?.? (A). (B). (C). (D). 4. Representing in fied point register with bits for the integer prt nd bits for the frctionl prt gives round-off error of most nerly (A) -.8579 (B).9 (C).64 (D).89 5. An engineer working for the Deprtment of Defense is writing progrm tht trnsfers non-negtive rel numbers to integer formt. To void overflow problems, the mimum non-negtive integer tht cn be represented in 5-bit integer word is (A) 6 (B) (C) 6 (D) 64 6. For numericlly controlled mchine, integers need to be stored in memory loction. The minimum number of bits needed for n integer word to represent ll integers between nd 4 is (A) 8 (B) 9 (C) (D) For complete solution, refer to the links t the end of the book.

.5 Chpter.5 Floting Point Representtion PRE-REQUISITES. Know how to represent numbers in binry formt (Binry representtion of numbers).. Know the definition of true error (Mesuring Errors) OBJECTIVES. convert bse- number to binry floting point representtion,. convert binry floting point number to its equivlent bse- number,. understnd the IEEE-754 specifictions of floting point representtion in typicl computer, 4. clculte the mchine epsilon of representtion. After reding this chpter, you should be ble to:. convert bse- number to binry floting point representtion,. convert binry floting point number to its equivlent bse- number, 4. understnd the IEEE-754 specifictions of floting point representtion in typicl computer, 5. clculte the mchine epsilon of representtion. Consider n old time csh register tht would ring ny purchse between nd 999.99 units of money. Note tht there re five (not si) working spces in the csh register (the deciml number is shown just for clrifiction). Q: How will the smllest number be represented? A: The number will be represented s. Q: How will the lrgest number 999.99 be represented? A: The number 999.99 will be represented s 9 9 9. 9 9 Q: Now look t ny typicl number between nd 999.99, such s 56.78. How would it be represented? A: The number 56.78 will be represented s 5 6. 7 8 Q: Wht is the smllest chnge between consecutive numbers? A: It is., like between the numbers 56.78 nd 56.79. Q: Wht mount would one py for n item, if it costs 56.789? A: The mount one would py would be rounded off to 56.79 or chopped to 56.78. In either cse, the mimum error in the pyment would be less thn.. 4

Q: Wht mgnitude of reltive errors would occur in trnsction? A: Reltive error for representing smll numbers is going to be high, while for lrge numbers the reltive error is going to be smll. For emple, for 56.786, rounding it off to 56.79 ccounts for round-off error of 56.786 56.79.4. The reltive error in this cse is.4 t.558%. 56.786 For nother number,.546, rounding it off to.55 ccounts for the sme round-off error of.546.55. 4. The reltive error in this cse is.4 t.8%..546 Q: If I m interested in keeping reltive errors of similr mgnitude for the rnge of numbers, wht lterntives do I hve? A: To keep the reltive error of similr order for ll numbers, one my use floting-point representtion of the number. For emple, in floting-point representtion, number 56.78 is written s.5678,.678 is written s.678, nd 56.789 is written s.56789. The generl representtion of number in bse- formt is given s eponent sign mntiss or for number y, e y m Where sign of the number, or - m mntiss, m e integer eponent (lso clled ficnd) Let us go bck to the emple where we hve five spces vilble for number. Let us lso limit ourselves to positive numbers with positive eponents for this emple. If we use the sme five spces, then let us use four for the mntiss nd the lst one for the eponent. So the 9 smllest number tht cn be represented is but the lrgest number would be 9.999. By using the floting-point representtion, wht we lose in ccurcy, we gin in the rnge of numbers tht cn be represented. For our emple, the mimum number represented chnged 9 from 999. 99 to 9.999. Wht is the error in representing numbers in the scientific formt? Tke the previous emple of 56.78. It would be represented s.568 nd in the five spces s 5 6 8 Another emple, the number 5769. 78 would be represented s s 5 7 6 5 5 5.76 nd in five spces 5

So, how much error is cused by such representtion. In representing 56.78, the round off error creted is 56. 78 56. 8., nd the reltive error is. t.77888%, 56.78 In representing 5769. 78, the round off error creted is 5769.78 5.76 5 9. 78, nd the reltive error is 9.78 t.567%. 5769.78 Wht you re seeing now is tht lthough the errors re lrge for lrge numbers, but the reltive errors re of the sme order for both lrge nd smll numbers. Q: How does this floting-point formt relte to binry formt? A: A number y would be written s Where y m e = sign of number (negtive or positive use for positive nd for negtive), m = mntiss, m, tht is, m, nd e = integer eponent. Emple Represent 54.75 in floting point binry formt. Assuming tht the number is written to hypotheticl word tht is 9 bits long where the first bit is used for the sign of the number, the second bit for the sign of the eponent, the net four bits for the mntiss, nd the net three bits for the eponent, Solution (5).75 (.). 54 The eponent 5 is equivlent in binry formt s 5 Hence.75. () 54 The sign of the number is positive, so the bit for the sign of the number will hve zero in it. The sign of the eponent is positive. So the bit for the sign of the eponent will hve zero in it. The mntiss m (There re only 4 plces for the mntiss, nd the leding is not stored s it is lwys epected to be there), nd the eponent e. we hve the representtion s 6

Emple Wht number does the below given floting point formt represent in bse- formt. Assume hypotheticl 9-bit word, where the first bit is used for the sign of the number, second bit for the sign of the eponent, net four bits for the mntiss nd net three for the eponent. Solution Given Bit Representtion Prt of Floting point number Sign of number Sign of eponent Mgnitude of mntiss Mgnitude of eponent The first bit is, so the number is positive. The second bit is, so the eponent is negtive. The net four bits,, re the mgnitude of the mntiss, so 4 m.. 6875 The lst three bits,, re the mgnitude of the eponent, so e 6 The number in binry formt then is. The number in bse- formt is 6 =.6875.667 Emple A mchine stores floting-point numbers in hypotheticl -bit binry word. It employs the first bit for the sign of the number, the second one for the sign of the eponent, the net four for the eponent, nd the lst four for the mgnitude of the mntiss. ) Find how.8 will be represented in the floting-point -bit word. b) Wht is the deciml equivlent of the -bit word representtion of prt ()? Solution ) For the number, we hve the integer prt s nd the frctionl prt s.8 Let us first find the binry equivlent of the integer prt Integer prt Now we find the binry equivlent of the frctionl prt Frctionl prt:. 8.5664.8.656 7

Hence.45.964.848.6496.499.49984.99968.9996.8. 6. 6. The binry equivlent of eponent is found s follows Quotient Reminder 6/ / / So So 6.8.. Prt of Floting point number Bit Representtion Sign of number is positive Sign of eponent is negtive Mgnitude of the eponent Mgnitude of mntiss The ten-bit representtion bit by bit is b) Converting the bove floting point representtion from prt () to bse by following Emple gives. 4 6.75.7475 Q: How do you determine the ccurcy of floting-point representtion of number? 8

A: The mchine epsilon, mch is mesure of the ccurcy of floting point representtion nd is found by clculting the difference between nd the net number tht cn be represented. For emple, ssume -bit hypotheticl computer where the first bit is used for the sign of the number, the second bit for the sign of the eponent, the net four bits for the eponent nd the net four for the mntiss. We represent s nd the net higher number tht cn be represented is The difference between the two numbers is () ()... ( 4 ) (.65). The mchine epsilon is mch.65. The mchine epsilon, mch is lso simply clculted s two to the negtive power of the number of bits used for mntiss. As fr s determining ccurcy, mchine epsilon, mch is n upper bound of the mgnitude of reltive error tht is creted by the pproimte representtion of number (See Emple 4). Emple 4 A mchine stores floting-point numbers in hypotheticl -bit binry word. It employs the first bit for the sign of the number, the second one for the sign of the eponent, the net four for the eponent, nd the lst four for the mgnitude of the mntiss. Confirm tht the mgnitude of the reltive true error tht results from pproimte representtion of.8 in the -bit formt (s found in previous emple) is less thn the mchine epsilon. Solution From Emple, the ten-bit representtion of.8 bit-by-bit is Agin from Emple, converting the bove floting point representtion to bse- gives 6..75.7475 The bsolute reltive true error between the number.8 nd its pproimte representtion.7475 is.8.7475 t. 447.8 which is less thn the mchine epsilon for computer tht uses 4 bits for mntiss, tht is, 4 mch..65 Q: How re numbers ctully represented in floting point in rel computer? 9

A: In n ctul typicl computer, rel number is stored s per the IEEE-754 (Institute of Electricl nd Electronics Engineers) floting-point rithmetic formt. To keep the discussion short nd simple, let us point out the slient fetures of the single precision formt. A single precision number uses bits. A number y is represented s e. y where = sign of the number (positive or negtive) i entries of the mntiss, cn be only or, i,.., e =the eponent Note the before the rdi point. The first bit represents the sign of the number ( for positive number nd for negtive number). The net eight bits represent the eponent. Note tht there is no seprte bit for the sign of the eponent. The sign of the eponent is tken cre of by normlizing by dding 7 to the ctul eponent. For emple in the previous emple, the eponent ws 6. It would be stored s the binry equivlent of 7 6. Why is 7 nd not some other number dded to the ctul eponent? Becuse in eight bits the lrgest integer tht cn be represented is 55, nd hlfwy of 55 is 7. This llows negtive nd positive eponents to be represented eqully. The normlized (lso clled bised) eponent hs the rnge from to 55, nd hence the eponent e hs the rnge of 7 e 8. If insted of using the bised eponent, let us suppose we still used eight bits for the eponent but used one bit for the sign of the eponent nd seven bits for the eponent mgnitude. In seven bits, the lrgest integer tht cn be represented is 7 in which cse the eponent e rnge would hve been smller, tht is, 7 e 7. By bising the eponent, the unnecessry representtion of negtive zero nd positive zero eponent (which re the sme) is lso voided. Actully, the bised eponent rnge used in the IEEE-754 formt is not to 55, but to 54. Hence, eponent e hs the rnge of 6 e 7. So wht re e 7 nd e 8 used for? If e 8 nd ll the mntiss entries re zeros, the number is ( the sign of infinity is governed by the sign bit), if e 8 nd the mntiss entries re not zero, the number being represented is Not Number (NN). Becuse of the leding in the floting point representtion, the number zero cnnot be represented ectly. Tht is why the number zero () is represented by e 7 nd ll the mntiss entries being zero. The net twenty-three bits re used for the mntiss. The lrgest number by mgnitude tht is represented by this formt is 7 8.4 The smllest number by mgnitude tht is represented, other thn zero, is 6 8.8 Since bits re used for the mntiss, the mchine epsilon, 4

mch 7..9 Q: How re numbers represented in floting point in double precision in computer? A: In double precision IEEE-754 formt, rel number is stored in 64 bits. The first bit is used for the sign, the net bits re used for the eponent, nd the rest of the bits, tht is 5, re used for mntiss. Cn you find in double precision the rnge of the bised eponent, smllest number tht cn be represented, lrgest number tht cn be represented, nd mchine epsilon? INTRODUCTION TO NUMERICAL METHODS Topic Floting Point Representtion Summry Tetbook notes on floting point representtion Mjor Generl Engineering Authors Autr Kw Dte Arlık 8, 6 Web Site http://numericlmethods.eng.usf.edu 4

.5. Multiple-Choice Test Chpter.5 Floting Point Representtion. A hypotheticl computer stores rel numbers in floting point formt in 8-bit words. The first bit is used for the sign of the number, the second bit for the sign of the eponent, the net two bits for the mgnitude of the eponent, nd the net four bits for the mgnitude of the mntiss. The number e. 78 in the 8-bit formt is () (A) (B) (C) (D). A hypotheticl computer stores rel numbers in floting point formt in 8-bit words. The first bit is used for the sign of the number, the second bit for the sign of the eponent, the net two bits for the mgnitude of the eponent, nd the net four bits for the mgnitude of the mntiss. The number tht ( ) represented in the bove given 8-bit formt is (A) -5.75 (B) -.875 (C) -.75 (D) -.5975. A hypotheticl computer stores floting point numbers in 8-bit words. The first bit is used for the sign of the number, the second bit for the sign of the eponent, the net two bits for the mgnitude of the eponent, nd the net four bits for the mgnitude of the mntiss. The mchine epsilon is most nerly 8 (A) 4 (B) (C) (D) 4. A mchine stores floting point numbers in 7-bit word. The first bit is used for the sign of the number, the net three for the bised eponent nd the net three for the mgnitude of the mntiss. The number ( ) represented in bse- is (A).75 (B).875 (C).5 (D).5 5. A mchine stores floting point numbers in 7-bit words. The first bit is stored for the sign of the number, the net three for the bised eponent nd the net three for the mgnitude of the mntiss. You re sked to represent.5 in the bove word. The error you will get in this cse would be (A) underflow (B) overflow (C) NN (D) No error will be registered. 6. A hypotheticl computer stores floting point numbers in 9-bit words. The first bit is used for the sign of the number, the second bit for the sign of the eponent, the net three bits for the mgnitude of the eponent, nd the net four bits for the mgnitude of the mntiss. Every second, the error between. nd its binry representtion in the 9-bit word is ccumulted. The ccumulted error fter one dy most nerly is (A).44 (B).5 (C).5 (D) 864 For complete solution, refer to the links t the end of the book. 4