Question

MATLAR problem: Problem S: Determine the roots of f(x)=-12-21x+18r-2.75r with the methods of bisection, and false position. P


Problem 5, using Matlab

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

Code:

clear all
clc
f = @(x) -12-(21*x)+(18*x^2)-(2.75*x^3);
a=-1;
b=0;
p=a;
%Bisection Method
while (abs(f(p))>0.01)
p = (a+b)/2;
if f(p) == 0
break;
end
if f(a)*f(p)<0
b=p;
else
a = p;
end
end
fprintf('The final root through bisection method is %f\n',p);

%False Position Method
p=a;
while (abs(f(p))>0.01)
p = (a*f(b)-b*f(a))/(f(b)-f(a));
if f(p) == 0
break;
end
if f(a)*f(p)<0
b=p;
else
a = p;
end
end
fprintf('The final root through False Position method is %f\n',p);

Editor CUsers\SANTOSH\Documents\MATLAB\bis.m* X EDITOR PUBLISH VIEW Find Files Insert E fxF Run Section Compare Comment % NAV

Output:

The final root through bisection method is -0.414551

p =

-0.4150

The final root through False Position method is -0.414689
>>

Command Window The final root through bisection method is -0.414551 -0.4150 The final root through False Position method is -

-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

KINDLY UPVOTE THE ANSWER IF YOU LIKED IT, IT MOTIVATES US ?

FOR ANY QUERIES COMMENT BELOW.

-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

Add a comment
Answer #2

-12 - 21x + 18x2 - 2.75x3


Add a comment
Know the answer?
Add Answer to:
Problem 5, using Matlab MATLAR problem: Problem S: Determine the roots of f(x)=-12-21x+18r-2.75r with the methods...
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
  • 2) (15 points) a) Determine the roots of f(x)=-12 – 21x +18r? - 2,75x' graphically. In...

    2) (15 points) a) Determine the roots of f(x)=-12 – 21x +18r? - 2,75x' graphically. In addition, determine the first root of the function with b) bisection and c) false-position. For (b) and (c), use initial guesses of x, =-land x, = 0, and a stopping criterion of 1%. 3) (25 points) Determine the highest real root of f(x) = 2x – 11,7x² +17,7x-5 a) Graphically, b) Fixed-point iteration method (three iterations, x, = 3) c) Newton-Raphson method (three iterations,...

  • Problem 2 Determine the real roots of f(x)=-25 +82.x - 90x2 +44x-8x +0.7.x a) Graphically b)...

    Problem 2 Determine the real roots of f(x)=-25 +82.x - 90x2 +44x-8x +0.7.x a) Graphically b) Using bisection method to determine root (0.5, 1.0) 6 = 0.1 c) False position method, Use initial guesses of x=0.5 and x. -1.0 Compute the estimated errore, with stopping criteria 1%

  • w Required Information Consider the following function: $(x) = -12- 21x + 18x? - 2.75x je...

    w Required Information Consider the following function: $(x) = -12- 21x + 18x? - 2.75x je to and a stopping criterion of Determine a root of the given function using the bisection method. Use initial guesses of xy-1 and Xy - 1%. (Round the final answer to four decimal places.) References The root of the given function using the bisection method is .

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

  • please show answer in full with explanation, also show matlab 1. Consider the function f(x)2.753 +18r2 21 12 a) Plot...

    please show answer in full with explanation, also show matlab 1. Consider the function f(x)2.753 +18r2 21 12 a) Plot the graph of f(x) in MATLAB and find all the roots of the function f(x) graphically. Provide the code and the plot you obtained. b) Compute by hand the first root of the function with the bisection method, on the interval -1; 0) for a stopping criterion of 1% c) How many iterations on the interval -1, 0 are needed...

  • 3. Write a code to find 3 roots of the function f(x) 2r3-4x2 -22x +24 for the interval I-5, 5] co...

    3. Write a code to find 3 roots of the function f(x) 2r3-4x2 -22x +24 for the interval I-5, 5] considering the following methods a) Bisection Method b) Newton's Method Hint: Plot a graph of f(x) and determine proper intervals and initial guesses for a) and b), respectively. 3. Write a code to find 3 roots of the function f(x) 2x3-4x2 -22x +24 for the interval [-5, 5] considering the following methods a) Bisection Method b) Newton's Method Hint: Plot...

  • 3. Write a code to find 3 roots of the function f(x)-2x3-4x2-22x+24 for the interval -5, 5] consi...

    3. Write a code to find 3 roots of the function f(x)-2x3-4x2-22x+24 for the interval -5, 5] considering the following methods a) Bisection Method b) Newton's Method Hint: Plot agraph of f(x) and determine proper intervals and initial guesses for a) and b), respectively 3. Write a code to find 3 roots of the function f(x)-2x3-4x2-22x+24 for the interval -5, 5] considering the following methods a) Bisection Method b) Newton's Method Hint: Plot agraph of f(x) and determine proper intervals...

  • using matlab code please 5.2 Determine the real root of f(x) = 5x? - 5x2 +...

    using matlab code please 5.2 Determine the real root of f(x) = 5x? - 5x2 + 6x-2: a. Graphically. b. Using bisection to locate the root. Employ initial guesses of x= 0 and xy = 1 and iterate until the estimated error &, falls below a level of Es = 10%.

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

  • Numerical methods. Need help please 2. Determine the real rot of f(x)--26+85x-91x+44x -8xx a. Graphically. b....

    Numerical methods. Need help please 2. Determine the real rot of f(x)--26+85x-91x+44x -8xx a. Graphically. b. Using bisection method. Employ initial guesses of x-O and xu 1 and iterate until the approximate error falls below 10%. Perform the same computation using false-position method. Iterate until the approximate error falls below 0.2%. c.

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