0% found this document useful (0 votes)
16 views34 pages

Ba Santa

I want to download the document

Uploaded by

Rahul Dev Mondal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views34 pages

Ba Santa

I want to download the document

Uploaded by

Rahul Dev Mondal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

(CORE COURSE-1)

MATHEMATICAL PHYSICS
(SCILAB)
SESSION – 2022-23

NAME:- BASANTA PANGI


EXAMINATION ROLL NUMBER :- 2233187
UG 1ST SEMESTER
1|Page
EXPERIMENT NUMBER……….. DATE……………………….

INDEX
SL
NO. NAME OF THE EXPERIMENT PAGE DATE OF DATE OF REMARK
NO. EXPRIMENT SUBMISSION

2|Page
EXPERIMENT NUMBER……….. DATE……………………….

EXPERIMENT-1

3|Page
EXPERIMENT NUMBER……….. DATE……………………….

4|Page
EXPERIMENT NUMBER……….. DATE……………………….

5|Page
EXPERIMENT NUMBER……….. DATE……………………….

6|Page
EXPERIMENT NUMBER……….. DATE……………………….

Q.1 FIND THE VALUE OF 25 /25-1.


CODE:-
-->(2^5)/((2^5)-1)

OUTPUT:-
ans = 1.0322581

Q.2 FIND THE VALUE OF 3*((√5-1)/(√5-1)-1)


CODE:-
--> (3*(sqrt(5)-1))/((sqrt(5)-1)^2)

OUTPUT:-
ans = 2.427051

Q.3 FIND THE VALUE OF e5

CODE:-
--> (%e)^3

OUTPUT:-
ans =20.085537

Q.4 FIND THE VALUE OF eπ√163

CODE:-
--> (%e)^(%pi*sqrt(163))

OUTPUT:-
ns =2.625Da

Q.5 FIND THE VALUE OF sin(π/16)


CODE:-
--> sin(%pi/16)

OUTPUT:-

ans =

7|Page
EXPERIMENT NUMBER……….. DATE……………………….

0.1950903

Q.6 FIND THE VALUE OF (cos(π/6))2 +(sin(π/6))2

CODE:-
--> ((cos(%pi/6)^2))+((sin(%pi/6)^2))

OUTPUT:-
ans =1

Q.7 FIND THE VALUE OF tan(π/2)


CODE:-
--> tan(%pi/2)

OUTPUT:-
ans =1.633D+16

Q.8 FIND THE VALUE OF 1+3i/1-3i


CODE:-
--> (1+(3*%i))/(1-(3*%i))

OUTPUT:-
ans = -0.8 + 0.6i

Q.9 FIND THE VALUE OF ei* CODE:-


--> (%e)^((%i*%pi)/4) OUTPUT:-
ans =0.7071068 + 0.7071068i

Q.10 FIND THE VALUE OF log55


CODE:-
--> log(5^5)

OUTPUT:
8.0471896

8|Page
EXPERIMENT NUMBER……….. DATE……………………….

Q.11 FIND THE VALUE OF 2sin(cos50π)

CODE:-
--> 2*(sin(cos(50*%pi)))

OUTPUT:-
ans =1.682942

Q.12 FIND THE VALUE OF 17π+6i/(18)63


CODE:-
--> ((17*%pi)+(6*%i))/(18^63)
OUTPUT:-
ans = 0.

Q.13 FIND THE VALUE OF R=8.75


--> R=8.75
R = 8.75
CODE:-
--> A=(%pi*(R^2))
OUTPUT:-
A = 240.52819

BASANTA PANGI
ROLL NO-2233187

9|Page
EXPERIMENT NUMBER……….. DATE……………………….

EXEPERIMENT-2
WORKING WITH MATRIX

10 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

OPEEATION ON MATRIX

Q.1 Generated matrix A & B

CODE:-
--> A=[1 2 3;0 -1 6; 9 -3 5]

Output:
A = 1. 2. 3.
0. -1. 6.
9. -3. 5.

CODE:-
--> B=[3 0 1; 3 2 1; 4 5 3]

