Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hey
I am trying to find out how to calculate a combined pump curve. I have made the two pumps indivdual. But i can't figure out how to do the combined.
I have looked at this thread Liquid Flow Through Pumps in Parallel
Solved! Go to Solution.
If I assume that your pressure is the discharge pressure at the pump, then pumps in parallel have their flow rates add based on discharge pressure.
If I assume that your pressure is the discharge pressure at the pump, then pumps in parallel have their flow rates add based on discharge pressure.
That is excactly how it should turn out.
I was wondering how I could learn more about MathCad, there is so many things I would like to learn. Do your know any websites besides this page?
For help with Mathcad, this is probably your best forum--there is a lot of experience here.
I just noticed that the flwn does not hit 4.5 bar. Could that somehow be done in another way. Maybe by programming?
I have just bought the book "Essential PTC Mathcad Prime" to improve my mathcad skills
Well, it does, its just not zero as you'd like:
The function "polyfit" does a least-squares development of the coefficients of a polynomial fit, in the case of the graph above a second order polynomial. A third order fit got me 2.899 m^3/hr, Fourth order got 2.401, fifth got 1.819. You can do other fits--a spline fit will pass thru points exactly. Be careful, a seventh order polynomial seems closer to reality at 4.5 bar, butstrange things start to happen:
How close is "close enough"?
Close enough is when i hit all the given marks, and I'm having a smooth curve - if it is even possible. I have just tried lspline, and it is not giving me a smooth curve.
I have tried both l, c and pspline, and I have no clue what the difference is between them.
> Close enough is when i hit all the given marks, and I'm having a smooth curve
I guess you just have the choice between either an interpolation which hits all given 11 points, but is not perfectly smooth OR a regression of some kind which can be smooth, but will not exactly hit all points.
Here are a couple of regressions:
Polynomial fit of fourth order
You may try polynomials of higher order, too. You will get a better fit, but more "bumps" and probably will see it as less "smooth". If you choose order 10 or higher you get a function which will exactly hit all 11 points, but you won't like the outcome, I guess.
Here is a rational function which seems to fit pretty well
Localized polynomial regression using the built-in "loess"
Maybe something of use for you here. You may try to fit any type of function you think is worthwhile using genfit.
Here is another example using exponential association
WE
Tanks Werner.
Polyfit is okay for them as single curves, but when I combine them I'll have a problem as you can see in Freds third post. That is why i tried other functions
Hmm, what exactly is/was that problem?
You wrote that "flwn does not hit 4.5 bar". As far as I see "flwn" is just a polyfit of Qn, Pn, nothing else. Fred did a second order fit in his sheet.
And as its a regression, not an interpolation, one cannot expect that (4.5/0) is exactly part of the curve.
You yourself also posted just a plot of Pn over Qn.
So what exactly is the problem you experience and how does it relate to combined functions?
"flwn" is not a regular polyfit "vsn" is.
I guess Fred made it this way because I have to combine them to a system curve.
I have attached an image which shows the difference between "flwn" and "vsn", and the combined curve .In the combined curve I would like to replace flwn with vsn, but I can't figure out how to do that. I hope I made myself understandable.
I really appreciate your help.
When the discharge pressure gets to 4.5 bar, the pump cannot push any more fluid. A curve that is built from the data points would predict a negative flow at a higher pressure; I chose to assume that for higher pressures the pump would stop producing flow but would resist attempts to push fluid back thru it, So flw becomes zero if the extrapolated curve is negative:
You can simply replace flw with vsn if you so desire:
But you better be able to explain the negative flow.
I have attached an image which shows the difference between "flwn" and "vsn", and the combined curve .In the combined curve I would like to replace flwn with vsn, but I can't figure out how to do that. I hope I made myself understandable.
Fred already explained what he did and as you can see are "flwn" and "vsn" the very same function, the only difference is that "flwn" is set to 0 when "vsn" would yield negative values. So approx. from p=4,5 bar up "flwn" is zero (for good reason) while "vsn" would give you technically wrong negative results. Using the "max" function Fred avoids using an "if" condition.
But at first I am not sure if you would like to plot Qn over Pn, as Fred did, or if you rather would like plot Pn over Qn as the picture of your spline interpolation shows.
And then I still don't understand, why using "flwn" is a problem for you and using "vsn" is not. If the problem is just the name, you could equally well (re)define "vsn" after it is created by typing vsn(p):=max(vsn(p), 0 m^3/hr) (you don't even need to add the units for the zero value, but is sure is good habit).
You could redefine "vsn" in different ways, e.g. using the if-function
but this is not elegant and efficient as it would mean, that the function has to be evaluated twice in case the value is positive.
So we could use a programmed if-condition
but if you compare this to Freds solution, I guess you see why his way to make use of the max-function is the preferable one.
WE
I think i managed to make it as i would like it to be.
In the assignment that I am doing, I am supposed to point out excactly where one of pumps will not deliver any flow to the system. In Freds example I can not point out that point because it does not hit 4.5 bar, as it is supposed to if i had made the curve by hand.
If you take a look at the curve that I have made know you can see the difference.
I think I see what you mean.
In Freds sheet vsn hits zero at 4.623 bar.
If you chose a fourth order polynomial instead of Freds second order, the hit is at 4.548 bar. Would this 0.05 bar really be noticeable in a plot? After all, a regression is an approximation anyway (as is a hand drawing). And you don't gain more precision with what you do.
BTW, you dont have to deal with > and = in two different branches. You can use
or even shorter with the if-function (similar to Excel and similar unclear to read as well)
WE
Thanks a lot
This not a question for this task, but could I by programming leave out a part of a curve by programming for example all values below 4.5 bar and values above 5. bar
Can I type in anything that says not possible?
Sure you can. You may also combine two constraints with the AND operator rather than using "also if".
If you return a text like "not possible" for illegal arguments you may run into problems whith calculations using your functioon (you can't do math with text) but you may return 0 or NaN (Not-a-Number) instead.
I have tried doing it like this, but I'm not getting the result that I would like to.
I've made to lines in paint, and i would like to leave out everything that is not between these to lines, and I thought I nailed it, but I didn't.
What did you expect to see?
You function HM never ever returns a value which could be plotted.
You have to say which value should be returned if pp is in the range from 1.5 to 3 bar!
Probably using soemthing like "else HM(pp)" at the end.
Even better would be
if 1.5 bar <= pp <= 3 bar
HM(pp)
else
NaN
Off course! I guess I have misunderstood the programming a little. Thank you very much.
Do you know if books or sites besides this side that could improve my MathCad skills?
Tommi Lauridsen wrote:
Off course! I guess I have misunderstood the programming a little. Thank you very much.
Do you know if books or sites besides this side that could improve my MathCad skills?
I am using Mathcad for a very long time and I learned it simply by doing and of course the hard way by trial and error. The Mathcad collab forum, the predecessor of this forum here, was of great help for me doing so.
So I don't know many books about Mathcad and haven't flipped through just a few. One book I liked as of its practical approach was "Mathcad: A Tool for Engineering Problem Solving" by Philip Pritchard -> http://www.amazon.com/gp/product/0077509404
The book is a bit outdated,though, its about Mathcad 14/15 and I don't think that a new edition dealing with Prime is to be expected.
I have never looked at books about Prime, so I can't advise.
In case you are not aware of - PTC has uploaded a few files for Prime here
Maybe especially this series
Calculate and Communicate with PTC Mathcad Prime 3.0
is of interest to you.
WE
Hi Tommi,
I want recommend to you the following:
1. "Mathcad Prime Help Center" (you also can start this help center by using F1 key when the programm is running). It also contains a many of examples: http://www.ptc.com/cs/help/mathcad_hc/prime3_hc/
2. A book by Brent Maxfield "Engineering with Mathcad":
Essential Mathcad for Engineering, Science, and Math w/ CD, Second Edition
Essential PTC Mathcad Prime 3.0
3. Mathcad Prime video tutorials on PTC's "Learning Exchange" resource: All PTC Mathcad Prime Tutorials