Anda di halaman 1dari 15

clc

clear all
format rat
disp('iterasi jacobi')
c=input('Masukkan Besar Matriks : ');
fprintf('MATRIKS A dengan ukuran %d x %d',c,c);
disp(' ');
for i=1:c;
for j=1:c;
fprintf('A(%d,%d)',i,j);
A(i,j)=input('=');
end
end
fprintf('MATRIKS B dengan ukuran %d x 1\n',c);
for i=1:c;
fprintf('B(%d,1)',i);
B(i,1)=input('=');
end
M=[A,B]
disp('');
fprintf('Tebakan awal dengan ukuran %d x 1\n',c);
for i=1:c;
fprintf('x0(%d,1)',i);
x0(i,1)=input('=');
end
disp('');
e=input('Masukkan Besar galat: ');
eh=1; %misal
iterasi=1;
n= size(A,1);
p=zeros(n,n);
for i=1:n
for j=1:n
if j ~= i
p(i,j)=A(i,j)/A(i,i);%elemen dari matrks inv(D)*(D-A)
end
end
Q(i)=B(i)/A(i,i);%elemen dari matriks inv(D)*B
end
norma=1;%misalkan
while norma > e
x= Q' - p*x0;
norma= max(abs(x-x0));
x0=x;
end
x

clc
clear all
format rat;
disp('iterasi gauss-seidel')
c=input('Masukkan Besar Matriks: ');
fprintf('MATRIKS A dengan ukuran %d x %d',c,c);
disp(' ');
for i=1:c;
for j=1:c;
fprintf('A(%d,%d)',i,j);
A(i,j)=input('=');
end
end
fprintf('MATRIKS B dengan ukuran %d x 1\n',c);
for i=1:c;
fprintf('B(%d,1)',i);
B(i,1)=input('=');
end
M=[A,B]
fprintf('Tebakan awal dengan ukuran %d x 1\n',c);
for i=1:c;
fprintf('x0(%d,1)',i);
x0(i,1)=input('=');
end
disp('');
e=input('Masukkan Besar galat: ');
eh=1; %misal
iterasi=1;
n= size(A,1);

x=x0;
norma=1;%misalkan
while norma>e
x(1,:)=(B(1)-A(1,2:n)*x(2:n,:))/A(1,1);
for i= 2:n-1
tmp=B(i,:)-A(i,1:i-1)*x(1:i-1,:)-A(i,i+1:n)*x(i+1:n,:);
x(i,:)=tmp/A(i,i);
end
x(n,:)=(B(n,:)-A(n,1:n-1)*x(1:n-1,:))/A(n,n);
norma= max(abs(x-x0));
x0=x;
end
x

clc
clear all
format rat
disp('iterasi jacobi')
c=input('Masukkan Besar Matriks : ');
fprintf('MATRIKS A dengan ukuran %d x %d',c,c);
disp(' ');
for i=1:c;
for j=1:c;
fprintf('A(%d,%d)',i,j);
A(i,j)=input('=');
end
end
fprintf('MATRIKS B dengan ukuran %d x 1\n',c);
for i=1:c;
fprintf('B(%d,1)',i);
B(i,1)=input('=');
end
M=[A,B]
disp('');
fprintf('Tebakan awal dengan ukuran %d x 1\n',c);
for i=1:c;
fprintf('x0(%d,1)',i);
x0(i,1)=input('=');
end
disp('');
e=input('Masukkan Besar galat: ');
eh=1; %misal
N=1000;%misal
H=x0';
n=length(B);
x1=x0;
for k= 1:N
for i=1:n
s=B(i)-A(i,[1:i-1,i+1:n])*x0([1:i-1,i+1:n]);
x1(i)=s/A(i,i);
end
g=abs(x1-x0);
err=norm(g);
relerr=err/(norm(x1)+eps);
x=x1;
H=[H;x0'];
if (err<e)|(relerr<e);break;
end
end
x=inv(A)*B;
x

clc
clear all
format rat;
disp('iterasi gauss-seidel')
c=input('Masukkan Besar Matriks: ');
fprintf('MATRIKS A dengan ukuran %d x %d',c,c);
disp(' ');
for i=1:c;
for j=1:c;
fprintf('A(%d,%d)',i,j);
A(i,j)=input('=');
end
end
fprintf('MATRIKS B dengan ukuran %d x 1\n',c);
for i=1:c;
fprintf('B(%d,1)',i);
B(i,1)=input('=');
end
M=[A,B]
fprintf('Tebakan awal dengan ukuran %d x 1\n',c);
for i=1:c;
fprintf('x0(%d,1)',i);
x0(i,1)=input('=');
end
disp('');
e=input('Masukkan Besar galat: ');
eh=1; %misal

N=1000;%misal
H=x0';
n=length(B);
x1=x0;
for k= 1:N
for i=1:n
s=B(i)-A(i,1:i-1)*x0(1:i-1)-A(i,i+1:n)*x0(i+1:n);
x1(i)=s/A(i,i);
end
g=abs(x1-x0);
err=norm(g);
relerr=err/(norm(x1)+eps);
x=x1;
H=[H;x0'];
if (err<e)|(relerr<e);break;
end
end
x1

Tugas
BAHASA INGGRIS SAINS

OLEH :

NAMA

: WA ODE NOFIDINARSI

STAMBUK

: F1A1 15 072

KELAS

:B

PROGRAM STUDI MATEMATIKA


JURUSAN MATEMATIKA
FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM
UNIVERSITAS HALU OLEO
KENDARI
2016
What a new mathematics and what can you do with mathematics ?
Answer :
As mathematical experts are in demand across all kinds of industries, the
world over. Study math and youll have access to career opportunities in sectors
you may never have even considered, including specialized fields such as in law
or medicine. That said, a large number of math careers are still based within
business or science and technology-related sectors, with math graduates
occupying roles such as accountant, actuary, statistician, technician, economist or
market researcher.

Careers in accountancy and finance


A career path spanning many industries, accountancy offers a range of
choices for math degree graduates. Accountancy jobs include roles such as
auditor, tax accountant, forensic accountant, management accountant and

corporate advisor. To become a chartered accountant, in addition to an


undergraduate degree in mathematics or a related area, youll also need to gain
further professional qualifications. Often, however, if you start at a company
as a trainee in this field, your employer will help you gain both the experience
and the professional certification needed to develop in your role.

Careers in banking
Opportunities in banking range from the world of retail banking to
corporate investment banking. Both arenas deal with financial assessment
public and private with opportunities to specialize in areas such as mergers
and acquisitions, bonds and shares, privatization, lending and IPOs (initial
public offerings). Duties can include market research, creating new business
opportunities, and developing financial models and solutions to present to
clients. Math careers in banking can be lucrative, but again, professional

qualifications in finance will be needed for some roles.


Actuarial careers
As an actuary, you will be evaluating financial risk in order to manage
and advise clients. Combining risk analysis skills with in-depth knowledge of
economics and business, actuaries are at the heart of business strategy,
ensuring sound investments are made and commercial/business goals fulfilled.
New actuaries will most likely be working within pensions and insurance, a
relatively low-risk area, while in the future you may get to work in banking,
healthcare or investment. Actuarial roles can be client-facing, as with
consultancies and pensions/insurance companies, and all actuaries will require
the skill of communicating complex data and analyses to non-specialists.

Statistician careers
Statisticians are specialists in statistics that is, the collation, analysis,
interpretation and presentation of statistics and quantitative data. Statisticians
skills are required in numerous industries, ranging from healthcare to
government and from finance to.

Anda mungkin juga menyukai