Professional Documents
Culture Documents
Use bisection to determine the maximum of this function. Employ initial guesses of x l=0 and x u=1, and
perform iterations until the approximate relative error falls below 5%.
This problem performs the Bisection Method to find the maximum of a given function and then plots the
function along with the estimated maximum.
Use false-position iterations to determine the maximum of this function. Employ initial guesses of x l=0 and
x u=1, and perform iterations until the approximate relative error falls below 5%.
This problem performs the False-Position Method to find the maximum of a given function and then plots the
function along with the estimated maximum.
Initialize:
xl = 0
xu = 1
i=1
Check if i >
max Iterations
Yes
Compute:
xr = xu - (f(xu) * (xl - xu)) / (f(xl) - f(xu))
Update:
if f(xr) > 0
Compute:
No xu = xr
Relative Error = |(xr - xprev) / xr|
else
xl = xr
Yes
END