E. T. S. I. Caminos, Canales y Puertos1 Engineering Computation Part 2: Exercises.

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

Mental Mind Gym coming …. 30 Second Challenge - Early Additive.
Finding a Common Denominator
1 1  1 =.
27  9 =.
1  1 =.
Addition Facts
Using the diagram, you can write two equivalent fractions:
Number Map Scales Models Saturday, 16 September 2006 ©RSH.
E. T. S. I. Caminos, Canales y Puertos1 Lecture 0 Engineering Computation.
E. T. S. I. Caminos, Canales y Puertos1 Engineering Computation Lecture 4.
E. T. S. I. Caminos, Canales y Puertos1 Engineering Computation Lecture 6.
E. T. S. I. Caminos, Canales y Puertos1 Engineering Computation Lecture 5.
Engineering Computation
E. T. S. I. Caminos, Canales y Puertos1 Engineering Computation Lecture 7.
E. T. S. I. Caminos, Canales y Puertos1 Lecture 2 Engineering Computation.
Addition 1’s to 20.
LESSON 2.04: Graphing Linear Relations using a Table of Values MFM1P
Number bonds to 10,
2 x0 0 12/13/2014 Know Your Facts!. 2 x1 2 12/13/2014 Know Your Facts!
Bottoms Up Factoring. Start with the X-box 3-9 Product Sum
#1#1 #2#2 An artist mixes 24 gallons of blue paint with 136 gallons of yellow paint to make a custom color for a large project. What percent of the new.
Other Dynamic Programming Problems
Powerpoint Jeopardy Category 1Category 2Category 3Category 4Category
0 x x2 0 0 x1 0 0 x3 0 1 x7 7 2 x0 0 9 x0 0.
Chapter 6 Method of Successive Quadratic Programming Professor Shi-Shang Jang National Tsing-Hua University Chemical Engineering Department.
Roots of Equations Our first real numerical method – Root finding
Chapter 6 Open Methods.
Second Term 05/061 Roots of Equations Bracketing Methods.
Exercise Exercise3.1 8 Exercise3.1 9 Exercise
Open Methods (Part 1) Fixed Point Iteration & Newton-Raphson Methods
1 Systems of Linear Equations Iterative Methods. 2 B. Iterative Methods 1.Jacobi method and Gauss Seidel 2.Relaxation method for iterative methods.
Roots of Equations Bracketing Methods.
Exercise Exercise Exercise Exercise
E. T. S. I. Caminos, Canales y Puertos1 Dimensional Analysis Engineering Computation.
Exercise Exercise Exercise Exercise
Exercise Exercise6.1 7 Exercise6.1 8 Exercise6.1 9.
accept A = {w#w | w in {0,1}*}
Dr. Marco A. Arocha Aug,  “Roots” problems occur when some function f can be written in terms of one or more dependent variables x, where the.
Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis
A Numerical Technique for Building a Solution to a DE or system of DE’s.
Principles of programming languages 2: Answers for exercises
computer
Инвестиционный паспорт Муниципального образования «Целинский район»
(x – 8) (x + 8) = 0 x – 8 = 0 x + 8 = x = 8 x = (x + 5) (x + 2) = 0 x + 5 = 0 x + 2 = x = - 5 x = - 2.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 ~ Roots of Equations ~ Bracketing Methods Chapter 5.
Case Study #1 Finding Roots of Equations ~ CE402 Numerical Methods for Engineers Dr. Fritz Fiedler ~ Andy Abrams David Crosby Zack Munstermann.
ROOTS OF EQUATIONS. Bracketing Methods The Bisection Method The False-Position Method Open Methods Simple Fixed-Point Iteration The Secant Method.
Roots: Bracketing Methods
照片档案整理 一、照片档案的含义 二、照片档案的归档范围 三、 卷内照片的分类、组卷、排序与编号 四、填写照片档案说明 五、照片档案编目及封面、备考填写 六、数码照片整理方法 七、照片档案的保管与保护.
공무원연금관리공단 광주지부 공무원대부등 공적연금 연계제도 공무원연금관리공단 광주지부. 공적연금 연계제도 국민연금과 직역연금 ( 공무원 / 사학 / 군인 / 별정우체국 ) 간의 연계가 이루어지지 않고 있 어 공적연금의 사각지대가 발생해 노후생활안정 달성 미흡 연계제도 시행전.
Жюль Верн ( ). Я мальчиком мечтал, читая Жюля Верна, Что тени вымысла плоть обретут для нас; Что поплывет судно громадней «Грейт Истерна»; Что.
Solution of Nonlinear Equations ( Root Finding Problems ) Definitions Classification of Methods  Analytical Solutions  Graphical Methods  Numerical.
Solution of Nonlinear Equations ( Root Finding Problems )
Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis
Bracketing Methods (Bisection Method)
~ Roots of Equations ~ Bracketing Methods Chapter 5
Lecture 4: Numerical Methods
BACK SOLUTION:
Part 2 / Chapter 5.
Chapter 1: False-Position Method of Solving a Nonlinear Equation
Problem Solving: Structure Charts
SOLUTION OF NONLINEAR EQUATIONS
Roots: Bracketing Methods
ROOTS OF EQUATIONS.
Sec:5.2 The Bisection Method.
Sec:5.2 The Bisection Method.
Roots: Bracketing Methods
Types of Errors And Error Analysis.
Presentation transcript:

E. T. S. I. Caminos, Canales y Puertos1 Engineering Computation Part 2: Exercises

E. T. S. I. Caminos, Canales y Puertos2 Bisection Method % This is the MainBisection program xl= ; xu=1; es= ; imax=50; xx=linspace(xl,xu,20); yy=f(xx); plot(xx,yy); hold on [Bisect ea iter]=Bisection(xl,xu,es,imax); fprintf('Solution: %18.12f Relative error: %18.12f Iterations: %5d\n',Bisect,ea,iter); function [res]=f(x) res= *(1-(1+x).^(-20))./x;

E. T. S. I. Caminos, Canales y Puertos3 Bisection Method function [Bisect ea iter]=Bisection(xl,xu,es,imax); iter=0; fl=f(xl); ea=2*es; xr=xl; while ea>es && iter<=imax xrold=xr; xr=(xl+xu)/2; fr=f(xr); iter=iter+1; if xr ~= 0 ea=abs((xr-xrold)/xr)*100; end test=fl*fr; if test<0 xu=xr; else if test>0 xl=xr; fl=fr; else ea=0; end fprintf(' xl= %18.8f xu= %18.8f\n',xl,xu); end Bisect=xr;

E. T. S. I. Caminos, Canales y Puertos4 False Position Method xl= ; xu=1; es= ; imax=100; xx=linspace(xl,xu,20); yy=f(xx); plot(xx,yy); hold on plot([xl,xu],[0,0],'*'); [xr ea iter]=FalsePosition(xl,xu,es,imax); fprintf('Solution: %18.12f Relative error: %18.12f Iterations: %5d\n',xr,ea,iter); function [xr ea iter]=FalsePosition(xl,xu,es,imax); iter=0; fl=f(xl); fu=f(xu); ea=2*es; xr=xl; il=0; iu=0; while ea>es && iter<=imax; xrold=xr; xr=xu-fu*(xl-xu)/(fl-fu); fr=f(xr); iter=iter+1; if xr ~= 0 ea=abs((xr-xrold)/xr)*100; end test=fl*fr; if test<0 xu=xr; fu=f(xu); iu=0; il=il+1; if il>=2 fl=fl/2; else if test>0 xl=xr; fl=f(xl); il=0; iu=iu+1; if iu>=2 fu=fu/2; else ea=0; end fprintf(' xl= %18.8f xu= %18.8f\n',xl,xu); end function [res]=f(x) res= *(1-(1+x).^(-20))./x;

E. T. S. I. Caminos, Canales y Puertos5 Fixed Point Method x0= ; es= ; imax=30; [xr ea iter]=FixedPoint(x0,es,imax); fprintf('Solution: %18.12f Relative error: %18.12f Iterations: %5d\n',xr,ea,iter); function [xr ea iter]=FixedPoint(x0,es,imax) xr=x0; iter=0; ea=2*es; while ea>es && iter<=imax xrold=xr; xr=g(xrold); iter=iter+1; if xr ~= 0 ea=abs((xr-xrold)/xr)*100; end fprintf(' xr= %18.8f ea= %18.8f\n',xr,ea); end function [res]=f(x) res= *(1-(1+x).^(-20))./x;

E. T. S. I. Caminos, Canales y Puertos6 Modified Secant Method x0=0.1; es= ; imax=30; [xr ea iter]=ModifiedSecant(x0,es,imax); fprintf('Solution: %18.12f Relative error: %18.12f Iterations: %5d\n',xr,ea,iter); function [xr ea iter]=ModifiedSecant(x0,es,imax); xr=x0 iter=0; ea=2*es; eps=0.01; while ea>es && iter<=imax xrold=xr; xr=xr-f(xr)/(f(xr+eps)-f(xr-eps))*2*eps; iter=iter+1; if xr ~= 0 ea=abs((xr-xrold)/xr)*100; end fprintf(' xr= %18.8f ea= %18.8f\n',xr,ea); end plot([xr],[0],'*'); function [res]=f(x) res= *(1-(1+x).^(-20))./x;

E. T. S. I. Caminos, Canales y Puertos7 Newton-Raphson Method x0=0.2; es= ; imax=30; [xr ea iter]=NewtonRaphson(x0,es,imax); fprintf('Solution: %18.12f Relative error: %18.12f Iterations: %5d\n',xr,ea,iter); function [xr ea iter]=NewtonRaphson(x0,es,imax) xr=x0; iter=0; ea=2*es; while ea>es && iter<=imax xrold=xr; xr=xr-f(xr)/f1(xr); iter=iter+1; if xr ~= 0 ea=abs((xr-xrold)/xr)*100; end fprintf(' xr= %18.8f ea= %18.8f\n',xr,ea); end; function [res]=f(x) res= *(1-(1+x).^(-20))./x; function [res]=f1(x); res=1000*((1-(1+x).^(-20))./x-20.*(1+i).^(-21))./x;