clear
clc
%% anonymously defining f(x,y) for easy usage in the entire
program
f = @(x,y) x^4 + y^4 - 16*x^3 - 28*y^3 + 97*x^2 + 295*y^2 - 264*x
-1386*y + 577;
%% defining the number of points or length (len) for x and y and
the equally spaced values using linspace in the range [0 10]
xlen = 100; ylen = 100; % the larger the len the more accurate the
results
x = linspace(0,10,xlen);
y = linspace(0,10,ylen);
%% initialising the solution xmin and ymin with the largest
values possible and computing fmin at those values
xmin = max(x);
ymin = max(y);
fmin = f(xmin,ymin);
%% grid searching where every possible combination of x and y
values is used to compute the value of f(x,y)
for i=1:xlen
for j=1:ylen
fvalue = f(x(i),y(j));
if fvalue<fmin % ensuring the search is kept moving towards the
minimum direction
fmin = fvalue; %updating fmin with the current minimum value
xmin = x(i); ymin = y(j); %updating xmin and ymin
end
end
end
%% displaying results
disp('OPTIMUM RESULTS')
fprintf(['fmin: ' num2str(fmin) '\n'])
fprintf(['xmin: ' num2str(xmin) '\n'])
fprintf(['ymin: ' num2str(ymin) '\n'])
Construct a MATLAB/EXCEL program that will perform a "grid search" on the region from 0< x<10...
IN MATLAB 6. Construct Anonymous Functions to compute the functions below. Use the AFs within a program to find Flx) in the range x (0:0.1.3]. Print the results as a table with columns x, and F(o) f(x)=x3-x-2 for 0 f(x) = x3 _ x _ 1 for 1 1 x 2 f(x) =x3 _ χ for 2.5 x < 3 Construct the anonymous function f(x,y) as shown for the mathematical function below. This function will be used in the future...
5.Use polar coordinates system to evaluate: x2 + y2)dydx , R is the region enclosed by 0 <x< 1 and, -x sy sx
Determine a region whose area is equal to limn-700 y=tan x, 0 < x < 1o. y=tan x, 0 <<< y=tan 2, 0 < x < 2013 y=tan 2, 0 < x < 012 y=tan 2, 0 < x < 2
3.Find the area of the region bounded by the parametric curve and the x-axis. (10 pts) = 6 (0- sin 0) y=6(1 - cos 0) 0<02T Find the slope of the tangent line at the given point. (10 pts) 4. r 2+sin 30, 0=T/4
6. (20 pts.) The plane y-0 separates region 1 (y 0), which is a dielectric materia with c, -3.5, from region 2 (y < 0), which is free space. If the electric flux density in region 1 is given by D,-15a, +22ay -20a, [nC/m'], find D..
+ 2y = 4u, y(0) = 0, for the following input: Solve: dt 0<t<T u(t) t>T Graph the solution (you may use Excel or Matlab) for T= 1sec, 0.1sec, 0.01sec, and 0.001sec. Do you see what is happening to the output? What is happening to the input?!
Determine the absolute maximum and minimum values of the function f(x,y) = xy-exp(-xy) in the region {0<x<2} x {0 <y<b} where 1 <b< . Does the function possess a maximum value in the unbounded region {0 < x <2} x {y >0}?
#1: Use a change of variables to integrate f (x, y) = y - x over the region described by: –3 <y – 2x < 0 and 0 < 2y – x < 3.
(10 pts) The joint distribution of X and Y is given by: f(x,y) = 1/y, 0 < x < y < 1. Derive the distribution of Z= Y/X. You must use both the methods (CDF & Transforma- tion).
( xy 7. CHALLENGE: fxy(x, y) = 0< < 2, 0 <y <1 otherwise 0 Find P(X+Y < 1) HINT: consider the region of the XY plane where the inequality is true.