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}]
Answer
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]
For more precise control, you may need two separate ParametricPlot
s and combine the output using Show[plot1, plot2, PlotRange -> All]
.
Comments
Post a Comment