I have a velocity profile for two liquids on top of each other in a pressure driven channel. The profile is supposed to be parabolic. I plotted them up, but I can't manage to plot them in the x-y plane, it only plots with velocity on the vertical coordinate and y as the horizontal coordinate. Is there any way I can plot them in the x-y plane so that I can clearly see which liquid is ahead of the other in the channel and their parabolic profile? I am also trying to define v1 on a certain interval from y=0 to y=ha, and v2 from y=ha to y=H, so v1 and v2 are sort of piecewise.

Here is my code, this is for mercury(just to start somewhere) and water

v1[y_, μ1_, P_, ha_, H_, μ2_] :=
  P*(1/(2*μ1))*y*(y + ((ha^2*(μ2 - μ1) - H*μ2)/(ha*(μ2 - μ1) + H*μ1)))

v2[y_, μ1_, P_, ha_, H_, μ2_] :=
  P*(1/(2*μ2))*(y^2 + ((ha^2*(μ2 - μ1) - H*μ2)/(ha*(μ2 - μ1) + H*μ1))* y +
   (ha *  H/μ1)*( (μ1 - μ2)*(H*μ2 - ha * μ1)/(ha*(μ2 - μ1) + H*μ1 )))

Plot[{v1[y, 0.00157, -6, 1, 2, 0.001], v2[y, 0.00157, -6, 1, 2, 0.001]}, {y, 0, 10}]

Velocity vs y


  • 1
    $\begingroup$ So you need position rather than velocity - NIntegrate? Please note your code will be much easier to read if you didn't use Greek letters. $\endgroup$
    – Verbeia
    Feb 20, 2013 at 3:09
  • $\begingroup$ No time since its steady state $\endgroup$
    – l3win
    Feb 20, 2013 at 3:19
  • $\begingroup$ Can you clarify what you mean by "plot in the x-y plane"? Do you need velocity to be on the horizontal axis? Or you just need to shift the curves? It'd be best to make a quick sketch in MS Paint and post it as illustration. I can see that people are confused about what you mean by velocity profile. I believe I understand that, but I also don't understand what you need exactly. $\endgroup$
    – Szabolcs
    Feb 20, 2013 at 3:21
  • $\begingroup$ I have made a paint figure. Of course I don't need the arrows. $\endgroup$
    – l3win
    Feb 20, 2013 at 3:30
  • $\begingroup$ I guess I have to rotate my graph and somehow split V1 and V2 to two intervals. $\endgroup$
    – l3win
    Feb 20, 2013 at 3:32

1 Answer 1


How about using ParametricPlot?

ParametricPlot[{{v1[y, 0.00157, -6, 1, 2, 0.001], 
   y}, {v2[y, 0.00157, -6, 1, 2, 0.001], -y}}, {y, 0, 10}, 
 AspectRatio -> 1/GoldenRatio, PlotStyle -> Black, Frame -> True]

Mathematica graphics

For more precise control, you may need two separate ParametricPlots and combine the output using Show[plot1, plot2, PlotRange -> All].


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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