Sabtu, 08 Oktober 2011

0 Metode Modifikasi Iterasi


#include
#include
#include
#include
#include
//model iterasi tanpa ada nilai alpha
float Xn, e, t, gxn,  x2;
void garis(){
cout<<"---------------------------------\n";
}
int lanjut2(float gXn){
clrscr();
garis();
cout<<"iterasi\tXn\tgXn\t”;
cout<<”|Xn - g(Xn)|<="<<<"\n";
t = 0; garis();
do {
if (t == 0){Xn = gXn;
}
else  {Xn = x2;
}
gXn= (pow(Xn, 2) + 8)/6;
cout<<<"\t"<<<"\t"<
cout<<"\t"<<<"\n";
if (fabsl(Xn - gXn) >= e) {   t++; 
}
            x2 = (gXn-(Xn*gxn)) / (1-gxn);
            } while (fabsl(Xn - gXn) >= e); garis();
 cout<<"\n\n\n\nIterasi berhenti pada iterasi ke"; cout<<<"\nDengan solusi: "<
            cout<<"\nDan Xn - gXn: "<
            return 0;
}

void main(){
            int o;
clrscr();
            cout<<"Masukkan Xo: ";
            cin>>o;
            cout<<"Masukkan E : ";
            cin>>e;
            gxn = (1/3) * o;
            if (gxn >= 1.0 || gxn <= -1.0){
            cout<<"Divergen, iterasi tidak diproses";
}
            else {
            lanjut2(o);
}
            getch();
}

About the Author

I'm Author description here. Go to Blogger edit html and find these sentences. Now replace these sentences with your own descriptions. Subscribe to Our Feed and Follow Me on Twitter My user

    Other Recommended Posts

0 komentar:

Posting Komentar

 
back to top