0
$\begingroup$

I'm trying to plot this vector <1,3*y^(2/3)> using vector plot. but it gives me a wrong answer.

VectorPlot[{1, 3*y^(2/3)}, {x, -8, 3}, {y, -3, 4}, Axes -> True, 
AspectRatio -> Automatic]

enter image description here

But if I try StreamPlot it gives me the correct answer.

enter image description here

StreamPlot[{1, 3*y^(2/3)}, {x, -8, 3}, {y, -3, 4}, Axes -> True, 
AspectRatio -> Automatic]

What am I doing wrong in VectorPlot?

$\endgroup$
  • $\begingroup$ Didn't understand what you mean. Can you explain a little bit more? Thank you. $\endgroup$ – md seum Feb 6 at 18:33
  • $\begingroup$ deleted comment, because streamplot says StreamPlot does not show streamlines at any positions for which the v_i etc. do not evaluate to real numbers. but when I looked at VectorPlot it also said the same thing. So I do not know why VectorPlot shows vectors in negative y but not StreamPlot. May be VectorPlot is the one which should not show that region. If you type Table[3*y^(2/3), {y, -3, 4, .1}] you see that in negative region y becomes non-real. $\endgroup$ – Nasser Feb 6 at 18:39
  • $\begingroup$ To see this, try StreamPlot[Evaluate[{1, Re[3*y^(2/3)]}], {x, -8, 3}, {y, -3, 4}, Axes -> True, AspectRatio -> Automatic] and now you get similar plot to VectorPlot $\endgroup$ – Nasser Feb 6 at 18:42
  • $\begingroup$ I got your point. But how can I Solve it now? $\endgroup$ – md seum Feb 6 at 18:43
  • $\begingroup$ how can I Solve it now other than what I showed above, which is to use Re, I do not know. $\endgroup$ – Nasser Feb 6 at 18:48
1
$\begingroup$

If you want reals, then try plots as

VectorPlot[{1, 3*CubeRoot[y^2]}, {x, -8, 3}, {y, -3, 4}, Axes -> True,
  AspectRatio -> Automatic]

enter image description here

and

StreamPlot[{1, 3*CubeRoot[y^2]}, {x, -8, 3}, {y, -3, 4}, Axes -> True,
  AspectRatio -> Automatic]

enter image description here

They then match.

$\endgroup$
  • $\begingroup$ Thank you all. Problem solved $\endgroup$ – md seum Feb 6 at 18:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.