Download - Laboratory 4 Newton-raphson
Transcript
-
Gerfel Philip Gonzales BSECE 5
Newton-raphson Method
1 SCINOTE CODE
//Gerfel Philip C. Gonzales
//BSECE 5
//Laboratory 3
//Simple Fixed-point Method
function fixed_point()
f = input("Input the rearranged function to be evaluated:","string");
p0 = input("Input initial guess p0:");
es = input("Input your desired stopping criterion:");
maxiter = input("Maximum no. of iterations:");
disp(['Root Error'])
for iter = 1:maxiter;
x = p0;
p = evstr(f);
er = abs((p-p0)/(abs(p)+%eps));
printf('%8.4f %f\n',p,er);
//evaluation
if (er
-
Gerfel Philip Gonzales BSECE 5
2 SIMULATION
Find the root of + = with a approximation error of . and maximum number of
iteration of 100 starting with x = 0.75.
Rearranged =
.
2.1 CHOOSING A GUESS ROOT OF 0 .75