if 구문에서 데이터값이 계산한 값과 다르게 나옵니다.

조회 수: 1 (최근 30일)
GeonWoo Jeon
GeonWoo Jeon 2019년 9월 27일
답변: SaiDileep Kola 2021년 3월 25일
v = 0.1 : 0.1 : 2
re = (mediandiamter * 10^-6 * v * fdensity ) / vicosity ;
if ( re < 2.0 )
cd = 24 * (re.^(-1))
elseif ( 2<= re <= 500 )
cd = 19 * (re.^-(0.6))
else
cd = 0.4 * (re.^(-0))
end
여기서 fdensity, vicosity, mediandiamter는 상수며 첫번째 re값이 0.5996 이 나왔습니다.
그렇게되면 첫번째 cd값은 re가 2보다 작으므로 24 * 0.5996^-1 의 결과인 40.0266이 나와야되는데 매트랩상에서는 25.9가 찍힙니다.
어디부분이 잘못된걸까요 ??

답변 (1개)

SaiDileep Kola
SaiDileep Kola 2021년 3월 25일
I don't see anything wrong in the posted code, may be the values of other constant parameters or using re as vector and element might be problem try using index like re(i).

카테고리

Help CenterFile Exchange에서 모델링에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!