0% found this document useful (0 votes)
16 views6 pages

Problem Identification and Requirements Analysis

The document outlines the requirements for implementing the bisection method in Java, focusing on finding the root of a function within a specified interval. It details functional requirements such as function selection, cosine approximation, and methods for calculating absolute values, factorials, and powers. Additionally, it specifies non-functional requirements, including the need for manual implementation without libraries and convergence criteria for the bisection method.

Uploaded by

ELPAPU-HACKER oo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views6 pages

Problem Identification and Requirements Analysis

The document outlines the requirements for implementing the bisection method in Java, focusing on finding the root of a function within a specified interval. It details functional requirements such as function selection, cosine approximation, and methods for calculating absolute values, factorials, and powers. Additionally, it specifies non-functional requirements, including the need for manual implementation without libraries and convergence criteria for the bisection method.

Uploaded by

ELPAPU-HACKER oo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Problem identification and requirements analysis

Case Study : Bisection Method

Customer
Teacher

User Students who wish to perform the bisection method

. RF0:Function selection

. RF1:Cosine approximation

. RF2:Method for calculating absolute value

. RF3:Method for calculating a factorial


Functional
requirements . RF4:Method for power calculation
. RF5:Bisection method

Remember factorial validation, as it is defined for positive integers.

Context of the problem

In java language, the implementation is requested FROM ZERO, the bisection


method, which consists of finding the root, or solution, bisseces in an interval that
contains the root.

Its operation consists of only giving it a search interval that encapsulates the root
orsolution, the program will validate the interval within the function selected
by the user at the beginning and through a series of defined mathematical
processes, the result will be given at the end.

To choose the user has 3 functions, which are:

UN. f ( x )=2cos ( x 2)
2 2
B. f ( x )=3 +7 x +5

C. f ( x )=x cos ( x)

Non-functional . Your code must implement the operations required for these calculations. You
requirements cannot make use of libraries that have implemented mathematical functions.

. The condition f(a) * f(b) < 0 must be fulfilled(This means: the product of that
function evaluated in the values a and b, must be less than 0, in other words it must
always be negativor )

. In order to calculate the value of C defined as: c = (a + b) /2 with which it is


validated that if f (a) × f (c) < 0 then b = c and if not a = c, the above is repeated
until one of the convergence criteria is met.

. Convergence criteria:

1. The total number of iterations of the bisection must be known, with an N


value.

2. It must be validated that the absolute value of | c i−ci−1 | < e where e is a


tolerance value (Also called epsilon)

3. |f ( c i )| < must be validated and

. Testing Options

. For this work we must use the approximate definition of the cosine function
which is:

Only applies to magnitudes in radians.

Iidentifier and name RF0: Function Selection

The code will show on screen 3 different functions, The user must choose
one of the 3 functions, for that, he will be asked to enter a number from 1
to 3 ("1 for and 3 for
Summary f ( x )=2cos ( x2 ) , 2 para f ( x )=32 +7 x 2+5 f ( x )=x cos ( x) "). The
system must validate if the type of data entered, corresponds to the
function you want to select, if the data is not correct, an error message
will be displayed on the screen.

Entry name Data type Valid values condition

inputs The selected function


Function Int must be one of those
available

Result or Postcondition If the data entered by the user is correct, the system will continue with the
calculation process in the bisection method.

Output name Data type Format

Outputs Pop-up message


conditionNotValid Rope saying "Incorrect
data(s)"

Iidentifier and name RF1: Cosine approximation

The system should calculate the cosine of x through the Taylor series.
Summary

Entry name Data type Valid values condition


inputs
x Int Cosine argument value

Result or Postcondition The system will return the approximate value of the cosine function

Output name Data type Format


Outputs
Cos(x) Int N/A

Iidentifier and name RF2: Method for calculating Absolute Value

Summary The system shall calculate the absolute value of x

Entry name Data type Valid values condition


inputs
x double Expression value

Result or Postcondition The system returns the absolute valor of x

Output name Data type Format


Outputs
x double Result

RF3: Method for calculating a factorial


Iidentifier and name

The system must calculate the factorial of x, taking into account that this only
Summary
applies to positive integers.

inputs Entry name Data type Valid values condition

x Int Positive integer


Result or Postcondition The factorial of x is calculated

Output name Data type Format


Outputs
x! Int Factorial

RF4: Method for power calculation


Iidentifier and name

The system shall calculate the power of an expression from 2 values X


Summary
(Power Base) and Y (Power Exponent)

Entry name Data type Valid values condition


inputs
x double Power base

and Int Exponent of power

Result or Postcondition The power is calculated and the result of this is returned.

Output name Data type Format


Outputs
x^y Int Power

RF5: Bisection Method


Iidentifier and name

From the function that the user chose, the system must calculate the root or
solution of f(x). To prompt the user for a search interval that encapsulates
Summary the actual root of the function. If the entered range does not match the type
of data being requested, an error message must be sent. (one of the 3
convergence criteria must be selected)

Entry name Data type Valid values condition


inputs First interval(Must be a
intervalA Int
number)

Second interval (Must be


rangeB Int
a number )

If the data entered is correct, the system will calculate the root of the function
Result or Postcondition
entered by the user.

Outputs Output name Data type Format


AproxRaizX double N/A

Pop-up message
conditionNotValid Rope saying "the data
enteredis not valid"

You might also like