You are on page 1of 26

CORE PAPER-V LAB

Mathematical Physics-II Lab


Experiment 1:
1. Each experiment content be designed as follows :
i. Aim of the Experiment: To find resistance of a conductor using Ohm's Law in
scilab.
ii. Learning objectives of the experiment
iii. Requirements a) A PC/laptop.
b)Scilab 6.0.0 must be installed.
2. Theory or principle of the experiment: At constant temperature the potential
difference between two ends of a conductor is directly proportional to the current
flowing in it.

V𝞪I
V=RI , R=constant
where, V=P.D
I=current
R=resistance

3. Procedure:
1. Switch on your PC/laptop.
2. Go to all programs & open scilab 6.0.0.
3. Go to Scinotes.
4. Write the coding/program.
5. Save the file & use extension name .sci
6. Then execute & go to the scilab console window for output.
7. Write R=(30,5) in the scilab console window.
8. Press enter to get the output.

CODING:
function R=R(V, I)
R=V/I;
end
4. Observations:

OUTPUT:

R(30,5)
ans =

5. Conclusion:
6. Precautions or limitations:
7. Learning outcomes :

Experiment 2:

1. Aim of the Experiment: To verify Hooke's law of elasticity using scilab.


2. Learning objectives of the experiment
3. Requirements a) A PC/laptop.
b)Scilab 6.0.0 must be installed.
4. Theory or principle of the experiment:
Hooke's law states that for relatively small deformation of an object the size or
displacement of deformation is directly proportional to the deforming force or load.

F 𝞪 x
⇒ F= k x
⇒ k= F/x
Where k= spring constant & depends on the kind of materials, its dimension & shape.
5. Procedure:

1. Switch on your PC/laptop.


2. Go to all programs & open scilab 6.0.0.
3. Go to Scinotes.
4. Write the coding/program.
5. Save the file & use extension name .sci
6. Then execute & go to the scilab console window for output.
7. Write k=spring(30,5) in the scilab console window.
8. Press enter to get the output.

CODING:
6. Observations:

OUTPUT:

7. Conclusion:
8. Precautions or limitations:
9. Learning outcomes :

Experiment 3:

1. Aim of the Experiment: To find the area of a circle using scilab.


2. Learning objectives of the experiment
3. Requirements a) A PC/laptop.
b)Scilab 6.0.0 must be installed.
4. Theory or principle of the experiment:

The area of a circle having radius 'r' is given by


A=πr2

5. Procedure:

1. Switch on your PC/laptop.


2. Go to all programs & open scilab 6.0.0.
3. Go to Scinotes.
4. Write the coding/program.
5. Save the file & use extension name .sci
6. Then execute & go to the scilab console window for output.
7. Write a=area(2) in the scilab console window.
8. Press enter to get the output.

CODING:

6. Observations:

OUTPUT:
7. Conclusion:
8. Precautions or limitations:
9. Learning outcomes :

Experiment 4:

1. Aim of the Experiment: To find the area of a square using scilab.


2. Learning objectives of the experiment
3. Requirements a) A PC/laptop.
b)Scilab 6.0.0 must be installed.
4. Theory or principle of the experiment:
The area of a square is given by
A=r*r, where r=side of the square.

5. Procedure:

1. Switch on your PC/laptop.


2. Go to all programs & open scilab 6.0.0.
3. Go to Scinotes.
4. Write the coding/program.
5. Save the file & use extension name .sci
6. Then execute & go to the scilab console window for output.
7. Write a=area(3) in the scilab console window.
8. Press enter to get the output.

CODING:
clc

Area of square
function a=area(r)
a=r*r;
endfunction

6. Observations:

OUTPUT:

Output area of square


7. Conclusion:
8. Precautions or limitations:
9. Learning outcomes :
Experiment 4:

1. Aim of the Experiment: To find the volume of a sphere using scilab.


2. Learning objectives of the experiment
3. Requirements a) A PC/laptop.
b)Scilab 6.0.0 must be installed.
4. Theory or principle of the experiment:

5. Procedure:
1. Switch on your PC/laptop.
2. Go to all programs & open scilab 6.0.0.
3. Go to Scinotes.
4. Write the coding/program.
5. Save the file & use extension name .sci
6. Then execute & go to the scilab console window for output.
7. Write V=vol(4) in the scilab console window.
8. Press enter to get the output.

CODING:
clc

function V=vol(r)
V=4/3*%pi*r^3;
endfunction

6. Observations:
OUTPUT:

7. Conclusion:
8. Precautions or limitations:
9. Learning outcomes :

Experiment 5:

1. Aim of the Experiment: To find the current through a LR circuit.


2. Learning objectives of the experiment
3. Requirements a) A PC/laptop.
b)Scilab 6.0.0 must be installed.
4. Theory or principle of the experiment:

