Question

R2240 Computation Methods Name: The function: y = 5 x has a root between 1 and 3 Calculate the root using the secant method ex/2 (x +2) r 2 has a root between 1 and 3. a. Use 1.0000 as the initial guess. b. c. Use a perturbation (8) of o.020 for secant calculation Make three iterations d. Sho w all work (each section/step) below for full credit. 2 1.0000 1.747868 1.0100 0.9900
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear friend,

Assuming the modified secant method updates the x_{t+1} accoding to following formula
x_{t+1} = x_{t} - Y(x_{t})*(delta/( Y(x_{t}+delta) - Y(x_{t})))

I have written follwoing python code for you.

===============

import math


def Y(x):    
    V = (5 * math.exp(x/2))/(x+2) -x*x
    return V

delta=0.02
x=1

print("i x      Y(x) (x+delta/2) (x-delta/2) Y(x+delta/2) Y(x-delta/2)");
for i in range(0,5):
   print(str(i)+" "+str("{0:.4f}".format(x))+" "+str("{0:.4f}".format(Y(x)))+" "+str("{0:.4f}".format(x+delta/2))+"      "+str("{0:.4f}".format(x-delta/2))+"      "+str("{0:.4f}".format(Y(x+delta/2)))+"     "+str("{0:.4f}".format(Y(x-delta/2))));
   x = x - delta*(Y(x)/( Y(x+delta) - Y(x))) #Modify here if required

=============================

On execution I get following output

----------------------------------------------

i x      Y(x) (x+delta/2) (x-delta/2) Y(x+delta/2) Y(x-delta/2)
0 1.0000 1.7479 1.0100      0.9900      1.7324     1.7632
1 2.1217 -0.9973 2.1317      2.1117      -1.0308     -0.9639
2 1.8247 -0.0740 1.8347      1.8147      -0.1028     -0.0454
3 1.7990 -0.0009 1.8090      1.7890      -0.0293     0.0273
4 1.7987 -0.0000 1.8087      1.7887      -0.0284     0.0282

-------------------------------------------------------------------------------------------------

Please fill the values in your table.

In case a fifferent function to update the x_{t+1} is explained in your class you can easity modify the code. I have written " #Modify here if required" to let you know where to modify. Re run the code and fill in the table.

Cheers!

