HW10: Newton’s Method Practice#

Problem 1#

Describe in a paragraph (in your own words) what Newton’s method is and how that algorithm can be used to solve equations.

Add your description here.

Problem 2#

Program Newton’s method to solve the following equation for all three roots: $\( x^3 + 2x^2 - 1 \)$

Make sure to write the program such that it returns all three roots at one time. Please do that with an input of a list with three guesses of [-2,-0.5,1]. Also use the function (but not the derivative) describing the curve as an input to your Newton’s method. In addition to the newton solver function, you should have other functions to find the value of the above function and to find the next x value (see the example in the Newton’s equation Module). Please also plot the function with the proper labels. Include on the plot, the procession of guess values for one of the solutions. Your Newton’s method will return the solution list (3 values) and also will return a list of values yielding the procession of values for one of those solutions. Those procession values should be plotted on the function curve as points similar to how it was done in the Newton’s Method module.

#Your code here

Problem 3#

In Problem 4 of Homework 8, you were asked to solve for the x component of benzene and the corresponding temperature using Raolt’s Law. In that problem you likely used Scipy’s fsolve. In this problem, you will use Newton’s method to solve for the x component of benzene and the corresponding temperature also assuming Raolt’s Law. However, you’ll use Newton’s method and a Jacobian matrix to solve for the two unknowns. Your Jacobian matrix should include object references to the object functions (Psat and the derivative of the Antoine equation). To get the derivatives of the Antoine equation with respect to T, you should use sympy’s symbolic differentiation to demonstrate you know how to use that functionality (even though you could get the derivatives in other ways). No need to work sympy’s output into a function; you can manually type it in to the class as a function after you get sympy to generate it. Use the example at the end of the Newton’s Method module (and the In-class Jupyter Sheet CL-09MoreEquations.ipynb on Learning Suite) to help you with this problem. You should get the same answer as you did ini Problem 4 of Homework 8.

#Your code here