Presentation is loading. Please wait.

Presentation is loading. Please wait.

MAT 4725 Numerical Analysis

Similar presentations


Presentation on theme: "MAT 4725 Numerical Analysis"— Presentation transcript:

1 MAT 4725 Numerical Analysis
Section 1.3 Conditional Statements

2 MCM Teams Jonathan, Laura, Leah Ashley, Brittany, Tiff
Andrea, Kristen? Meghan? David? Caro, Delsey, Theresa (sophomore team) Grace??

3 HW Comments Print on one side of the paper only. Line up equal signs
Use “×” for multiplication, not “” Use instead of Start a new page for a new problem

4 Preview Review some facts about sequences
Introduces the conditional statements Allow the flow of control to branch into two or more sections of codes based on the truth values of a control expressions Open Maple

5 Why Sequences? We are going to successively approximate certain “desirable answer”. The approximations form a sequence. Recall “Newton’s Method” in calculus I.

6 Example 1 ,

7 Example 1 , By the Intermediate Value Theorem, there is a root between 1 and 2. How to approximate the value of this root?

8 Idea 1. Choose a point x1 nearby. 2. Find the tangent line at (x1,f(x1)). 3. Find the intersection point x2 with the x-axis. 4. Repeat* Step 2-3 until the desired accuracy is obtained.

9 Example 1 Use Newton’s Method to approximate the root of the equation correct to 6 decimal places.

10 Example 1

11 Calculus III This is a review and a review only.
You are supposed to know these stuff.

12 Finding limits There are 5 tools that you can use to find limit of sequences

13 Tool #1 (Theorem) If and , then

14 Tool #1 (Theorem) If and , then .

15 Remarks In general, if r>0 is a rational number, then

16 Tool #2 Use the Limit Laws

17 Tool #3 (Squeeze Theorem)
If and Then

18 Tool #3 (Squeeze Theorem)
If and Then .

19 Example 4

20 It is important to state the name of the theorem
Remark 1 It is important to state the name of the theorem

21 Remark 1 Typically, you need to find an and cn

22 Tool #4 (Theorem)

23 Tool #4 (Theorem) .

24 Tool #4 (Theorem) .

25 Example 5

26 Remark .

27 Tool #5

28 Example 6

29 Maple I will explain how things work first.
Do not type into Maple program until I tell you to do so. Use worksheet mode, and text input.

30 Review from Last Time name:=proc(variables) #Comments
local local variables; …………………………. print(….); end;

31 Example 1 Consider the piecewise defined function
For each interval, we need a different formula to compute the function values

32 Example 1 Consider the piecewise defined function
For each interval, we need a different formula to compute the function values Q: Input=? , Output=?

33 Example 1 Version 1

34 Example 1 Version 1

35 Structure of the if-block
Statements executed only if the condition is met. Otherwise, the statements will be skipped:

36 Example 1 Version 2

37 Example 1 Version 2 > fun(-2);fun(2); 4 2

38 Structure of the if-block
There are two cases separated by one condition: the condition is met or else:

39 Example 2 We need 3 branches

40 Example 2

41 Example 2 > fun(-3);fun(1);fun(3); -14 3 5e(-1)

42 Structure of the if-block

43 Classwork Team Classwork

44 Homework Download from the web
Do not use other references including Google Read Zeng Section 1.4


Download ppt "MAT 4725 Numerical Analysis"

Similar presentations


Ads by Google