Himanshu Maths Lab Manual
Himanshu Maths Lab Manual
Name - Himanshu No. - 24CSU300Branch - SOET Section - FFaculty Coordinator - Dr. Vipin Yadav
THE NORTHCAPUNIVERSITY
Gurugram, Haryana
LIST OF CONTENTS
S.No. Content Page No.
1. MATLAB: An introduction
For example
1
1.
1.
2 1.
1.
2. ϖ – x
For the function of two variables (a) Find the first and second
10.
order partial derivatives of two variables and plot the graphs.
3. Notes/Comments
Experiment No.- 1
Aim:- To find the solution of first order differential equation and plotting of graph of solution.
For example
1.
2.
Soln:- 1)
syms y(t)
ode=diff(y,t)==(exp(-t))-(4*y(t))
ysol(t)=dsolve(ode)
2)
syms y(x)
ode=diff(y,x)==(x^(2)-y^(2))/(x*y)
ysol(x)=dsolve(ode)
Experiment No.- 2
Aim:- To find the solution of differential equation of order two or three and plot it.For example
1.
2.
Soln. 1)
syms y(x)
ode=diff(y,x,2)==cos(2*(x))-y
ysol(x)=dsolve(ode)
2)
syms y(x)
ode=diff(y,x,3)==((exp(x)+1)^2)+4*y
ysol(x)=dsolve(ode)
Experiment No.- 3
r=[1 1;0 1]
for i=1:7
end
img=imread('256pixels.jpg');
img=(rgb2gray(img));
img=double(img);
encry= img*r
decry=encry*inv(r)
figure(1);imshow(img,[])
figure(2);imshow(encry,[]);
figure(3);imshow(decry,[]);
Experiment No.- 4
Aim:- How to input sequences and series and to find the sum of series such as Arithmetic, Geometric and
Harmonic.
Soln.
syms n
a = 1;
d = 2;
a_n = a + (n - 1)*d;
a = 3;
r = 2;
S_n = symsum(g_n, n, 1, 5)
h_n = 1/n;
Aim:- To compute Taylor and Maclaurin series expansions for fundamental functions such as sine, cosine,
exponential functions, logarithmic functions etc.
3) f(x) = cos x
4) f(x) = exp(2*x)
Experiment No.- 6
Aim:- Fourier Series To find Fourier series and Fourier coefficients of basic functions and plot the graph.
1. Sin x
2. Cos x
1.F(x) = Sin(x)
syms x
T=3.14;
n=1:4;
f=sin(x);
ao=(1/T)*int(f,x,-T,T)
an=(1/T)*int(f*cos(n*x),x,-T,T)
bn=(1/T)*int(f*sin(n*x),x,-T,T)
2. F(x) = Cos(x)
syms x
T=3.14;
n=1:4;
f=cos(x);
ao=(1/T)*int(f,x,-T,T)
an=(1/T)*int(f*cos(n*x),x,-T,T)
bn=(1/T)*int(f*sin(n*x),x,-T,T)
Experiment No.- 7
Aim:- Fourier Series To find Fourier series and Fourier coefficients of basic functions and plot the graph.
1. x-x2
2. ϖ – x
1.F(x) = x-x2
syms x
T=3.14;
n=1:4;
f=x-((x)^(2));
ao=(1/T)*int(f,x,-T,T)
an=(1/T)*int(f*cos(n*x),x,-T,T)
bn=(1/T)*int(f*sin(n*x),x,-T,T)
2.F(x) = ϖ – x
syms x
T=3.14;
n=1:4;
f=pi-x;
ao=(1/T)*int(f,x,-T,T)
an=(1/T)*int(f*cos(n*x),x,-T,T)
bn=(1/T)*int(f*sin(n*x),x,-T,T)
Experiment No.- 8
Aim:- To implement image encryption and decryption using Fourier transform and Inverse Fourier
transform
Experiment No.- 10
Aim:- For the function of two variables (a) Find the first and second order partial derivatives of two
variables and plot the graphs.
Soln.
syms x y
diff(sin(x*y)*x^(3),x,y)