Plot velocity profile of microfluid flow
Show older comments
Hi,
My project is in microfluidics and I am trying to rewrite the following velocity profile into matlab so that I can control XY stepper motors accordingly. First of all, I want to turn the below equations into code that is then plotted on a graph of velocity against position.

This velocity profile depicts the velocity of a microfluid moving through a converging/diverging microchannel, where xdim represents dimensionless position(x) in the channel, u represents velocity and f1, f1, n1 and n2 are dimensionless parameters.
Below is the code I have written so far, although I am new to matlab so I am unsure where I have gone wrong here and I don't know if using a for loop if the correct thing to do.
for idx = 1:6
if xdim <= -n1 - n2/2
u = Uu
plot(xdim,u,"-")
elseif xdim <= -n1 - n2/2
u = f2*(xdim + n1 + n2/2)^2 + Uu
plot(xdim,u,"-")
elseif -n1 + n2/2 <= xdim <= 0
u = f1*xdim + Uc
plot(xdim,u,"-")
elseif 0 <= xdim <= n1 - n2/2
u = f1*xdim + Uc
plot(xdim,u,"-")
elseif 0 <= xdim <= n1-m2/2
u = f2*(xdim-n1-n2/2)^2 + Uu
plot(xdim,u,"-")
elseif xdim >= n1 + n2/2
u = Uu
plot(xdim,u,"-")
end
hold on
end
Any help is greatly appreciated!
Thank you.
1 Comment
Lewis Kirkwood
on 21 Feb 2020
Accepted Answer
More Answers (0)
Categories
Find more on Aerospace Applications in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!