Write a program that solves a nonlinear equation f(x) = 0 using one of closed domain methods %3D that we discussed in class (bisectional, false position). Your code can be written from scratch,

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Write a program that solves a nonlinear equation f(x) = 0 using one of closed domain methods
that we discussed in class (bisectional, false position). Your code can be written from scratch,
Transcribed Image Text:Write a program that solves a nonlinear equation f(x) = 0 using one of closed domain methods that we discussed in class (bisectional, false position). Your code can be written from scratch,
Expert Solution
Step 1

Solution:

Note: A Java program for nonlinear f(x)=0 using bisectional closed domain method.

considering the f(x)=x2-3 Therefore the equation we consider is  x2-3=0 for the interval {0...4}

Program Approach:

  • create a class
  • Define main method
  • initialize arbitrary variable epsilon as static double final double epsilon = 0.00001;
          double a, b, m, y_m, y_a
  •  initialize interval a,b as 0,4 and declare the variable m as the midpoint as double.
          a = 0;  b = 4;
  • Using While condition  find the midpoint and  perform the Bisection method as follows:

Bisectional method:

  • The Bisection Method contains an initial interval [a..b] that has a root
    (To find the initial  interval we use the property f(a) ≠ sign of f(b))
  • In this Method we will divide the interval into 2 halves and check that which half interval has a root of the function.
  • In this Method we will divide the interval into 2 halves and check that which half interval has a root of the function
  • The the interval is divided in halves till interval is extremely small.
  • The root will be approximately  equal to the obtained final interval.
  • Finally the Approximate solution contains the roots  value.

 

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY