Professional Documents
Culture Documents
Output:
enter the objective function:x*y+2*y*z+2*z*x
enter the constraint function:x*y*z-32
[x y z]=
[ 4, 4, 2]
Extreme Values = 48
ASSIGNMEN-5B :
Draw the two dimensional vector field for the vector 2 xi + 3 y j
MATLAB Code
clear all
clc
syms x y
f=input('enter the vector as i,j order in
vector form: ');
P = inline(vectorize(f(1)), 'x', 'y');
Q = inline(vectorize(f(2)), 'x', 'y');
x = linspace(0, 1, 10);
y = x;
[X,Y] = meshgrid(x,y);
U = P(X,Y);
V = Q(X,Y);
quiver(X,Y,U,V,1)
axis on
xlabel('x')
ylabel('y')
OUTPUT:
enter the vector as i,j order in vector form: [2*x 3*y]
1.2
0.8
0.6
y
0.4
0.2
-0.2
-0.2 0 0.2 0.4 0.6 0.8 1 1.2
x