Docsity

MATLAB Simulated Experiment-3a, Lab Reports of Mathematics

Partial preview of the text

Download MATLAB Simulated Experiment-3a and more Lab Reports Mathematics in PDF only on Docsity!

EXPERIMENT 3-A

1. Draw the surface of the function f (x, y) = ex+ey^ using ezsurf.

Solution: syms x y f=exp(x)+exp(y) ezsurf(f) colormap cool Input and Output:

2. Draw the 3-D plot for the function f(t)= (t, t^2 , t^3 ) , where 0 ≤ t ≤^^100.

Solution: t=linspace(0,100); x=t; y=t.^2; z=t.^3; comet3(x,y,z); plot3(x,y,z); xlabel('x-axis'); ylabel('y-axis'); zlabel('x-axis'); title('3D Curve') Output:

3. Using ‘surf’ plot the surface f (x, y) = x(x^2 +y^2 ).

Solution: [x,y]=meshgrid(-2:.2:2); f=x.*(x.^2 + y.^2); surf(x,y,f) Output:

4. Expand f (x, y) = ex^ ln(1+y) in terms of x and y up to the terms of 3rd^ degree using Taylor series.

Solution: clear clc close all

syms x y f=input('Enter the function f(x,y): '); I=input('Enter the point[a,b] at which Taylor series is sought: '); a=I(1);b=I(2); n=input('Enter the order of series:'); tayser=taylor(f,[x,y],[a,b],'order',n) subplot(1,2,1); ezsurf(f); subplot(1,2,2); ezsurf(tayser); Input and Output: exp(1) + exp(1)(x - 1) + exp(1)(y - 1) + (exp(1)(x - 1)^2)/2 + (exp(1)(x - 1)^3)/6 + (exp(1)(x - 1)^4)/24 + (exp(1)(y - 1)^2)/2 + (exp(1)(y - 1)^3)/6 + (exp(1)(y - 1)^4)/24 + (7exp(1)(x - 1)^2(y - 1)^2)/4 + 2exp(1)(x - 1)(y - 1) + (3exp(1)(x - 1)^2(y - 1))/2 + (3exp(1)(x - 1)(y - 1)^2)/2 + (2exp(1)(x - 1)^3(y - 1))/3 + (2exp(1)(x - 1)(y - 1)^3)/