Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Solve Colebrook Equation with solve block

Status
Not open for further replies.

hughgoodbody

Mechanical
Jan 27, 2010
2
I am new to Mathcad an am trying to solve the Colebrook equation for friction factors in pipes. The data is collected from an excel sheet.

I have tried to set up a solve block to solve for 'f' but am having problems with the vectors and also "undefined variable" keeps popping up when I enter "Find(f)" or "Minerr(f)"

I have posted the worksheet, any advice would be most helpful.

The section I am having problems with is named "Problem Section"

Thanks
 
Replies continue below

Recommended for you

Ok, I can't figure what you're trying to solve, so here's some general things:

> A Solve Block starts with a Given and ends with a Find
> Within a solve block are constraints, using only <ctrl>=
> Everything else must be assigned BEFORE the given, including a guess value for the unknown

Single use Solve

gamma := guess
Given

blah<ctrl>=cadabra
blah2<ctrl>=cadabra2

find(gamma)=

Solve Block function

gamma := guess
Given

blah<ctrl>=cadabra
blah2<ctrl>=cadabra2

Fgamma(diam):=find(gamma)




TTFN

FAQ731-376
 
hugh,

There might be a more elegant way to accomplish this, but here's how to implement what IRStuff posted. I did two things:
1) Deleted the "Given" statement above your Reynolds # (Re) assignment
2) Assigned the find(f) statement to a function of Re, which allows you to step through each value of Re in the if..then statement.

Hopefully that helps

PetieSmo
 
 http://files.engineering.com/getfile.aspx?folder=acfce7a3-9c52-4b3f-8e5f-54d00742574c&file=colebrook_post_11-SMO.pdf
See attached worksheet.

You haven't used any units through out your worksheet, why?

Do your pipes have an internal diameter of >6m.

I think the previous post has made an error as his head loss per meter seems too high.

There is also no need for all those vectorize functions, also see attached.





Regards

Mike
 
 http://files.engineering.com/getfile.aspx?folder=f978acb2-244e-4b0a-9c14-79b6aed90f67&file=colebrook_post_11[example].mcd
I have resubmitted a "corrected" worksheet. Tried to highlight the main mods in yellow.

<Mike1984> "I think the previous post has made an error as his head loss per meter seems too high."
In my original post, I was only focused on answering Hugh's question by generating the syntax of the solve block (didn't pay attention to the specific formulae involved).

Agree with Mike1984 that, without units, it was hard to entirely know the problem at hand. However, the friction factors seem to be in the correct order of magnitude now. Let us know if this helped.

PetieSmo
 
 http://files.engineering.com/getfile.aspx?folder=1d851942-4e64-4ff6-a38b-2da429d2a37b&file=colebrook_post_11-SMO2.pdf
Status
Not open for further replies.

Part and Inventory Search

Sponsor