By knowing the emf, resistance & inductance of a LR circuit, we can find out the current
flowing through it. The formula is given as

5. Procedure:

1. Switch on your PC/laptop.


2. Go to all programs & open scilab 6.0.0.
3. Go to Scinotes.
4. Write the coding/program.
5. Save the file & use extension name .sci
6. Then execute & go to the scilab console window for output.
7. Write I=LR(1,2,3,4) in the scilab console window.
8. Press enter to get the output.
CODING:

clc

function I=RL(V, R, w, L)
I=V/(R^2+(w*L)^2)^(1/2);
endfunction

6. Observations:

OUTPUT:

7. Conclusion:
8. Precautions or limitations:
9. Learning outcomes :

Experiment 6:

1. Aim of the Experiment: To find the current through a LR circuit.


2. Learning objectives of the experiment
3. Requirements a) A PC/laptop.
b)Scilab 6.0.0 must be installed.
4. Theory or principle of the experiment:
By knowing the emf V, resistance & capacitance C of a RC circuit, we can find out
the current I flowing through it. The formula is given as

5. Procedure:
1. Switch on your PC/laptop.
2. Go to all programs & open scilab 6.0.0.
3. Go to Scinotes.
4. Write the coding/program.
5. Save the file & use extension name .sci
6. Then execute & go to the scilab console window for output.
7. Write I=RC(1,2,3,4) in the scilab console window.
.
CODING:
clc
function I=RC(V, R, w, C)
I=V/sqrt(R^2+(1/w*C)^2);
endfunction
6. Observations:

OUTPUT:

7. Conclusion:
8. Precautions or limitations:
9. Learning outcomes :

Experiment 6:

1. Aim of the Experiment: To find the current in a LCR circit using scilab.
2. Learning objectives of the experiment
3. Requirements a) A PC/laptop.
b)Scilab 6.0.0 must be installed.
4. Theory or principle of the experiment:
By knowing the emf V, resistance R & capacitance C of a LCR circuit, we can find
out the current I flowing through it. The formula is given as

5. Procedure:
1. Switch on your PC/laptop.
2. Go to all programs & open scilab 6.0.0.
3. Go to Scinotes.
4. Write the coding/program.
5. Save the file & use extension name .sci
6. Then execute & go to the scilab console window for output.
7. Write i=LCR(1,2,3,4) in the scilab console window.
.
CODING:

clc
function i=LCR(v, r, w, l, c)
i=v/sqrt(r^2+((w*l)-(1/w*c))^2);
endfunction

6. Observations:

OUTPUT:
7. Conclusion:
8. Precautions or limitations:
9. Learning outcomes :

Experiment 7:

1. Aim of the Experiment: To find the eigen value of a given matrix using scilab.
2. Learning objectives of the experiment
3. Requirements a) A PC/laptop.
b)Scilab 6.0.0 must be installed.
4. Theory or principle of the experiment:
The given matrix is & eigen values are found as follows.
5. Procedure:
1. Switch on your PC/laptop.
2. Go to all programs & open scilab 6.0.0.
3. Go to Scinotes.
4. Write the coding/program.
5. Save the file & use extension name .sci
6. Then execute & go to the scilab console window for output.
.
CODING:
clc

M=[0 1 ;1 0];
eig=spec(M);
[v, val]=spec(M);
disp(eig,'Eigen values are');
6. Observations:

OUTPUT:

7. Conclusion:
8. Precautions or limitations:
9. Learning outcomes :

Experiment 8:

1. Aim of the Experiment: To find the determinant of a given matrix.


2. Learning objectives of the experiment
3. Requirements a) A PC/laptop.
b)Scilab 6.0.0 must be installed.
4. Theory or principle of the experiment:
The determinant of a given matrix can be found as follows

5. Procedure:
1. Switch on your PC/laptop.
2. Go to all programs & open scilab 6.0.0.
3. Go to Scinotes.
4. Write the coding/program.
5. Save the file & use extension name .sci
6. Then execute & go to the scilab console window for output.

CODING:
clc
M=[-2 1 3; 0 -1 1; 1 2 0]
det(M);
disp(M,'The matrix is:');
disp(det(M),'The determinant of the given matrix is:');

6. Observations:

OUTPUT:

7. Conclusion:
8. Precautions or limitations:
9. Learning outcomes :

Experiment 9:

1. Aim of the Experiment: To find the inverse of a given matrix using scilab.
2. Learning objectives of the experiment
3. Requirements a) A PC/laptop.
b)Scilab 6.0.0 must be installed.
4. Theory or principle of the experiment:

5. Procedure:

1. Switch on your PC/laptop.


2. Go to all programs & open scilab 6.0.0.
3. Go to Scinotes.
4. Write the coding/program.
5. Save the file & use extension name .sci
6. Then execute & go to the scilab console window for output.

