How to plot power law velocity profile

11 次查看(过去 30 天)
I would like to plot a velocity profile according to the power law model:
{\displaystyle u(r)={\frac {n}{n+1}}\left({\frac {dp}{dz}}{\frac {1}{2K}}\right)^{\frac {1}{n}}\left(R^{\frac {n+1}{n}}-r^{\frac {n+1}{n}}\right)}
When I code this into matlab, I get the following:
n = 0.89
k = 53
d = 0.01125
r = d
p = 15000
u = (n/n+1)*(p/(2*k))^(1/n)*(d.^((n+1)/n)-r.^((n+1)/n))
plot(d,u)
This gives me the following:
Annotation 2020-01-20 193129.png
Trying the following code I get:
n = 0.89
k = 53
d = linspace(-0.01125, 0.01125)
r = linspace(-0.01125,0.01125)
p = 15000
u = (n/n+1)*(p/(2*k))^(1/n)*(d.^((n+1)/n)-r.^((n+1)/n))
plot(d,u)
Annotation 2020-01-20 193410.png
I want it to look like the folowing, but I can't seem to get it to plot the x values correctly.
hqdefault.jpg

回答(1 个)

Star Strider
Star Strider 2020-1-20
It plots the values correctly.
Note that since ‘d’ and ‘r’ are the same, this part of the expression:
(d.^((n+1)/n)-r.^((n+1)/n))
is identically 0 for all values of ‘d’ and ‘r’.

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品


版本

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by