cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Running the same mathcad file with different input value (mathcad15)

ptc-5348758
1-Newbie

Running the same mathcad file with different input value (mathcad15)

Hi all,

I am new here and a bit of a mathcad newbie. I taught myself how to use it by trial and error and googling which is probably not the best way to go about things.

I have written a mathcad file which calculates the flowrate of gas through an orrifice by simply inputting 1 value which is the depth.

This works fine as i can pick any depth i want and get the desired flowrate, however i would like the calculation to the give me the flowrate over a range of depths i.e 10,20,30,40....350 meters.

I can use a single colum matrix with multiple rows however my calculation starts to trip up when it encounters the if statement for each of these values.

The calculation works flawlessly if i input 1 depth, however for multiple depths it has this problem. Any help would be greatly appreciated

Simon

part+1.JPGpart+2.JPG

part+3.JPG

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks Andy for spotting that.

I had ignored al calculation above 1)..

Have changed parameter name from d to dp so it is not confused with the orifice diameter (ther was not problem with that, though) and attached some plots which may help to decide the correctness of he results.

View solution in original post

9 REPLIES 9

We can't debug a picture, so pelase post the file.

It seems you should turn your calculations inti s function dependend on depth which you then call with a vector as parameter (and probably you should vectorize the function call).

For a quick hack it may help to vectorize the calculation of Q.

sorry, file posted now. I left it as a working file with 1 depth input

thanks

Simon

Would the attched file help?

BTW - Mathcad can work with units and you may even define your own. Why don't you use that feature? Much less cumbersome than adding the units manually in textboxes.

Wow such an easy fix !

so sick ! thank you very much for your help and i appreciate the other comments such as changing to boolen to prevent red text. Your right it was for information only

thanks again

You are welcome.

Its often a good idea to turn calculations into functions, being more versatile.

actually this doesnt quite work as when i checked the value of flow at depths using original calculation it does not match what is given by the vector

the pressure functions are also dependant on depth, (all of) these should be changed to the X(d) format.

Thanks Andy for spotting that.

I had ignored al calculation above 1)..

Have changed parameter name from d to dp so it is not confused with the orifice diameter (ther was not problem with that, though) and attached some plots which may help to decide the correctness of he results.

Thank you very much ! lots of help

Top Tags