Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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.

2 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.

3 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.

4 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.

5 Assignment 5, Due 2/4/16 On page 242 of the text (6th edition), the value of is given as , 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

6 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

7 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, , 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?

8 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

9 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

10 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.

11 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)= (text p434)

12 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)= (text p434) Compare this percent difference with the percent difference you got with Euler’s method

13 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)= (text p434) Compare this percent difference with the percent differences you got with Euler and Extended Euler method.

14 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

15 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) = on p434 of text. Hand in your Euler and extended Euler solvers and a copy of command window where all 3 methods were used.

16 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)

17 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.

18 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.

19 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

20 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


Download ppt "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."

Similar presentations


Ads by Google