OUTPUT:
B = 3. 0. 1. 3. 2. 1.
4. 5. 3.

Q.2 Addition of two matrices A & B

CODE:- -->
J=A+B

OUTPUT:
J = 4. 2. 4.
3. 1. 7.
13. 2. 8.
Q.3 Substraction of two matrices A & B

CODE:- -->
K=A-B

OUTPUT:
K = -2. 2. 2.
-3. -3. 5.
5. -8. 2.
Q.4 Division of two matrices A & B

CODE:- -->

L=A/B

11 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

OUTPUT:
L = 1.2 -3. 1.6
4.7 -9.5 3.6
5.9 -4.5 1.2

Q.5 Transpose of matrices

CODE:- -->
T=A’

OUTPUT'
T = 1. 0. 9.
2. -1. -3
3. 6. 5

CODE:- --> R=B'

OUTPUT:
R = 3. 3. 4.
0. 2. 5.
1. 1. 3.

Q.6 To find determinant of matrices.

CODE:- -->
M=det(A)

OUTPUT:
M = 148.

CODE:- -->
N=det(B)
OUTPUT:
N = 10.

Q.7 To find square of matrices AA2*A OR A^2

12 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

CODE:- -->
O=A^2

OUTPUT:
O = 28. -9. 30.
54. -17. 24.
54. 6. 34.

Q;8 To find inverse of matrix

CODE:- -->
P=inv(A)

OUTPUT:
P = 0.0878378 -0.1283784 0.1013514
0.3648649 -0.1486486 -0.0405405
0.0608108 0.1418919 -0.0067568

Q.9 To find trace of the matrix ‘A’

CODE:-
--> Q=trace(A)

OUTPUT:
Q = 5.

Q.10 Eigen value

Q.11 Spece(A)

CODE:-
--> spec(A)

13 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

OUTPUT:
ans = 8.3320448
-1.6660224 + 3.8713197i
-1.6660224 - 3.8713197i

Q.12 To find size of matrix

CODE:-
--> size(A)

OUTPUT:
ans = 3.

BASANTA PANGI
ROLL NO - 2233187

14 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

EXPERIMENT 3
PLOTTING OF 2D GRAPH

15 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

Q.1 PLOTTING OF y=sinx

