If i had

DN= [[0.125 0.25 0.375 0.5 0.75 1 1.25 1.5 2 2.5];
OD=[0.405 0.540 0.675 0.84 1.05 1.315 1.66 1.9 2.375 2.875];
t=[0.068 0.088 0.091 0.109 0.113 0.133 0.14 0.145 0.154	0.203];

the above 3 matrix have the same no. of variables. and V varies from 1.5 to 3

ID = sqrt(4.*Q.* 0.000011574074./(pi.*V));
OD = ID + 2.*t;

and i need the OD function choose a the next large number from matrix above. Then align ID , t , DN with it.

댓글 수: 11

Star Strider
Star Strider 2018년 4월 19일

What are ‘Q’, ‘V’, and ‘v’?

Mahmoud Sami
Mahmoud Sami 2018년 4월 19일
There is one V ( mistake type) Q is input no say 1054
Amjad Green
Amjad Green 2018년 4월 19일
if i understood your question right
try F=[OD ID' t' DN']

‘V varies from 1.5 to 3’

Does this mean, for example:

V = 1.5 : 0.5 : 3;

or something else?

Mahmoud Sami
Mahmoud Sami 2018년 4월 20일
V=1.5:0.1:3; ID, OD, t, DN is the required
Mahmoud Sami
Mahmoud Sami 2018년 4월 20일
@Amjad Green I can't understand the answer
Jan
Jan 2018년 4월 21일
@Mahmoud Sami: I do not understand your question. What is the wanted output for the given example input? What does "align" mean? What is "next large number"?
Mahmoud Sami
Mahmoud Sami 2018년 4월 21일
@Jan The output in that function is ID (Internal pipe diameter ). But ID=OD-2t t and DN is vectors and there must be chosen from it. SO if you get ID no say 10 so OD and t will have numbers but out of vectors so step froward to take the number is the vector more large than that number. I wish i could inform you more simple.
Mahmoud Sami
Mahmoud Sami 2018년 4월 21일
I can try to simplify it. DN, t, & OD is ASME standard, V is velocity Q is discharge. V is recommended to vary from 1.5 to 3 so i must choose the above variables from ASME table that get make V (1.5 to 3) and the relation connect them is ID = sqrt(4.*Q.* 0.000011574074./(pi.*V)); & OD = ID + 2.*t; So if OD get no not in table i must choose the higher one then ID be changed.
Jan
Jan 2018년 4월 21일
@Mahmoud Sami: I do not have any idea of what "ASME standard" is. I do not understand the meaning of the other sentences of your comment also. Again: What is the wanted output for the given example input?
Mahmoud Sami
Mahmoud Sami 2018년 4월 21일
if i have F=[OD ID' t' DN'] as above comment I need 4 variables in that matrix with condition for V (1.5 :3 )

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

 채택된 답변

Walter Roberson
Walter Roberson 2018년 4월 21일

1 개 추천

"and i need the OD function choose a the next large number from matrix above. "
interp1() with the 'next' option.

댓글 수: 8

Mahmoud Sami
Mahmoud Sami 2018년 4월 25일
편집: Walter Roberson 2018년 4월 25일
I have Eq.
ID= (4.*Q./(pi.*V)).^0.5;
Q and V is given no.
but need ID to be selected from table, if any other answer can be rejected or choose the nearest large no. of it.
let's say
ID =[0.0134 0.0403 0.0769 0.1023 0.1213 0.1523 0.2031 0.2570 0.3118 0.3436]
and V vary from 1.5 to 3 Q=0.2
Mahmoud Sami
Mahmoud Sami 2018년 4월 25일
I don't know how
bin = discretize( Computed_ID, List_of_Valid_ID, 'IncludedEdge', 'right');
adjusted_ID = List_of_Valid_ID(bin);
Mahmoud Sami
Mahmoud Sami 2018년 4월 27일
편집: Mahmoud Sami 2018년 4월 27일
That's great it do what i need. Please can you help me in the next part of the question. If we put all listed Value of ID, DN, t, OD in a matrix F=[DN; OD; t; ID] then we get the adjusted ID from the above answer, how can we get the others separately .
Walter Roberson
Walter Roberson 2018년 4월 27일
I don't think I understand the question?
Mahmoud Sami
Mahmoud Sami 2018년 4월 27일
편집: Walter Roberson 2018년 4월 27일
That is the actual table
DN=[15,20,25,32,40,50,65,80,100,150,200,250,300,350,400,450,500,550,600,650,700,750,800,850,900,950,1000,1050,1100,1150,1200];
OD=[21,26,33,42,48,60,73,89,114,168,219,273,324,355,406,457,508,559,610,660,711,762,813,864,914,965,1016,1067,1118,1168,1219];
t=[2,3,3,4,4,4,5,5,6,7,8,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10];
ID=[17,20,27,34,40,52,63,79,102,154,203,255,304,335,386,437,488,539,590,640,691,742,793,844,894,945,996,1047,1098,1148,1199];
for every single value in ID there is a value in t, DN, OD aligned with it without any mathematical relations so your code get me ID. Is there any method to get the other values
adjusted_OD = OD(bin);
adjusted_DN = DN(bin);
adjusted_t = t(bin);
Mahmoud Sami
Mahmoud Sami 2018년 4월 27일
Thanks alot.

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

추가 답변 (0개)

카테고리

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

질문:

2018년 4월 19일

댓글:

2018년 4월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by