Add a comment
Know the answer?
Add Answer to:
R2240 Computation Methods Name: The function: y = 5 x" has a root between 1 and...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • (a) Given the following function f(x) below. Sketch the graph of the following function A1. f () 3 1, 12 5 marks (b) Ve...

    (a) Given the following function f(x) below. Sketch the graph of the following function A1. f () 3 1, 12 5 marks (b) Verify from the graph that the interval endpoints at zo and zi have opposite signs. Use the bisection method to estimate the root (to 4 decimal places) of the equation 5 marks] (c) Use the secant method to estimate the root (to 4 decimal places) of the equation 6 marks that lies between the endpoints given. (Perform...

  • 1. Of the four methods use to estimate the roots, which one appeared to be fastest...

    1. Of the four methods use to estimate the roots, which one appeared to be fastest (take the fewest iterations) to arrive at a solution: a)False-position method b)Bisection method c)Secant Method d)Newton’s Method e)They all took the same number of iterations 2.The Bisection and False-position method are: a)Interval (bracketing) methods b)Calculus-bases methods c)Secant methods d)Uses Ohm’s law 3.The Secant method is similar to Newton’s method except: a)for the use of an approximation for the tangent-line b)that two points (defining the...

  • L. Determine the real root(s) off(x)--5xs + 14x3 + 20x2 + 10x a. Graphically on a graph paper. b....

    l. Determine the real root(s) off(x)--5xs + 14x3 + 20x2 + 10x a. Graphically on a graph paper. b. Using Bisection method c. Using False Position method to determine the root, employing initial guesses of x-2 d. Using the Newton Raphson methods to determine the root, employing initial guess to determine the root, employing initial guesses ofxn-2 and Xu-4 and Es= 18%. and r 5.0 andas answer. 1%. was this method the best for these initial guesses? Explain your xo--l...

  • Task 2 (25 points + 4 points for commenting): Write computer code to perform the Fixed.Point...

    Task 2 (25 points + 4 points for commenting): Write computer code to perform the Fixed.Point method and use your code to find the root of the following equation using an initial guess of 3 and a stopping criterion of 0.001%; f(x) e -4x For Fixed-Point, you do not have to code Matlab to take the derivatives of the function and check the g'(x). You can do that step by hand, and then show me your hand cal ulations to...

  • Matlab only What is the function value at the estimated root after one iteration of the...

    Matlab only What is the function value at the estimated root after one iteration of the bisection method for the root finding equation: f(x) = x^3 -x -11 with xl = -4 and xu = 2.5? Select one: a.-0.7500 x O b.-3.2500 o co d. -10.6719 Which of the following statements is false? All open methods for root finding: Select one: a. Is sensitive to the shape of the function X b. Require two initial guesses to begin the algorithm...

  • MATLAB QUESTION please include function codes inputed Problem 3 Determine the root (highest positive) of: F(x)=...

    MATLAB QUESTION please include function codes inputed Problem 3 Determine the root (highest positive) of: F(x)= 0.95x.^3-5.9x.^2+10.9x-6; Note: Remember to compute the error Epsilon-a after each iteration. Use epsilon_$=0.01%. Part A Perform (hand calculation) 3 iterations of Newton's Raphson method to solve the equation. Use an initial guess of x0=3.5. Part B Write your own Matlab function to validate your results. Part C Compare the results of question 1 to the results of question 2, what is your conclusion ?

  • This program has to be written in matlab 2. Write a function to find a root...

    This program has to be written in matlab 2. Write a function to find a root of f(c) using the secant method. Call this routine secant, call the file secant.m; its first line should be function [x,nf] = secant (fname, x0, x1, tol) fname is the name of the m-file which evaluates the function f(x), 20 and 21 are initial approximations to .c", and tol is a stopping tolerance. Your code should return an approximation x = 2X+1 to 3*...

  • 5.1.2 Open Methods - Newton-Raphson Method Xi+1= xi – FOTO Matlab Code Example:4 function mynewtraph (f,...

    5.1.2 Open Methods - Newton-Raphson Method Xi+1= xi – FOTO Matlab Code Example:4 function mynewtraph (f, f1,x0,n) Xx0; for ilin x = x - f(x)/f1(x); disp (li if f(x) <0.01 f(x))) break end end end Matlab Code from Chapra function [root, ea, iter)=newtraph (func,dfunc, xr, es,maxit,varargin) newtraph: Newton-Raphson root location zeroes 8 [root, ea, iter)-newtraph (func, dfunc, xr, es,maxit,pl,p2, ...): $uses Newton-Raphson method to find the root of fune input: func- name of function 8dfunc = name of derivative of...

  • find the root(s) of the following functions using both Newton's method and the secant method, using...

    find the root(s) of the following functions using both Newton's method and the secant method, using tol = eps. 3 Find the root s of the following functions using both Newton's ulethod and the anat inethod using tol epa. . You will vood to experiment with the parameters po, pl, ad maxits. . For each root, visualize the iteration history of both methods by plotting the albsolute errors, as a function . Label the two curves (Newton's method and secaut...

  • 45-3. Modify the code used in Example 4 to find the root only at f(x)<0.01 using...

    45-3. Modify the code used in Example 4 to find the root only at f(x)<0.01 using Newton-Rephson Method without showing any iteration. Also find the root of equation, f(x) = x 9-3x -10, take initial guess, Xo=2 العقدة College of 9:05 mybb.qu.edu.ca Numerical Methods (Lab.) GENG 300 Summer 2020 5.1.2 Open Methods - Newton-Raphson Method f(x) *1+1 = x; - Matlab Code Example:4 function mynewtraph.t1.x0,-) XXO for ilin x - x - x)/1 x) disp 1 x) <0.01 break end...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT