Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


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

1 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 estimates. Hand in copies of your graph and the command window where the functions were called and zeros returned. Note: I am not asking to see your code. Feel free to use the code in the lecture slides.

2 Assignment 2, Due 1/23/19 f(x) = ex - 3x2 has a zero in the interval [-1, 0]. Modify your Newton’s method code to return convergence data as log10(re). Use plot to compare the rates of convergence to the root with initial guesses 0 and -1. Verify that both initial guesses converge to the same zero. Hand in a copy of command window where Newton’s method was called Hand in your plot with labels (by hand is OK) on axes and curves to show which curve goes with which initial guess.

3 Assignment 3, Due 1/28/19 Write bisection function that finds root and saves convergence data Use code to find the zero f(x) = ex - 3x2 in the interval [-1, 0]. On a semi-log plot, compare the rate of convergence of the bisection method with starting interval [-1,0] to that of Newton’s method with initial guesses -1 and 0. Verify that Bisection and Newton’s method converge to the same zero. Hand in a copy of the command window where functions were called. Hand in a plot of the convergence data for bisection and Newton’s method with axes and curves labeled.

4 Assignment 4, Due 1/30/19 Write secant function that finds root and saves convergence data Use code to find zero f(x) = ex - 3x2 in the interval [-1,0]. 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 [-1,0] and to Newton’s method with initial guesses -1 and 0. Verify that all 3 method converge to the same zero. Hand in a copy of the command window where functions were called. Hand in a plot of the convergence data on the 3 methods with axes and curves labeled.

5 Assignment 5, Due 2/27/19 Assume is the “exact” value of the integral. Estimate this integral by the composite trapezoid rule with 3, 5, and 7 points. Calculate the percent difference from the exact value in each case using PD=100*abs((exact-trap)/exact).

6 Assignment 6, Due 3/6/19 Approximate the integral by Simpson rules with 3, 5, and 7 equally spaced points on [1,3]. Calculate the percent difference from the “exact” value, , in each case. Compare with results using the trapezoid rule (assignment #5).

7 Assignment 7, Due 3/20/19: Write MatLab functions for Gauss quadrature with 2, 3, 4 and 5 points. Apply these function to the integral Take as the exact value. Hand in a copy of the command window where you called the Gauss functions and calculated the percent differences from the exact value (100|(exact-Gauss)/exact|). Compare percent differences using Gauss quadrature with 3 and 5 points to results using trapezoid and Simpson’s rules (HW 5 and 6).

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

9 Assignment 9 due 4/8/19 Use ode45 to solve x’ = 1 + x2 + t3 for x(t=2) given x(t=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

10 Assignment 10, Due 4/15/2019: 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, ex_Eulersys, 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, Calculate the percent difference from the exact values at t=3 Make separate plots for each method that compare your results to the exact solution Make sure your plots can distinguish exact from numerical results)


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

Similar presentations


Ads by Google