Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve the equation using Newton Raphson method: x^3-5x^2+3x=1. a) Solve it in excel. The starting point is x=8. Only do 5 iterations. b) Write a

Solve the equation using Newton Raphson method: x^3-5x^2+3x=1.

a) Solve it in excel. The starting point is x=8. Only do 5 iterations.

b) Write a MATLAB code to solve this equation. Find the derivation manually and then put it in the code(code does not need to do derivation). The starting point is x=8. Use a while loop that stops when the x of solution can reduce he absolute value of equation to 0.001 or smaller. Your code should report the number of iteration and the value of solution, x.

MATLAB CODE:

x = 8; %starting point x_old = 100; %intitialized val = 1; %value of the function at new root intitialized to 1 iter = 0;

while val > 10^-3 || val < -10^-3 %|val|<0.001 x_old = x; x = x - (x^3 - 5*x^2 + 3*x -1)/(3*x^2 - 10*x +3); val = (x^3 - 5*x^2 + 3*x -1); iter = iter + 1; end

fprintf('Iteration %d: x=%.20f, value=%.20f ', iter, x, val);

c)Use the code you wrote in part b, and this time use x=3 as the starting point. What is the answer? What do you think happen that you cannot come up with a solution with x=3, but you can with x=8?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

3. What are potential solutions?

Answered: 1 week ago