CODE:-
clc;clear;clf; x=0:0.02:20;
//difine x y=sin(x); //given
function plot(x,y,'r'); //plotting
command
xlabel('x');
ylabel('y');
title('plotting of sinx by BASANTA PANGI’)

OUTPUT:
BASANTA PANGI

Q.2 PLOTTING OF y=cosx

CODE:-
clc;clear;clf; x=0:0.1:5*%pi;
//define x y=cos(x); //given
function plot(x,y,'r'); //plotting
command
xlabel('x');
ylabel('y');
title('plotting of cosx by BASANTA PANGI’)

16 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

OUTOUTPUT:
BASANTA PANGI

Q3 PLOTTING OF y= tanx

CODE:-
clc;clear;clf;
x=0:0.02:2*%pi; //define x
y=tan(x); //given function
plot(x,y,'r'); //plotting command
xlabel('x');
ylabel('y');
title('plotting of tanx by BASANTA PANGI’)

17 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

OUTPUT:-
BASANTA PANGI

Q.4 PLOTTING OF sqrt(x)

CODE:-
clc;clear;clf; x=0:0.02:20;
//define x y=sqrt(x); //given
function plot(x,y,'r'); //plotting
command
xlabel('x');
ylabel('y');
title('plotting of sqrt(x) by BASANTA PANGI’)

18 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

OUTPUT:-
BASANTA PANGI

Q.5 PLOTTING OF sin(x),cos(x) & sqrt(x)

CODE:-
clc;clear;clf;
x=1:0.1:30
y1=sin(x) y2=cos(x)
y3=sqrt(x)
plot(x,y1,x,y2,x,y3)
legend('y1','y2','y3')
title('plotting of sin(x),cos(x)&sqrt(x) by BASANTA PANGI’)

19 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

OUTPUT:-
BASANTA PANGI

BASANTA PANGI
ROLL NO: 2233187

20 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

EXPERIMENT 4
PLOTTING OF 3D GRAPH

Q.1 PLOTTING OF 3D GRAPH Z=X*Y


CODE:-
clc;clear;clf;
x=[0:10]'
y=[0:10]' z=x*y'
plot3d(x,y,z)
title('poting of z=x*y by BASANTA PANGI’)

OUTPUT:-
BASANTA PANGI

21 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

Q.2 PLOTTING THE 3D GRAPH OF Z=SIN(T)*COS(T’)

CODE:-
clc;clear;clf;
t=[0:0.3:2*%pi]'
z=sin(t)*cos(t')
plot3d(t,t',z)
title('plotting the 3d graph of sin(t)*cos(t) by BASANTA PANGI’)

OUTPUT:-
BASANTA PANGI

22 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

Q.3 PLOTING THE 3D GRAPH OF Z=FEVAL(X,Y,Z)

CODE:-

clc;clear;;clf; function
z=f(x, y)
z=2*x^2+y^2;
endfunction
x=linspace(-1,1,100);
y=linspace(-1,2,200);
z=feval(x,y,f)';
clf surf(x,y,z)
title('plotting the 3d graph of z=feval(x,y,z) by BASANTA PANGI’)

OUTPUT:-
BASANTA PANGI

23 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

Q.4 PLOTING THE GRAPH OF BAR(X,N)

CODE:-
clc;clear;clf;
x=[1:10];
n=[8,6,13,10,6,4,16,7,8,5];
clf bar(x,n)
title('plotting the 3d graph of bar(x,n) by BASANTA PANGI’)

OUTPUT:-
BASANTA PANGI

BA

BASANTA PANGI
ROLL NO: 2233187

24 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

EXPERIMENT NO: 5
WORKING WITH LOOP, BRANCHES AND
CONTROLFLOW

25 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

Q.1

CODE:-
clc;clear; if(6>5)
mprintf("Basanta")
end

OUTPUT:-

Basanta

Q.2

CODE:- clc;clear
26 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

a=input("enter a=")
b=input("enter b=")
if(a>b)
mprintf("%d is greater",a)
else
mprintf("%d is greater",b)
end

OUTPUT:- enter
a=6 enter b=9
9 is greater

Q.3

27 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

CODE: clc;clear a=input("enter a=")


b=input("enter b=")
c=input("enter c=")
if(a>b)
if(a>c)

mprintf("%d is greater",a)
else
mprintf("%d is greater",c)
end
else
if(b>c)
mprintf("%d is greater",b)
else
mprintf("%d is greater",c)
end
end
OUTPUT:-
enter b=60
enter c=25
60 is greater

Q.4

28 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

CODE:-
clc;clear;

mark=input("enter mark=")
if(mark<=100)
if(mark>79)
mprintf("nonour")
else
if(mark>59)
mprintf("1st division");
else
if(mark>49)
mprintf("2nd division");
else
if(mark>39)
mprintf("3rd division");
29 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

else
if(mark>0)
mprintf("fail");
end
end
end
end
end
end

OUTPUT:-
enter mark=80
honour
enter mark=60
1st division
Enter mark=45
2nd division
Enter mark=35
3rd division
enter mark=0
fail

Q.5

30 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

CODE:- clc;clear;
a=input("enter a=")
b=input("enter b=")
choice=input("enter choice")
select choice

case 1
result=a+b;
case 2
result=a-b;
case 3
result=a*b;
case 4

31 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

result=a/b;
else
printf("wrong input")
end
mprintf("result=%d",result)

OUTPUT:-
enter a=7
enter b=8
enter choice1
result=15
enter a=6
enter b=5
enter choice2
result=1
enter a=9
enter b=3
enter choice4
result=27
enter a=8
enter b=4
enter choice4
result=2

BASANTA PANGI
ROLL NO: 2233187

32 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

33 | P a g e
EXPERIMENT NUMBER……….. DATE……………………….

34 | P a g e

You might also like