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

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

SOLVED
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

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

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.

9 REPLIES 9

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

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.

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

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

thanks

Simon

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

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.

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

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

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

You are welcome.

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

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

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

Highlighted

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

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

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

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.

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

Thank you very much ! lots of help