I have some function $\psi$, I compute the transformation $T = \vec{x} - \nabla \psi$. I'd like to visualize the action of $T$ on a square centered at the origin.
The mathematica website shows some examples of how to compute transformations.
https://reference.wolfram.com/language/ref/TransformedRegion.html
I have two questions:
If I want to subimpose the initial region (perhaps in red) under the final region, how would I do this? Also I'd like to add coordinate axes.
Below is included a sketch of code. How do I get the coordinates of the gradient I compute into the transformation function. Below is my best guess, but I'm totally lost on how to accomplish this.
Clear["Global`*"]
psi = -4 (x^2 + y^2);
gradPsi = Grad[psi, {x, y}]; /. {Indexed[#, 1] -> x ,
Indexed[#, 2] -> y}
R =
TransformedRegion[
Rectangle[], {Indexed[#, 1] - Indexed[gradPsi, 1],
Indexed[#, 2] + Indexed[gradPsi, 2]} &];
Region[R]