Lab 3
Lab 3
• Download this sheet, and write your answers in detail neatly without any corrections.
In case of graphical answer, create the image file of it and paste it in the answer, where
ever needed
• Write your name and do the signature on the top of every page
• Take the snap shot of the title page and the filled-in answer sheet carefully which should
be clearly visible, and make a single pdf file only
• Then upload it through the lab log-in portal.
• Do not send different image files or zipped files. Do not send the answer sheet to my
mail
• Follow the guidelines strictly. Any deviation from the above instructions will lead to the
reduction in marks
Submission Format:
(a) Aim of the Experiment
(b) Definitions, Mathematical formulas or brief concept related to the exercise
(c) Matlab Code
(d) Input
(e) Output (including the graphical representation)
Uploading of answers in any other format is not acceptable
Regd. No. 20BCT0066 Name: N.JAYANTH Sign.
R b R g(x)
Exercise 1 (3 marks). Write a MATLAB code to evaluate a f (x)
φ( x, y) d y dx and visualize
R 1 R px
the region. Use the code to evaluate 0 x2 x y d y dx.
Answers:
Aim:- To write a MATLAB code for evaluation of a function and visualization of the region.
Answer (Continued...)
MATLAB Code:-
clc
clear
close all
syms x y
p = int(phii,y,f,g);
q = int(p,x,a,b);
disp(['The value of the double integration of the given function within the given limits is: ',char(q)])
val = a:0.01:b;
for i = val;
plot([i,i],[0,p(i)])
hold on
end
grid on
xlabel('X-axis')
ylabel('Y-axis')
title(['Region Bounded by ',char(p),' and x-axis from x= ',char(a),' to x= ',char(b)])
Input:-
Output:-
The value of the double integration of the given function within the given limits is -5/96.
Answer (Continued...)
GRAPH:
∂(u,v,w)
Exercise 2 (3 marks). Write a MATLAB code to find the Jacobian ∂(x,y,z)
, where u = f ( x, y, z),
∂(u,v,w)
v = g( x, y, z) and w = h( x, y, z). Use the code to find ∂(x,y,z)
, where u = 2 yz/ x, v = 3 zx/ y and
w = 4 x y/ z .
Answers:
Aim:- To write the MATLAB code to find the Jacobian value of the given function and
to use the code to find the derivative.
Answer (Continued...)
MATLAB Code:-
clc
clear
close all
syms x y z
wx(x,y,z) = diff(w,x);
wy(x,y,z) = diff(w,y);
wz(x,y,z) = diff(w,z);
Answer (Continued...)
Input:-
Output:-
96
symbolic function inputs: x, y, z