Group Abstract Group Abstract

Message Boards Message Boards

0
|
58 Views
|
2 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Does the added notebook reveal a buck in function VectorPlot?

POSTED BY: Ulrich Mutze
2 Replies

Another way is to use the option VectorColorFunctionScaling -> False.

POSTED BY: Gianluca Gorni

I think what happens is that round-off error means the lengths are computed to a real number that differs from 1. by 2.*10^-16 or so. These lengths are rescaled, by default, to the domain of color function, which domain is $[0,1]$. So the different colors reflect only whether the round-off error was a small positive or negative number somewhere in the range $\pm2\times10^{-16}$.

If you would like a way to plot the field without such small variation in length appearing as if it were a large one, consider using WorkingPrecision as follows:

f = Sqrt[x1*x1 + x2*x2];
f1 = D[f, x1];
f2 = D[f, x2];
VectorPlot[{f1, f2}, {x1, -1, 1}, {x2, -1, 1}, 
 PlotLegends -> Automatic, WorkingPrecision -> 16]
POSTED BY: Michael Rogers
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard