0
$\begingroup$

I'm trying to plot streamlines of Stokes solution to an sphere, the expression of streamlines is

enter image description here

I've seen similar questions before and this what I have tried

enter image description here

As you can see, a=1, U=1, but it seems not to work, any help? Thanks

$\endgroup$
1
  • 1
    $\begingroup$ Never post unsearchable pictures of equations. Instead typeset them, using MathJax or at lest copyable code. $\endgroup$ – David G. Stork Jun 24 '20 at 20:51
1
$\begingroup$

Perhaps ContourPlot is what you are looking for?

Try (Thanks to MarcoB for his answer and definition of simpler)

ContourPlot[simpler, {x, -2, 2}, {y, 0, 2} ,Contours -> Table[-10^-i, {i, 0, 4}],MaxRecursion -> 4]

enter image description here

$\endgroup$
4
  • $\begingroup$ That's what I need! Is there any way I can erase the streamlines inside the semicircle? $\endgroup$ – Juan Garcia Jun 25 '20 at 19:22
  • $\begingroup$ Add a constraint 'x^2+y^2>1 ' inside Contourplot. $\endgroup$ – Ulrich Neumann Jun 25 '20 at 21:07
  • $\begingroup$ for example ContourPlot[…,RegionFunction->Function[{x,y},x^2+y^2>= 1] $\endgroup$ – Ulrich Neumann Jun 26 '20 at 8:06
  • $\begingroup$ Oh yeah I was able to do that, I searched for it! Thanks I chose this as the answer, yet MarcoB's answer really did help. $\endgroup$ – Juan Garcia Jun 26 '20 at 15:01
1
$\begingroup$
expr = 
  With[
    {r = Sqrt[x^2 + y^2], theta = ArcTan[x, y]},
    -1/4 (Sin[theta]^2) (1/r - 3 r + 2 r^2)
  ]

initial expression

simpler = FullSimplify[ExpandAll@expr]

simplified expression

Region[
  ImplicitRegion[simpler == 0, {{x, -2, 2}, {y, 0, 2}}],
  Axes -> False, Frame -> True,
  PlotRange -> {{-2, 2}, {-2, 2}}
]

region plot

$\endgroup$
1
  • $\begingroup$ It does work, but what when I try a value of psi other than zero it says Region Embedding dimension:2. I'm new to mathematica so I really don't know what it means. $\endgroup$ – Juan Garcia Jun 24 '20 at 22:20

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.