Local extreme values for a differential equation, using solve?

조회 수: 5 (최근 30일)
Hassan
Hassan 2013년 5월 2일
답변: Christopher Creutzig 2014년 3월 31일
Hi,
I am trying to calculate the local extreme values for a differential equation using the function solve. The problem is the values I get does not match the extreme values I can see in the plot for the function.
This is the code:
syms x y %Symbolic x and y
f= (x^3*y+5*x^2*y)/(exp(x^2+3*y^4)); %The function
figure(1)
ezsurf(f,[-2,0.1,2],[-2,0.1,2]) %3D-plot
grid on
box on
fx=diff(f,x) %Differeniate the function w.r.t x
fy=diff(f,y) %Differeniate the function w.r.t y
S=solve(fx,fy); %Solving the differential equations (=0)
x = double(S.x); %Rewrite the value to a number from the struct
y = double(S.y);
If I run the code I get that x=0 and y=0, which cant not be correct compared to what is seen in the figure created in the code. I know that there are other methods to solve this problem, but this is the method I was told to use to solve this assignment.
Thank you for your help. Regards

답변 (1개)

Christopher Creutzig
Christopher Creutzig 2014년 3월 31일
I think they are correct, the solution is just not complete, since it was computed numerically.
You could try solve(simplify(fx), simplify(fy)) instead, which returns 18 solutions. If you restrict x and y to be real by calling syms x y real, you get 10 solutions.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by