## Solve Colebrook Equation with solve block

## Solve Colebrook Equation with solve block

(OP)

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

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

## RE: Solve Colebrook Equation with solve block

> 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: Eng-Tips.com Forum Policies

## RE: Solve Colebrook Equation with solve block

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

## RE: Solve Colebrook Equation with solve block

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

## RE: Solve Colebrook Equation with solve block

<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