You are on page 1of 5

KONKAN GYANPEETH COLLEGE OF ENGINEERING, KARJAT.

Department Of Science And Humanities


Scilab Practical 1
Class: - F.E

DOD: 25/07/13

Sem: -

DOP:

Subject: - Applied Maths I

Academic Year- 2013-14

Solve the following system of equations by Gauss elimination by using Scilab:


10x-3y+6z=24.5
x+8y-2z=-10
-2x+4y-9z=-50
Scilab Program:
A=[10 -3 6; 1 8 -2; -2 4 -9]
B=[24.5; -10; 50]
D=[A B]
R1=D(1,:)
R2=D(2,:)
R3=D(3,:)
R1=R1/10
R2=R2-R1
R3=R3+2*R1
D=[R1; R2;R3]
R2=R2/8.3
R3=R3-3.4*R2
D=[R1; R2;R3]
R3=R3/-6.7349398
D=[R1; R2;R3]
linsolve(A,-B)

KONKAN GYANPEETH COLLEGE OF ENGINEERING, KARJAT.


Department Of Science And Humanities
Scilab Practical 2
Class: - F.E

DOD: 25/07/13

Sem: -

DOP:

Subject: - Applied Maths I

Academic Year- 2013-14

Solve the following system of equations by Gauss Jordan Method by using Scilab:
x+y+z=9
2x - 3y + 4z = 13
3x + 4y + 5z = 40

Scilab Program:

A=[1 1 1; 2 -3 4; 3 4 5]
B=[9; 13; 40]
D=[A B]
rref(D)

KONKAN GYANPEETH COLLEGE OF ENGINEERING, KARJAT.


Department Of Science And Humanities
Scilab Practical 3
Class: - F.E

DOD: 25/07/13

Sem: -

DOP:

Subject: - Applied Maths I

Academic Year- 2013-14

Solve the following system of equations by Gauss Siedel by using Scilab:


27x+6y-z=85
6x+15y+2z=72
x+y+54z= 110

Scilab Program:
A=[27 6 -1; 6 15 2; 1 1 54]
B=[85; 72; 110]
i=[3.15; 3.54; 1.91]
for j= 1:5
x1=((B(1)-A(1,2)*i(2))-(A(1,3)*(i(3))))/A(1,1);
i(1)= x1;
x2=((B(2)-A(2,1)*i(1))-(A(2,3)*(i(3))))/A(2,2);
i(2)= x2;
x3=((B(3)-A(3,1)*i(1))-(A(3,2)*(i(2))))/A(3,3);
i(3)= x3;
end
disp(i);

KONKAN GYANPEETH COLLEGE OF ENGINEERING, KARJAT.


Department Of Science And Humanities
Scilab Practical 4
Class: - F.E

DOD: 25/07/13

Sem: -

DOP:

Subject: - Applied Maths I

Academic Year- 2013-14

Fit a straight line to the following data


X
Y

10
1

20
3

Scilab program:
X=[10,20,30,40,50,60]
Y=[1,3,5,10,6,4]
n= size(X)
sx=sum(X)
sy=sum(Y)
sxy=sum(X.*Y)
sx2=sum(X^2)
n=6
A=[n sx; sx sx2]
B=[sy; sxy]
linsolve(A,-B)

30 40 50
5 10 6

60
4

KONKAN GYANPEETH COLLEGE OF ENGINEERING, KARJAT.


Department Of Science And Humanities
Scilab Practical 5
Class: - F.E

DOD: 25/07/13

Sem: -

DOP:

Subject: - Applied Maths I

Academic Year- 2013-14

Fit a parabola to the following data:


X
Y

1
25

2
28

3
33

4
39

5
46

Scilab program:
X=[1,2,3,4,5]
Y=[25,28,33,39,46]
n= size(X)
n=5
sx=sum(X)
sy=sum(Y)
sxy=sum(X.*Y)
sx2=sum(X^2)
sx3=sum(X^3)
sx4=sum(X^4)
sx2y=sum((X^2).*Y)
A=[n sx sx2; sx sx2 sx3; sx2 sx3 sx4]
B=[sy; sxy; sx2y]
linsolve(A,-B)

You might also like