Question

Use PYTHON to compute the problem please

= Consider the equation f(x) 1/4 – x* (1 – x²) – sin(x) 0 a). Show by a simple test that a root exists between x = 0 and x =

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1).ANSWER:

GIVEN THAT:

import numpy as np

def f(x):
return np.pi/4-x*(1-x*x)-np.arcsin(x);
def secant(x1, x2):
ct=0;
n = 0; xm = 0; x0 = 0; c = 0;
if (f(x1) * f(x2) < 0):
while True:
  
# calculate the intermediate value
x0 = ((x1 * f(x2) - x2 * f(x1)) /
(f(x2) - f(x1)));
  
# check if x0 is root of
# equation or not
c = f(x1) * f(x0);
  
# update the value of interval
x1 = x2;
x2 = x0;
  
# update number of iteration
n += 1;
  
# if x0 is the root of equation
# then break the loop
if (c == 0):
break;
xm = ((x1 * f(x2) - x2 * f(x1)) /
(f(x2) - f(x1)));
ct=ct+1;
if(ct==3):
break;
  
print("Root of the given equation =",
round(x0, 6));
return x0;

else:
print("Can not find a root in ",
"the given inteval");

x0=secant(0,1)
Dx=(f(x0+1e-4)-f(x0-1e-4))/(2*1e-4);
print("Dervative is",Dx);

Add a comment
Know the answer?
Add Answer to:
Use PYTHON to compute the problem please = Consider the equation f(x) 1/4 – x* (1...
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
  • QUESTION 1 = = (a) Apart from x = 0 the equation f(x) 22 – 4...

    QUESTION 1 = = (a) Apart from x = 0 the equation f(x) 22 – 4 sin r 0 has another root in (1, 2.5). Perform three iterations of the bisection method to approximate the root. State the accuracy of the root after the three iterations. (b) Perform three iterations of Newton's method for the function in (a) above, using x(0) = 1.5 as the initial solution. Compare the error from the Newton's approximation with that incurred for the same...

  • i need the answer to be on a MatLab window 1. Consider the following equation, which...

    i need the answer to be on a MatLab window 1. Consider the following equation, which represents the concentration (c, in mg/ml) of a drug in the bloodstream over time (t, in seconds). Assume we are interested in a concentration of c2 mg/ml C3te-0.4t A. Estimate the times at which the concentration is 2 mg/ml using a graphical method Be sure to show your plot(s). Hint: There are 2 real solutions B. Use MATLAB to apply the secant method (e.g....

  • this is numerical analysis QUESTION 1 (a) Apart from 1 = 0 the equation f(1) =...

    this is numerical analysis QUESTION 1 (a) Apart from 1 = 0 the equation f(1) = x2 - 4 sin r = 0 has another root in (1, 2.5). Perform three (10) iterations of the bisection method to approximate the root. State the accuracy of the root after the three iterations. (b) Perform three iterations of Newton's method for the function in (a) above, using x) = 1.5 as the initial (10) solution. Compare the error from the Newton's approximation...

  • (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...

  • Let f(x) = sin(x) + 2xe® Use the secant method for finding the root. Conduct two...

    Let f(x) = sin(x) + 2xe® Use the secant method for finding the root. Conduct two iterations to estimate the root of the above equation. Let us assume the initial guesses of the root as xo -0.55, X1 0.66 < Answer:

  • 6. Consider the problem of solving x/(1 +x)-0.99-0, calling its root a. Then let α (e) be the solution of x/(1 + x)-0.99 + € 0. (a) Using (3.74), estimate (e)- . (b) Calculate α(e)directly,...

    6. Consider the problem of solving x/(1 +x)-0.99-0, calling its root a. Then let α (e) be the solution of x/(1 + x)-0.99 + € 0. (a) Using (3.74), estimate (e)- . (b) Calculate α(e)directly, compute α(e)-α, and compare with (a). Comment on your results (3.74 f (a(0)) for all sufficiently small values ofe. If the derivative α' (0) IS very large in size, then the small change e will be magnified greatly in its effect on the root. 6....

  • Let f(x) = sin(2) + 2xe Use the secant method for finding the root. Conduct two...

    Let f(x) = sin(2) + 2xe Use the secant method for finding the root. Conduct two iterations to estimate the root of the above equation. Let us assume the initial guesses of the root as Xo = -0.55, x1 = 0.66 Answer:

  • 3 Newton and Secant Method [30 pts]. We want to solve the equation f(x) 0, where f(x) = (x-1 )4. ...

    Can you help me with parts A to D please? Thanks 3 Newton and Secant Method [30 pts]. We want to solve the equation f(x) 0, where f(x) = (x-1 )4. a) Write down Newton's iteration for solving f(x) 0. b) For the starting value xo 2, compute x c) What is the root ξ of f, i.e., f(5) = 0? Do you expect linear or quadratic order of convergence to 5 and why? d) Name one advantage of Newton's...

  • Please answer all questions Q2 2015 a) show that the function f(x) = pi/2-x-sin(x) has at...

    Please answer all questions Q2 2015 a) show that the function f(x) = pi/2-x-sin(x) has at least one root x* in the interval [0,pi/2] b)in a fixed-point formulation of the root-finding problem, the equation f(x) = 0 is rewritten in the equivalent form x = g(x). thus the root x* satisfies the equation x* = g(x*), and then the numerical iteration scheme takes the form x(n+1) = g(x(n)) prove that the iterations converge to the root, provided that the starting...

  • QUESTION 1 (a) Apart from = 0 the equation f(t) = 12 - 4sin r =...

    QUESTION 1 (a) Apart from = 0 the equation f(t) = 12 - 4sin r = 0 has another root in (1, 2.5). Perform three (10) iterations of the bisection method to approximate the root. State the accuracy of the root after the three iterations. (b) Perform three iterations of Newton's method for the function in (a) above, using x(0) = 1.5 as the initial (10) solution. Compare the error from the Newton's approximation with that incurred for the same...

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