Question

For each equation, write a brief program to compute and print eight steps of Newton's method...

For each equation, write a brief program to compute and print eight steps of Newton's method for finding a positive root (Preferably in Matlab or Python).

a. x=2sinx

b. x^3=sinx+7

c. sinx=1-x

d. x^5+x^2=1+7x^3 for x>=2

Homework Answers

Answer #1

A)

clc

clear all

x(1)=1;

iter(1)=0;

for i=1:7

f(i)= x(i)-2*sin(x(i));

der_f(i)=1-2*cos(x(i));

x(i+1)=x(i)-f(i)/der_f(i);

iter(i+1)=iter(i)+1;

end;

fprintf("%i %f", iter, x);

B)

clc

clear all

x(1)=1;

iter(1)=0;

for i=1:7

f(i)= x(i).^3-sin(x(i))-7;

der_f(i)=3*x(i).^2-cos(x(i));

x(i+1)=x(i)-f(i)/der_f(i);

iter(i+1)=iter(i)+1;

end;

fprintf("%i %f", iter, x);

C).

clc

clear all

x(1)=1;

iter(1)=0;

for i=1:7

f(i)= sin(x(i))-1-x(i);

der_f(i)=cos(x(i))-1;

x(i+1)=x(i)-f(i)/der_f(i);

iter(i+1)=iter(i)+1;

end;

fprintf("%i %f", iter, x);

D).

clc

clear all

x(1)=2;

iter(1)=0;

for i=1:7

f(i)= x(i).^5+x(i).^2-1-7*x(i).^3;

der_f(i)=5*x(i).^4+2*x(i)-21*x(i).^2

x(i+1)=x(i)-f(i)/der_f(i);

iter(i+1)=iter(i)+1;

end;

fprintf("%i %f", iter, x);

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Each equation has one root. Use Newton’s Method to approximate the root to eight correct decimal...
Each equation has one root. Use Newton’s Method to approximate the root to eight correct decimal places. (a) x3 = 2x + 2 (b) ex + x = 7 (c) ex + sin x = 4 **MUST BE DONE IN MATLAB AND NEED CODE
Python Practice Sample: Question 1. Math Write a program that runs these steps three times: ...
Python Practice Sample: Question 1. Math Write a program that runs these steps three times:  Ask the user to enter a non-zero number (can be positive or negative).  Find the cube of the number and subtracts 100.0 from the cube.  Calculate the square root of the result above. If the result is negative, multiply the result by -1 so it is positive before calculating the square root.  Print the result with two decimal places.
Use Newton's method to approximate the root of the equation to four decimal places. Start with...
Use Newton's method to approximate the root of the equation to four decimal places. Start with x 0 =-1 , and show all work f(x) = x ^ 5 + 10x + 3 Sketch a picture to illustrate one situation where Newton's method would fail . Assume the function is non-constant differentiable , and defined for all real numbers
solve cos(x)=x^2 using Newton's Method accurate to eight decimal places. Show all steps in solution. How...
solve cos(x)=x^2 using Newton's Method accurate to eight decimal places. Show all steps in solution. How many roots are there?
Use Newton's method to find all solutions of the equation correct to eight decimal places. Start...
Use Newton's method to find all solutions of the equation correct to eight decimal places. Start by drawing a graph to find initial approximations. (Enter your answers as a comma-separated list.) x x2 + 1 = 1 − x
Write a program called factor.py that uses at least one loop to print out “Multiple of...
Write a program called factor.py that uses at least one loop to print out “Multiple of x!” for each element x that is a multiple of the factors: 5, 7, or 13 between zero and 100. If a number is a multiple of more than one factor, for example 35 is a multiple of both 5 and 7, print out “Multiple of 5 and 7!”. If all three are factors, then print out “Multiple of 5 and 7 and 13!”....
Each equation has one real root. Use Newton’s Method to approximate the root to eight correct...
Each equation has one real root. Use Newton’s Method to approximate the root to eight correct decimal places. (a) x5 + x = 1 (b) sin x = 6x + 5 (c) ln x + x2 = 3 **MUST BE DONE IN MATLABE AND SHOW CODE
Use Newton's method with the specified initial approximation x1 to find x3, the third approximation to...
Use Newton's method with the specified initial approximation x1 to find x3, the third approximation to the root of the given equation. x3 + 5x − 2 = 0,    x1 = 2 Step 1 If f(x) = x3 + 5x − 2, then f'(x) = _____ x^2 + _____ 2- Use Newton's method to find all roots of the equation correct to six decimal places. (Enter your answers as a comma-separated list.) x4 = 5 + x .
IN JAVA 1. Write up a small program that accepts two integers from the user. Print...
IN JAVA 1. Write up a small program that accepts two integers from the user. Print which of the two values is bigger. If they are the same, print that they are the same. 2. Write a method that accepts three doubles. Calculate and return the average of the three passed double values. 3. Write up a method that accepts a score between 0-10. Print out a message according to the following table. You ay personally decide the boundaries. i.e.,...
Bisection Method Problem. Determine the real root of f(x) = 5x^3 - 5x^2 + 6x-2 Using...
Bisection Method Problem. Determine the real root of f(x) = 5x^3 - 5x^2 + 6x-2 Using Matlab (a) plot the function using Matlab from x=0 t0 1 and guess the root (b) Write a Matlab function to do the Bisection Method. Print the code the answer for an error tolerance of 0.01%