Question

A5.2. Write a matlab program to find out the root of equation f (x)-x*-3x - 1, using false-position method. Use initial and unumerical method lab

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

fun.m:

clc;

f=@(x) x^4-3*x-1;

a=2,b=3;

for i=1:10

x0=a;

x1=b;

fprintf('\n Hence root lies between (%.4f, %.0f)',a,b);

x2(i)=x0(x1-x0)/(f(x1)-f(x0))*f(x0);

if(x2(i)>0

b=x2(i);

else

a=x2(i);

end

fprintf('\n Therefore, x2=%.4f \n Here , f(x2)=%.4f',x2(i),f(x2(i)))

p=x2(i);

end

for i = 1: 10

error(i) = p - x2(i);

end

Answer=p;

plot(error)

grid on;

title('plot of error');

xlabel('terations');

ylabel('Error');

Output:

dj How to install Django on Windo x ng Diango models . Diango Girls Tu X © A52. Write A Matlab program T Execute MATLAB/Octa

Add a comment
Know the answer?
Add Answer to:
A5.2. Write a matlab program to find out the root of equation f (x)-x*-3x - 1, using false-positi...
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
  • Write a Matlab function for: 1. Root Finding: Calculate the root of the equation f(x)=x^3 −5x^2...

    Write a Matlab function for: 1. Root Finding: Calculate the root of the equation f(x)=x^3 −5x^2 +3x−7 Calculate the accuracy of the solution to 1 × 10−10. Find the number of iterations required to achieve this accuracy. Compute the root of the equation with the bisection method. Your program should output the following lines: • Bisection Method: Method converged to root X after Y iterations with a relative error of Z.

  • Using Matlab, write an .M code program: Write a program for numerical solution of nonlinear equation...

    Using Matlab, write an .M code program: Write a program for numerical solution of nonlinear equation by Fixed-Point Iteration method with given accuracy elementof. Solve the equation. Try 3 different representations of the equation in the form x = g(x). For every representation solve the problem with initial approximations x0 = 0, x0 = 2, and x0 = 10 and with the accuracy elementof = 10^-8. f(x) = e^x - 3x^4 - 40x - 10 = 0.

  • Letermine the real root of f(x)= - 8x + 56x4x-7 a) Grophically to determine the root...

    Letermine the real root of f(x)= - 8x + 56x4x-7 a) Grophically to determine the root to b) using bsection &a=2%. Employ initial guesses of and xu = 8 xe=3 c) using the false-position method to determine the root to a 25% . Employ the some intials as in (b).

  • *related to Matlab Choose the correct statement about Open Methods from the options below. Select one: a. All open methods will work only if you have an analytic expression of f(x) b. All open method...

    *related to Matlab Choose the correct statement about Open Methods from the options below. Select one: a. All open methods will work only if you have an analytic expression of f(x) b. All open methods are based on considering the tangent to f(x) c. All open methods require a bracket to start off d. All open methods require more than one point as initial guesses. In a bracketing method, how does the upper bounds xu gets updated? Select one: a....

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

  • Write a matlab program to implement the secant root finding method in matlab. The function name...

    Write a matlab program to implement the secant root finding method in matlab. The function name should be Secant and it should take the equation as input whoes root has to be found and the two initial values of a and b and maximum tolerable error. Consider the following example: Your code should generate the following: >> secantAssg5(@(x)(x^4+x^2+x+10),2,3,0.0001)    Xn-1      f(Xn-1)      Xn      f(Xn)      Xn+1      f(Xn+1) 2.0000   32.0000    3.0000 103.0000    1.5493   19.7111 ….. ….. ….. Root is x = 0.13952 ans...

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

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

  • Need solution for question 5.6 using python? tation to within e, 5.11 Determine the real root...

    Need solution for question 5.6 using python? tation to within e, 5.11 Determine the real root of x 80: (a) analytically and (b) with the false-position method to within e, = 2.5%. Use initial guesses of 2.0 and 5.0. Compute the estimated error Ea and the true error after each 1.0% teration 5.2 Determine the real root of (x) 5r - 5x2 + 6r -2 (a) Graphically (b) Using bisection to locate the root. Employ initial guesses of 5.12 Given...

  • Write a program in python to find a single root of a function f(x) on an...

    Write a program in python to find a single root of a function f(x) on an interval [a,b] using the bisectional method. Test your program on an equation that you may easily solve analytically.

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