필터 지우기
필터 지우기

ı want to calculate the flow variable by the specified input by user. for example when ı take l/d=1 and S=0.20 on the chart and then ı read by hand its almost 4.10. but when ı calculate with my code it gives different result. can you help me?

조회 수: 2 (최근 30일)
D=input('enter a value of diameter:');
L=input('enter a value of length:');
if L/D==1
% for l/d=1 performance parameters
S=[0 0.00474 0.0188 0.0446 0.121 0.264 0.631 1.33 inf];
% the corresponding vector for the volumetric oil-flow rate, Q/ (RcnL)
Qc_1=[0 4.82 4.74 4.62 4.33 3.99 3.59 3.37 pi];
fQR = csapi( S, Qc_1 );
% suppose ı took Sc=0.20 from the chart
Sc=0.20;
Qc = fnval(fQR, Sc);
end
ı want to calculate the flow variable by the specified input by user. for example when ı take l/d=1 and S=0.20 on the chart and then ı read by hand its almost 4.10. but when ı calculate with my code it gives different result. can you help me? where is my mistake? and how can ı wite a code for the calculate flow variable for the user specified S

채택된 답변

Alan Stevens
Alan Stevens 2020년 12월 22일
Use interp1, but get rid of inf (and possibly use more points!)
>> S=[0 0.00474 0.0188 0.0446 0.121 0.264 0.631 1.33 6];
>> Qc_1=[0 4.82 4.74 4.62 4.33 3.99 3.59 3.37 3.2];
>> Q = interp1(S,Qc_1,0.2)
Q =
4.1422
  댓글 수: 2
matlab coder
matlab coder 2020년 12월 22일
but ı use the tabular form of these values. and there is inf there. what can use if ı have inf? and also as ı shown below for some parameters there is no value on the table. they just put (-). ı dont know what should ı write for this kind of notation when ı try to create a corresponding matrix.
Alan Stevens
Alan Stevens 2020년 12월 23일
The inf values you could replace with large, but finite values. How often are you likely to need those extremes?
For the two dashes you could interpolate using values of epsilon or (ho/c).

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by