Hello,
To get a better understanding of the gradient, I would like to use the graphing powers of Mathematica.
In attempting to visualize the function, the vectors calculated using the gradient, and the calculated vector using the given starting point of (-2,3), I created the following notebook - see attached. However, this graphic representation in the notebook seems to have several problems. For example, the arrow representing the vector (starting at the given point of (-2,3) and ending at the calculated point of (-2,-2)) does not seem to be pointing in the direction of greatest increase, and is not a unit vector. When I normalized the calculated point of (-2,-2) I came up with the point (0,-1) which also changed the direction of the vector when plotted - which doesn’t seem correct since it is my understanding that normalizing should only change the length of the vector and not the direction. Additionally, some of the vectors created using the VectorPlot[] function seems questionable.
At this point, I am sure it is something that is incorrect on my part, so please review my notebook and set me on the right path.
Your problem is that you are computing the slope at point {-2,3} as Q2 – this is correct, however, when you plot Q2 you plot it as a point. It is a direction – your plot must add P2 plus some multiple of Q2. The multiple determines the vector length. For example, use P2+Normalize[Q2].
Thank you so much for your response, it answered my question exactly.
If I wanted to take the visualization up a notch and visualize the solution in both 2D and 3D, would the attached be a correct solution? Since I followed your example, I am pretty sure the 2D visualization is correct, but not real sure about the 3D visualization.
Thanks so much for your help, I certainly appreciate your comments and advice - they were of great use.
FYI - the arrow in my previous attached example is NOT pointing in the correct direction so it can be ignored. However, the large arrow has been an issue for some time and I was very glad to get it resolved.