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

SOLVED

## Re: Nested if Statements

If Cr>0.01 the first block is executed, if Cr<0.01 the second block is executed. If Cr=0.01 neither block is executed. How you deal with this depends on what you want. If you want the first block to execute when Cr=0.01 change the greater than to a greater then or equal to. If you want the second block to execute when Cr=0.01 you can either change the less than to a less than or equal to, or change it to an otherwise.

## Re: Nested if Statements

ahhh, you are correct. I misread your statement I need to change that to a less than or equal to.

## Re: Nested if Statements

Gotcha another poster pointed out the same thing. The chances of me hitting 0.01 exactly were close to zero so brute force debugging fail

## Re: Nested if Statements

I have just restructed. Looks a little more traqnsparent now (IMO)

Mike

## Re: Nested if Statements

 Gotcha another poster pointed out the same thing. The chances of me hitting 0.01 exactly were close to zero so brute force debugging fail

Remember if there any chance at all it's good practice to program for it.

Mike

## Re: Nested if Statements

Good call, one less if statement cleans it up. Thanks for the help!

## Re: Nested if Statements

 Brad Trammell wrote:Good call, one less if statement cleans it up. Thanks for the help!

No problem at all.

Remember try and make the programs easy to follow. When I write anything, I aim to keep it as simple as possible, so if a non-Mathcad user wants to check my work, it's still possible.

Mike

## Re: Nested if Statements

Yes.

1-exp(-NTU(1-Cr)) / 1-Cr*(exp(-NTU*(1-Cr)))

converges to

NTU/(1+NTU)

as Cr approaches 1. I failed to see that in the original logic (but it is a good thing it is true or i would have a discontinuity in my solution)

Announcements