laboratory 3 fixed-point

Post on 27-Sep-2015

222 Views

Category:

Documents

5 Downloads

Preview:

Click to see full reader

DESCRIPTION

kjfklajlfjaklfklj fwaefvpoi ppwo pwep io pajfkladjfr jljfio qrjf jfi jfoajfjojgaj fjfjapfojf jfdjfoaoj fjfiojfo jkfjaojf jfjofjaiojgla jfoajofjaojf jdfioad;fiorguhguhg hdjgfkjnvhgfsfkjegfh ghffjgfvoyudkdxc vsjfdkxv h.g jfdjbghjghjg c,vm ggghkjdk vggsjudfjdkjf

TRANSCRIPT

  • Gerfel Philip Gonzales BSECE 5

    Simple Fixed-point 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

top related