Stationary point, local minimum, local maximum and inflection point

I am given some function of x1 and x2. Example f(x1,x2)=3x1^2+2x1x2+2x2^2+7. How can I find the stationary point, local minimum, local maximum and inflection point from that function using matlab? Please tell me the feature that can be used and the coding, because I am really new in this field. Thank you in advance.

3 comentarios

syms x y
% Define the function f(x,y)
f = 8*x^2 + 6*y^2 - 2*y^3 + 5;
% Compute the partial derivatives of f(x,y) with respect to x and y
df_dx = diff(f, x);
df_dy = diff(f, y);
% Solve the system of equations df_dx = 0 and df_dy = 0 to find the stationary points
[stationary_points_x, stationary_points_y] = solve(df_dx == 0, df_dy == 0);
% Evaluate the function f(x,y) at the stationary points
stationary_point_values = subs(f, [x y], [stationary_points_x stationary_points_y])
% Display the results
disp("Stationary Points:")
disp([stationary_points_x stationary_points_y])
disp("Function Values at Stationary Points:")
disp(stationary_point_values)
Undefined function 'syms' for input arguments of type 'char'.
Stationary Points:
[ 0, 0]
Function Values at Stationary Points:
[ 5]
Unrecognized function or variable 'Stationary'.
Find the stationary points of the function f(x, y) = 8x 2 + 6y 2 −2y 3 + 5 and its function values. with matlab code
Find the stationary points of the function f(x, y) = 8x 2 + 6y 2 −2y 3 + 5 and its function values. with matlab code

Iniciar sesión para comentar.

 Respuesta aceptada

Jorge Herrera
Jorge Herrera el 27 de Oct. de 2015
Editada: Jorge Herrera el 27 de Oct. de 2015
Hello there! I recomend you to use diff and solve functions available in Matlab.
Check the examples to get more info about it, I suppose that you know the calculus theory, then solve the problem should be more less easy. If you have problems I'll help you.

Más respuestas (1)

reman
reman el 3 de Mzo. de 2023
Find the stationary points of the function f(x, y) = 8x 2 + 6y 2 −2y 3 + 5 and its function values. with matlab code

Preguntada:

el 6 de Oct. de 2015

Comentada:

el 3 de Mzo. de 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by