Question: please help! Problem 1: Write a Newton-Raphson function in Matlab that can solve nonlinear equations. Your Newton-Raphson function should also output the number of iterations
please help!
Problem 1: Write a Newton-Raphson function in Matlab that can solve nonlinear equations. Your Newton-Raphson function should also output the number of iterations needed to obtain the results. Note: You may not be able to find a solution within the prescribed iterations/tolerance. In that case your code can issue a warning and return an empty variable (i.e. output -[) Use your function to solve the following nonlinear equations: a) Single root f (x)x3- 3 -0 b) Multiple roots f(x)-x4163 3 731 82573451 594 2 297 Try different initial guesses and you should be able to find more than one roots. If you choose appropriate initial guesses then you can find four different roots! c) System of equations fi (x,y,z)-3x - cos(yz) -- f2 (x, y, z)-X2-81(y + 0.1)2 + sin2+ 1.062 0 f3 (x, y, z) = exp(-xy) + 20z + 10-3 0 Take initial guess as 0.1 0.1 0.1 Submit your matlab code together with the outputs you got for different cases. Problem 1: Write a Newton-Raphson function in Matlab that can solve nonlinear equations. Your Newton-Raphson function should also output the number of iterations needed to obtain the results. Note: You may not be able to find a solution within the prescribed iterations/tolerance. In that case your code can issue a warning and return an empty variable (i.e. output -[) Use your function to solve the following nonlinear equations: a) Single root f (x)x3- 3 -0 b) Multiple roots f(x)-x4163 3 731 82573451 594 2 297 Try different initial guesses and you should be able to find more than one roots. If you choose appropriate initial guesses then you can find four different roots! c) System of equations fi (x,y,z)-3x - cos(yz) -- f2 (x, y, z)-X2-81(y + 0.1)2 + sin2+ 1.062 0 f3 (x, y, z) = exp(-xy) + 20z + 10-3 0 Take initial guess as 0.1 0.1 0.1 Submit your matlab code together with the outputs you got for different cases
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
