Assignment 1: due 1/19/16 Estimate all of the zero of x3-x2-2x+1 graphically. Write a MatLab code for Newton’s method. Use your code to refine the graphical.

Slides:



Advertisements
Similar presentations
Numerical Integration
Advertisements

Computational Methods in Physics PHYS 3437
MATHEMATICAL METHODS.
Numerical Integration of Functions
2. Numerical differentiation. Approximate a derivative of a given function. Approximate a derivative of a function defined by discrete data at the discrete.
Numerical Integration
Lecture 3: Integration. Integration of discrete functions
MANE 4240 & CIVL 4240 Introduction to Finite Elements Numerical Integration in 1D Prof. Suvranu De.
CVEN Exam 1 Review. Matlab.m files Matlab.m files Programming: FOR, WHILE, IF and FUNCTION Programming: FOR, WHILE, IF and FUNCTION Taylor Series.
Numerical Integration
ECIV 301 Programming & Graphics Numerical Methods for Engineers REVIEW II.
Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis
Chapter 10 ordinary differential equations (ODEs) Chapter 11 systems of ODEs (6 th edition)
Numerical Solution of Ordinary Differential Equation
NUMERICAL DIFFERENTIATION The derivative of f (x) at x 0 is: An approximation to this is: for small values of h. Forward Difference Formula.
Using the Quadratic Formula to Solve a Quadratic Equation
Simpson’s 1/3 rd Rule of Integration. What is Integration? Integration The process of measuring the area under a.
Chapter 4, Integration of Functions. Open and Closed Formulas x 1 =a x 2 x 3 x 4 x 5 =b Closed formula uses end points, e.g., Open formulas - use interior.
Chapter 4 Numerical Differentiation and Integration 1/16 Given x 0, approximate f ’(x 0 ). h xfhxf xf h )()( lim)('    x0x0 x1x1 h x1x1 x0x0.
1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral.
3. Numerical integration (Numerical quadrature) .
Lecture 19 - Numerical Integration CVEN 302 July 22, 2002.
Numerical Computation
1 Chapter 7 NUMERICAL INTEGRATION. 2 PRELIMINARIES We use numerical integration when the function f(x) may not be integrable in closed form or even in.
CMPS1371 Introduction to Computing for Engineers NUMERICAL METHODS.
4.6 Numerical Integration -Trapezoidal Rule -Simpson’s Rule
1 Simpson’s 1/3 rd Rule of Integration. 2 What is Integration? Integration The process of measuring the area under a curve. Where: f(x) is the integrand.
Chapters 5 and 6: Numerical Integration
CSE 330 : Numerical Methods
MA2213 Lecture 4 Numerical Integration. Introduction Definition is the limit of Riemann sums I(f)
Chapter 17 Boundary Value Problems. Standard Form of Two-Point Boundary Value Problem In total, there are n 1 +n 2 =N boundary conditions.
Lecture Notes Dr. Rakhmad Arief Siregar Universiti Malaysia Perlis
Numerical Methods Applications of Loops: The power of MATLAB Mathematics + Coding 1.
Lecture 22 - Exam 2 Review CVEN 302 July 29, 2002.
Review Taylor Series and Error Analysis Roots of Equations
AP CALCULUS AB PRACTICE EXAM. 1)Multiply by clever form of 1 3 and 1/3.
MA/CS 375 Fall MA/CS 375 Fall 2002 Lecture 31.
Chapter 3 Roots of Equations. Objectives Understanding what roots problems are and where they occur in engineering and science Knowing how to determine.
MECH345 Introduction to Finite Element Methods Chapter 1 Numerical Methods - Introduction.
Quadrature rules 1Michael Sokolov / Numerical Methods for Chemical Engineers / Numerical Quadrature Michael Sokolov ETH Zurich, Institut für Chemie- und.
CHAPTER 3 NUMERICAL METHODS
Chapter 10 ordinary differential equations (ODEs) Chapter 11 systems of ODEs (6 th edition)
Finding zeros (also called roots) of a function Overview: Define the problem Methods of solution Graphical Newton’s Bisection Secant.
Antiderivatives and Indefinite Integration
The purpose of Chapter 5 is to develop the basic principles of numerical integration Usefule Words integrate, integral 积分(的), integration 积分(法), quadrature.
Chapters 5 and 6: Numerical Integration Code development trapezoid rule Simpson’s rule Gauss quadrature Laguerre quadrature Analysis changing the variable.
Finding zeros (also called roots) of a function Overview: Define the problem Methods of solution Graphical Newton’s Bisection Secant.
Chapter 12: Data Analysis by linear least squares Overview: Formulate problem as an over-determined linear system of equations Solve the linear system.
Quadrature – Concepts (numerical integration) Don Allen.
CHAPTER 3 NUMERICAL METHODS
Chapter 4, Integration of Functions
NUMERICAL DIFFERENTIATION Forward Difference Formula
Chapter 22.
F(x) = x2 x > 3 Find the range of f(x) f(x) > 9.
MATH 2140 Numerical Methods
Numerical Analysis Lecture 45.
ME 123 Computer Applications I Lecture 24: Character Strings 4/18/03
MATH-321 In One Slide MATH-321 & MATLAB Command.
Finding zeros (also called roots) of a function
Chapters 5 and 6: Numerical Integration
SKTN 2393 Numerical Methods for Nuclear Engineers
Assignment 1: due 1/16/19 Estimate all of the zero of x3-x2-2x+1 graphically. Write a MatLab code for Newton’s method. Use your code to refine the graphical.
Numerical Integration (Chapters 5 & 6, C&K 6th edition)
Chapter 10 ordinary differential equations (ODEs)
Assignment 1: due 1/17/19 Estimate all of the zero of x3-x2-2x+1 graphically. Write a MatLab code for Newton’s method. Use your code to refine the graphical.
ME 123 Computer Applications I Lecture 25: MATLAB Overview 4/28/03
Chapter 12: Data Analysis by linear least squares
Numerical Integration
Chapter 4, Integration of Functions
Presentation transcript:

Assignment 1: due 1/19/16 Estimate all of the zero of x3-x2-2x+1 graphically. Write a MatLab code for Newton’s method. Use your code to refine the graphical estimates. Hand in copies of your graph, your code for Newton’s method and the command window where the functions were called.

Assignment 2, Due 1/21/16 f(x) = ex - 3x2 has a zero in the interval [0.5, 1.5]. Modify your Newton’s method code to return convergence data. On a semi-log plot, compare the rates of convergence to the root with initial guesses 0.5 and 1.5. Hand in a copy of your modified Newton’s method function, the script to get the convergence data and make the plot, and the plot of data.

Assignment 3, Due 1/26/16 Write bisection function that finds root and saves convergence data Use code to find the zero of f(x) = ex - 3x2 in the interval [0.5, 1.5]. On a semi-log plot, compare the rate of convergence of the bisection method to that of Newton’s method with initial guesses 0.5 and 1.5. Hand in a copy of your bisection-method function, the script to get and plot the convergence data for bisection and Newton’s method, and the plot of the data.

Assignment 4, Due 1/28/16 Write secant function that finds root and saves convergence data Use code to find zero f(x) = ex - 3x2 in the interval [0.5, 1.5]. On a semi-log plot, compare the rate of convergence of the secant method to that of the bisection method with the same starting values and to Newton’s method with initial guesses 0.5 and 1.5. Hand in a copy of your secant function, the script to get and plot the convergence data, and the plot of the data.

Assignment 5, Due 2/4/16 On page 242 of the text (6th edition), the value of is given as -18.79829683678703, which can be taken as the “exact” value. Estimate this integral by the trapezoid rule with 10 points when the points are chosen in the following ways: 1. Equally space on [1, 3] 2. xk = exp(yk) where yk=linspace(0,ln(3),10) 3. Equally space on [0, ln(3)] in the new integration variable y = ln(x). Calculate the percent difference from the exact value in each case

Estimate the error in approximating Assignment 6, Due 2/9/16 Estimate the error in approximating by the composite trapezoid rule with 10 points |e| < (b-a)3|f “(x)|max /12n2 Don’t forget the chain rule when you take the derivative

Assignment 7, Due 2/18/16 1. Approximate the integral by the trapezoid and Simpson rules with 5 equally spaced points on [1,3]. Calculate the percent difference from the “exact” value, -18.79829683678703, in each case. 2. Use the Lagrange interpolation formula to derive a trapezoid rule approximation to the integral Using the value of the integrand –a and +a. Show that your result is the same as that derived from the area of a trapezoid?

Assignment 8, Due 2/23/16 problem 6.2-6 text p240 Find A and B by requiring formula to be exact for f(x) = 1 and f(x) = x

