lect_2 - Introduction to Numerical Analysis for Engineers...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Numerical Analysis for Engineers • Fundamentals of Digital Computing – Digital Computer Models – Convergence, accuracy and stability – Number representation – Arithmetic operations – Recursion algorithms • Error Analysis – Error propagation – numerical stability – Error estimation – Error cancellation – Condition numbers 2.29 Numerical Marine Hydrodynamics Lecture 2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Floating Number Representation m Mantissa b Base e Exponent Examples Decimal Binary Convention Decimal Max mantissa Min mantissa Binary Max exponent Min exponent General 2.29 Numerical Marine Hydrodynamics Lecture 2
Background image of page 2
Error Analysis Number Representation Addition and Subtraction Absolute Error Relative Error Multiplication and Division Relative Error Unbounded Absolute Error Bounded Relative Error Shift mantissa of largest number Result has exponent of largest number 2.29 Numerical Marine Hydrodynamics Lecture 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Digital Arithmetics Finite Mantissa Length function c = radd(a,b,n) % radd.m % function c = radd(a,b,n) % % Adds two real numbers a and b simulating an arithmetic unit with % n significant digits. % % First determine sign sa=sign(a); Limited precision sb=sign(b); if (sa == 0) addition in MATLAB la=-200; else la=ceil(log10(sa*a*(1+10^(-(n+1))))); end if (sb == 0) lb=-200; else lb=ceil(log10(sb*b*(1+10^(-(n+1))))); end lm=max(la,lb); f=10^(n); at=sa*round(f*sa*a/10^lm); bt=sb*round(f*sb*b/10^lm); ct=at+bt; sc=sign(ct); if (sc ~= 0) if (log10(sc*ct) >= n) ct=round(ct/10)*10; end end c=ct*10^lm/f; 2.29 Numerical Marine Hydrodynamics Lecture 2
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 12

lect_2 - Introduction to Numerical Analysis for Engineers...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online