The shortest distance (gradients)

  • Thread starter Thread starter Poetria
  • Start date Start date
  • Tags Tags
    Shortest distance
Poetria
Messages
267
Reaction score
42
Homework Statement
Function: ##f(x,y)=y^2-x^3-x##
How can we move from the point (1,1) by a distance of 0.1 by increasing f as much as possible?
What is ##(\Delta x, \Delta y)##
Relevant Equations
$$-4*\Delta x + 2*\Delta y = (-4,2) \cdot (\Delta x, \Delta y)$$

(-4,2) is ##\nabla f(1,1)##
I got:
$$(\frac {1} {\sqrt \frac {5}{0.01}}, \frac {2} {\sqrt \frac {5} {0.01}})$$

The approximate value of the function = -0.55
The exact value of the function = -0.998

Well, the vector and the exact values of the function aren't correct but I don't know why. Any hint?
 
Physics news on Phys.org
The candidates points are on the circle
x=1+r\cos\theta
y=1+r\sin\theta
where r=0.1. Take a look at ##f(x,y)=f(\theta)## to check your result.
 
Last edited:
  • Like
Likes Poetria and Delta2
anuttarasammyak said:
The candidates points are on the circle
x=1+r\cos\theta
y=1+r\sin\theta
where r=0.1. Take a look at ##f(x,y)=f(\theta)## to check your result.
Sorry for the mistake in the title. It should be 'gradient' of course.

Well, how to check it?
I have drawn a tangent computed from the gradient [-4,2].
Slope of the tangent = 2
y=2x
And I have analysed the interception points with the circle: x^2 + y^2 = 0.1

I got the result: ##(\frac {1} {(5*\sqrt{2}}), (\frac {\sqrt{2}} {5})##
The value of the function would be: -0.982828 (slightly different).
 
To my best knowledge the slope of the vector (-4,2) is ##\frac{2}{-4}=-\frac{1}{2}## while the circle in this problem is centered at (1,1) so it has equation $$(x-1)^2+(y-1)^2=0.1^2=0.01$$
 
  • Love
Likes Poetria
But I thought about a normal to the gradient (-4,2).
I.e. slope of (2,4) = 4/2
 
Poetria said:
But I thought about a normal to the gradient (-4,2).
I.e. slope of (2,4) = 4/2
Why normal to gradient?
As far as I know the direction of greatest increase is the direction of the gradient...

But even so, I think this problem doesn't relate to gradient, it seems like an optimization problem to me with optimization function the given function and domain the circle centered at (1,1) and radius 0.1, so I feel one should proceed like post #2 suggests.
 
  • Like
Likes Poetria
Poetria said:
The approximate value of the function = -0.55
The exact value of the function = -0.998
From #2 I got a result below. Your check is highly appreciated.
[EDIT]
I withdraw my calculation for your homework.
 
Last edited:
  • Like
Likes Poetria and Delta2
I did the following in wolfram, that is setting the maximization problem without converting to polar coordinates:
https://www.wolframalpha.com/input/?i=max+y^2-x^3-x,+(x-1)^2+(y-1)^2=0.1^2
Wolfram reports a maximum of -0.572885 at ##(x,y)=(0.914235,1.05142)##, I think this is in perfect agreement with post #2 and #7 where maximization is done in polar coordinates.
 
  • Like
Likes Poetria and anuttarasammyak
Ok, my path is wrong then. :(

(cos(1.10715)*0.1)^2+(sin(1.10715)*0.1)^2=0.01 :(

I have to digest it.
 
Last edited:
  • #10
Your (-4,2) ##\theta## =2 ##\pi##-arctan 1/2 = 2.67635
Calculation in #7 ##\theta##= 2.60152
I see they are not so much different. Your way of taking orientation of gradient is right and exact for infinitesimal displacement. r=0.1 is small but finite. So your answer should be regarded as the first approximation, but I think your teacher evaluate your answer.
 
Last edited:
  • Like
Likes Poetria and Delta2
Back
Top