Given the following function:
$f(x,y) = x^3 - 3*x^2*y + 3*x*y^2 - y^3$
All the critical points on this curve are asked in the exercise.
While calculating this with the code underneath. The Delta-test does not seem to give a definitive answer. $(0,0)$ has a delta-value, an important value in optimization, of zero. After drawing this, it does not seem clearer what precisely the critical point $(0,0)$ represents. How can this be solved?
To generalize this question, what can be done if the delta-value seems to be 0?
clear all
syms x y
f(x,y) = x^3 - 3*x^2*y + 3*x*y^2 - y^3
Use the gradient .
gradf = gradient(f(x,y), [x, y])
kritisch = solve(gradf, [x, y])
disp([kritisch.x, kritisch.y])
aantal = length(kritisch.x)
delta = det(hessian(f(x,y), [x, y]))
fxx = diff(f(x,y),x,2)
for i = 1 : aantal
p0 = [kritisch.x(i), kritisch.y(i)];
p0
f0 = f(kritisch.x(i), kritisch.y(i));
f0
Delta = subs(delta, {x, y}, {kritisch.x(i), kritisch.y(i)});
Delta
f2 = subs(fxx, {x, y}, {kritisch.x(i), kritisch.y(i)});
f2
disp('______________')
end
%drawing the height-lines of the function for R = [-3,3]X[-3,3]
a = -3; b = 3; c = -3; d = 3;
figure
set(gca, 'XAxisLocation', 'origin', 'YAxisLocation', 'origin')
hold on
fcontour(f, [a, b, c, d], 'LevelList', [-2:8, 10:2:20], 'LineColor', 'b')
fcontour(f, [a, b, c, d], 'LevelList', [subs(f, {x, y}, {kritisch.x(1), kritisch.y(1)}), ...
subs(f, {x, y}, {kritisch.x(1), kritisch.y(1)})], 'LineColor', 'r')
scatter(kritisch.x, kritisch.y, 'fill', 'MarkerFaceColor', 'k')
hold off
Another question: further in the exercise, there is an area given. All critical points in the area (and at the borders) need to be found.
The area is enclosed by the points $(-1/2,-1)$,$(3/2,-1)$ and $(3/2,2)$. Therefore is this a rectangular triangle. Hence, this area can be determined by a ruled surface. But the techniques seen in class do not work with parametric equations. How can this be solved?
Thanks in advance, Best regards