Professional Documents
Culture Documents
Tugas Metode Numerik: Sekolah Tinggi Manajemen Informatika Dan Komputer Indonesia Mandiri BANDUNG 2010
Tugas Metode Numerik: Sekolah Tinggi Manajemen Informatika Dan Komputer Indonesia Mandiri BANDUNG 2010
Tugas Metode Numerik: Sekolah Tinggi Manajemen Informatika Dan Komputer Indonesia Mandiri BANDUNG 2010
METODE NUMERIK
DIKERJAKAN OLEH :
E-mail: Info@stmik-im.ac.id
Metode Setengah Selang Hasil Run f(x) = 5x3 - 3x5
main(){
setengahSelang(0.0001,0.0,-2.5);
getch();
return 0;
}
Metode Setengah Selang Hasil Run f(x) = ex - 5x2
main(){
setengahSelang(0.0001,0.0,-2.5);
getch();
return 0;
}
Metode REGULA FALSI Hasil Run f(x) = 5x3 - 3x5
main(){
regulaFalsi(0.0001,0.0,-2.5);
getch();
return 0;
}
Metode REGULA FALSI Hasil Run f(x) = ex - 5x2
main(){
regulaFalsi(0.0001,0.0,-2.5);
getch();
return 0;
}
Metode NEWTON RAPHSON Hasil Run f(x) = 5x3 - 3x5
// fungsi asli
double hasilFungsi(double x){
return exp(x) - 5*x*x;
}
// fungsi turunannya
double hasilFungsi1(double x){
return exp(x) - 10*x;
}
main(){
jacobi(1.0,1.0,1.0);
getch();
return 0;
}
EULER n xn yn err
#include <iostream.h> 0 0.00000000 1.00000000 0.00000000
#include <iomanip.h> 1 0.20000000 1.24000000 -0.00280552
#include <math.h> 2 0.40000000 1.56800000 -0.01564940
#include <stdio.h> 3 0.60000000 2.00160000 -0.04263760
#include <conio.h> 4 0.80000000 2.56192000 -0.08916186
double f(double x, double y) 5 1.00000000 3.27430400 -0.16225966
{
return x+y;
}
main()
{
double x, y, h;
int n;
x=0.0;
y=1.0;
h=0.2;
n=0;
cout<<" n xn yn
err"<<endl;
do {
cout<<setw (4)<<n<< setiosflags ( ios
::showpoint |ios::fixed)
<<setprecision(8)<<setw(15)<<x
<<setw(15)<<y<<setw(15)<<(y-(2*exp(x)-x-
1))<<endl;
x=x+h;
y=y+h*f(x,y);
n++;
}
while (x<=1.0001);
getch();
}
if(n){
return y[0][n-1]*polinom(xx,x,n-
1)+hasil(xx,y,x,n-1);
}
else return 0;
main(){
int i,n,j;
printf("Masukan banyaknya data yang akan di
input : ");
scanf("%d", &n);
double x[n],y[n][n],xx;
printf("\nx\tf(x)\n");
for(i=0;i<n;i++){
scanf("%lf %lf", &x[i],&y[i][0]);
}
for(j=1;j<n;j++){
for(i=0;i<n;i++){
y[i][j] = (y[i+1][j-1]-y[i]
[j-1])/(x[i+j]-x[i]);
}
}
printf("\nMasukan data yang ingin dicari : ");
scanf("%lf", &xx);
getch();
return 0;
}