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

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

댓글을 달려면 로그인하십시오.

 채택된 답변

Jorge Herrera
Jorge Herrera 2015년 10월 27일
편집: Jorge Herrera 2015년 10월 27일

0 개 추천

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.

추가 답변 (1개)

reman
reman 2023년 3월 3일

0 개 추천

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

카테고리

질문:

2015년 10월 6일

댓글:

2023년 3월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by