CODING:
clc
M=[2 3;4 5];
N=inv(M);
disp(M,'The Matrix is:');
disp(N,'The inverse of the given matrix is:');
6. Observations:

OUTPUT:

7. Conclusion:
8. Precautions or limitations:
9. Learning outcomes :

Experiment 10:

1. Aim of the Experiment: To solve the differential equation dy/dx=-x with x(0)=0.
y(0)=-2 from x=0 to 10 with interval =1..
2. Learning objectives of the experiment
3. Requirements a) A PC/laptop.
b)Scilab 6.0.0 must be installed.
4. Theory or principle of the experiment:

5. Procedure:
1. Switch on your PC/laptop.
2. Go to all programs & open scilab 6.0.0.
3. Go to Scinotes.
4. Write the coding/program.
5. Save the file & use extension name .sci
6. Then execute & go to the scilab console window for output.
CODING:

clc
function dy=f(x, y)
dy=-x;
endfunction
x0=0;
y0=-2;
x=0:1:10;
y=ode(x0,y0,x,f);
plot(x,y);
xlabel('x');
ylabel('y');
xtitle('x v/s f(x,y)');

6. Observations:

OUTPUT:
7. Conclusion:
8. Precautions or limitations:
9. Learning outcomes :

Experiment 11:

1. Aim of the Experiment: To find spring constant 'k' from Hooke's law when mass &
time period are given using scilab..
2. Learning objectives of the experiment
3. Requirements a) A PC/laptop.
b)Scilab 6.0.0 must be installed.
4. Theory or principle of the experiment:
5. Procedure:
1. Switch on your PC/laptop.
2. Go to all programs & open scilab 6.0.0.
3. Go to Scinotes.
4. Write the coding/program.
5. Save the file & use extension name .sci
6. Then execute & go to the scilab console window for output.
7. Write k=spring (2.1,1) in the scilab console window.

CODING:
clc
function k=spring(m, T)
k=(4.0*%pi*%pi*m)/(T*T);
endfunction

6. Observations:

OUTPUT:
7. Conclusion:
8. Precautions or limitations:
9. Learning outcomes :

Experiment 12:

1. Aim of the Experiment: To evaluate & plot Bessel function of 1st kind using scilab.
2. Learning objectives of the experiment
3. Requirements a) A PC/laptop.
b)Scilab 6.0.0 must be installed.
4. Theory or principle of the experiment:
The linear second order ordinary differential equation of type
x2y′′+xy′+(x2−v2)y=0 is called the Bessel equation. The number v is called the order
of the Bessel equation.
Scilab is loaded with varieties of function to handle Bessel functions & modified
Bessel function of its 1st & 2nd kind. Here Bessel function of 1st kind is plotted.

5. Procedure:
1. Switch on your PC/laptop.
2. Go to all programs & open scilab 6.0.0.
3. Go to Scinotes.
4. Write the coding/program.
5. Save the file & use extension name .sci
6. Then execute & go to the scilab console window for output.
7. Go to scilab graphic window to write the graph.
CODING:
clf()
x = linspace(0,40,5000)';
plot2d(x,besselj(0:4,x), style=2:6, leg="J0@J1@J2@J3@J4")
legend('I'+string(0:4),1);
xtitle("Some Bessel functions of the first kind")

6. Observations:

OUTPUT:
7. Conclusion:
8. Precautions or limitations:
9. Learning outcomes :

Experiment 13:

1. Aim of the Experiment: To find Legendre Polynomial using scilab.


2. Learning objectives of the experiment
3. Requirements a) A PC/laptop.
b)Scilab 6.0.0 must be installed.
4. Theory or principle of the experiment:
The Legendre differential equation is the second-order ordinary differential equation

To evaluate Legendre polynomial in scilab we use legendre(n,m,x) which is the


associated Legendre polynomial. However we need one Legendre polynomial, so let
m=0.
Let us find & plot 1st six Legendre polynomial for x=-1 to x=+1.
5. Procedure:
1. Switch on your PC/laptop.
2. Go to all programs & open scilab 6.0.0.
3. Go to Scinotes.
4. Write the coding/program.
5. Save the file & use extension name .sci
6. Then execute & go to the scilab console window for output.
7. Go to the graphic window to get the graph which is the output.

CODING:
clc;
clf;
n=0:5;
x=[-1:0.001:1]';
y=legendre(n,0,x)';
plot2d(x,y,leg='P0@P1@P2@P3@P4@P5');
xtitle('The first six Legendre Polynomials')
ylabel('Pn(x)');
xlabel('x');

6. Observations:

OUTPUT:
7. Conclusion:
8. Precautions or limitations:
9. Learning outcomes :

You might also like