Assignment 9, Due 3/1/16: Make a table that includes the estimated value and percent difference (100|(exact-estimate)/exact| in approximated by the composite trapezoid rule, the composite Simpson’s rule and Gauss quadrature when the integrand is evaluated at 2, 3, 4, and 5 points, if possible. Hand in your MatLab codes. Quiz on numerical integration 3/8/16

Assignment 10, Due 3/3/16: Approximate integral in x variable by Guass quadrature with 2, 3, 4, and 5 points Approximate integral in y variable by Laguerre quadrature with 2, 3, 4, and 5 points Report your results as a table with approximate values and percent difference from exact.

Assignment 11, Due 3/10/16: Use Euler’s method to solve x’ = 1 + x2 + t3 for x(t=2) given x(t=1) = -4 using 10 points. Plot result. Display t(npts) and x(npts). Calculate percent difference of x(npts) from “exact” value x(t=2)=4.371221866 (text p434)

Assignment 12, Due 3/22/16: Use Extended Euler’s method to solve x’ = 1 + x2 + t3 for x(t=2) given x(t=1) = -4 using 10 points. Plot result. Display t(npts) and x(npts). Calculate percent difference of x(npts) from “exact” value x(t=2)=4.371221866 (text p434) Compare this percent difference with the percent difference you got with Euler’s method

Assignment 13, Due 3/24/16: Use 4th order Taylor method to solve x’ = 1 + x2 + t3 for x(t=2) given x(1) = -4 using 10 points. Plot result. Display t(npts) and x(npts). Calculate percent difference of x(npts) from “exact” value x(t=2)=4.371221866 (text p434) Compare this percent difference with the percent differences you got with Euler and Extended Euler method.

Assignment 14, Due 3/29/16: Given that unknown function x has both explicit and implicit dependence on independent variable t and that x’ = t2 + x3 , Calculate by hand x’’(t,x), x’’’(t,x) and x(4)(t,x). Show all steps

Assignment 15 due 3/31/16 Use ode45 to solve x’ = 1 + x2 + t3 for x(2) given x(1) = -4. Use the same number of points as ode45 to solve for x(t) by Euler and extended Euler methods. In all 3 cases calculate the percent difference from the exact value x(2) = 4.371221866 on p434 of text. Hand in your Euler and extended Euler solvers and a copy of command window where all 3 methods were used.

Assignment 16, Due 4/3/2016: Solve the system of equations x’=x – y + 2t – t2 – t3 y’=x + y – 4t2 + t3 for 0 < t < 3, subject to the initial condition x(0)=1, y(0)=0 Use Eulersys, RK2sys, and ode45 with the same number of points Exact solutions are x(t)=exp(t)cos(t) + t2 and y(t)=exp(t)sin(t) - t3 For each method: print out the values of x and y at t=3, percent difference from the exact values at t=3 separate plots for each method that compare your results to the exact solution (make sure your plots can distinguish exact from numerical results)

Use your Cholesky factorization code to solve Ax = b where Assignment 17, Due 4/14/16 Write a MATLAB codes for forward substitution, backward substitution and Cholesky factorization. Use the MATLAB function lu(A) and your forward and backward substitution codes to solve Ax = b where A = and b = Use your Cholesky factorization code to solve Ax = b where and b = A = Test your results using MatLab’s method x = A\b. Hand in copies of your codes and the command window where they were called.

Assignment 18 due 4/19/16 Use normal equations to fit a parabola to the data set t=linspace(0,10,21) y=[2.9, 2.7, 4.8, 5.3, 7.1, 7.6, 7.7, 7.6, 9.4, 9, 9.6,10, 10.2, 9.7, 8.3, 8.4, 9, 8.3, 6.6, 6.7, 4.1] with weights that the reciprocal of the square of the uncertain in y, which is 10% of the value of y. Plot the data with error bars and the fit on the same set of axes. Use MatLab’s errorbar(t,y,dy,’*’) function. Show the optimum value of the parameters and calculate the sum of squared deviations between fit and data.

Assignment 19 due 4/21/16 Use QR factorization to fit a parabola to the data set t=linspace(0,10,21) y=[2.9, 2.7, 4.8, 5.3, 7.1, 7.6, 7.7, 7.6, 9.4, 9, 9.6,10, 10.2, 9.7, 8.3, 8.4, 9, 8.3, 6.6, 6.7, 4.1] Note: Same data as assignment 18 but without dy’s Plot the data and the fit on the same set of axes Show the optimum value of the parameters Calculate the sum of squared deviations between fit and data directly from the QR factorization

Assignment 20 due 4/26/16 Use singular value decomposition to fit a parabola to the data set on page 495 of Cheney & Kincaid 6th edition: surface tension as a function of temperature. T=0, 10, 20, 30, 40, 80, 90, 95 S=68.0, 67.1, 66.4, 65.6, 64.6, 61.8, 61.0, 60.0 Show the optimum value of the parameters and the minimum sum of squared deviations of the fit from the data points. Plot the fit and data (no error bars) on the same set of axes. Use Moore-Penrose pseudo inverse to solve for unknown parameters