Hi all, I need kindly help to write a code to calculate drag coefficient as the attached figure.
thank you in advance

댓글 수: 2

Bob Thompson
Bob Thompson 2016년 8월 2일
Could you expand a little bit more on what you're looking for exactly? All I can determine from the information in the pic is that Cd = 0.0012.
Lilya
Lilya 2016년 8월 3일
The equation is in the first line, this is what I actually want. The wind speed values are in matrix which in form of u, v.

댓글을 달려면 로그인하십시오.

 채택된 답변

Star Strider
Star Strider 2016년 8월 3일

0 개 추천

See if this does what you want:
tau = @(U10) 1.22.*[1.2E-3.*((4 < U10) & (U10 < 11)) + 1E-3*(0.49 + 0.065*U10).*((11 <= U10) & (U10 < 25))].*U10.^2;
x = linspace(0, 24.9);
figure(1)
plot(x, tau(x))
xlabel('\itU_{10}\rm')
ylabel('\bf\tau\rm')
grid

댓글 수: 8

Lilya
Lilya 2016년 8월 3일
편집: Lilya 2016년 8월 3일
thank you Strider for your answer. tau has to components regarding the two wind components (u, v). the output should be taux and tauy. the wind speed magnitude is given by the following equation: U=sqrt(u^2+v^2). thus, tau will be taux and tauy . taux=rho*CD*U*u, tauy=rho*CD*U*v Kindly find the attached figure for more explanation.
thank you again .
Star Strider
Star Strider 2016년 8월 3일
That image doesn’t tell me anything useful. I have absolutely no idea what ‘u’ and ‘v’ are.
If they are directions, you need to separate them as, for example, sin and cos (or sind and cosd for degree measure) functions.
Lilya
Lilya 2016년 8월 3일
편집: Lilya 2016년 8월 3일
I did it already when I calculated the two components of wind speed u and v. It gave these wind speeds to calculate the wind stress (i.e. tau).
Star Strider
Star Strider 2016년 8월 3일
I’m still lost. If you’ve already used ‘u’ and ‘v’ to calculate ‘U10’, what is the problem?
What do you want to do with ‘u’ and ‘v’?
Lilya
Lilya 2016년 8월 3일
I apologize. u and v to calculate tau. But in form of those two components. Taux by using u. Tauy by using v.
I really appreciate your help.
My pleasure.
I believe I understand now.
See if this works:
tau = @(U10) 1.22.*[1.2E-3.*((4 < U10) & (U10 < 11)) + 1E-3*(0.49 + 0.065*U10).*((11 <= U10) & (U10 < 25))].*U10.^2;
taux = tau(u);
tauy = tau(v);
Note that the ‘tau’ function has not changed. I included it here for convenience.
Lilya
Lilya 2016년 8월 3일
Thank you very much for your help. I greatly appreciate it.
Star Strider
Star Strider 2016년 8월 3일
My pleasure.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

YATIK SHAH
YATIK SHAH 2021년 4월 14일

0 개 추천

tau = @(U10) 1.22.*[1.2E-3.*((4 < U10) & (U10 < 11)) + 1E-3*(0.49 + 0.065*U10).*((11 <= U10) & (U10 < 25))].*U10.^2;
x = linspace(0, 24.9);
figure(1)
plot(x, tau(x))
xlabel('\itU_{10}\rm')
ylabel('\bf\tau\rm')
grid

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2016년 8월 2일

답변:

2021년 4월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by