Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

MACHINE PROBLEM 2.

1
Name
(Modified) Secant Method
Make a function file that solves the given function below given a value for x.

9.81
9.81(0.25)
tanh ( 4
) 36
0.25

Create a function file that determines the approximated root of the given function above. The function file must
invoke the previously made function file that contains the given function.
Input Arguments: (function, initial guess, perturbation factor, desired tolerance)
Output Arguments: approximated root of function
Note: There should also be screen output of the iteration number, value of approximated root and tolerance after every
iteration
Use the following input values to test the code:
Initial guess: 140
Perturbation factor: 0.000001
Desired tolerance: 0.05
Simpsons 1/3 Rule
Make a function file that solves the given function below given a value for t.

() =

9.81(68.1)
9.81(0.25)
(
)
0.25
68.1

Determine the distance travelled by a free-falling bungee jumper in the first 3 seconds if his velocity is given by the
function above.
Create a function file that can numerically integrate the given function using Simpson's 1/3 Rule. The function file must
invoke the previously made function file that contains the given function. Note that you may only use an even number of
segments and the minimum number of segments is 2. You cannot use the formula for the Composite Simpson's 1/3 Rule
in your code. The formula you may use per segment is
= ( )
Output: Approximate value of definite integral
Inputs: function
lower limit "a"
upper limit "b"
number of segments "n"

(0 ) + 4(1 ) + (2 )
6

You might also like