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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

7-Bedrock

## Error in while loop

I'm currently trying to write a while loop that will loop and add 1 cm to (D.section1) until the loop is able to reduce the total Incident Energy to under 1.1 but currently I'm getting a statement saying "This function refers to itself inconsistently"

1 ACCEPTED SOLUTION

Accepted Solutions
18-Opal
(To:Johnruehlz)

Looking further up in your sheet, I assume you mean Incident Energy should be cal/cm^2 - not cal/J.

Here is the corrected program per my previous three notes:

Yellow highlights indicate my additions.  Red arrows indicate removal of the unnecessary unit conversions.  You were essensially multiplying by 1 (that's what Valery was showing).

8 REPLIES 8
24-Ruby IV
(To:Johnruehlz)

Sorry

What is it

Good catch, Valery. I just saw the unit inconsisency. It looks like OP is trying to manage their own units. Let Mathcad do that work!

7-Bedrock
(To:ValeryOchkov)

18-Opal
(To:Johnruehlz)

The error message is not very helpful, but here are some findings:

• IE.Temp is not defined before the while loop.  It must be defined in order for Mathcad to know if it should enter the loop or not.
• IE.Temp has units, but you are comparing it to a unitless quantity (1.1).  Your comparison must be unit consistent.  Is it 1.1*kg/s^2 ?
• AFB.1 is initially defined with unit length.  Within the while loop you add 1 to AFB.1.  Should this be AFB.1 + 1cm?
7-Bedrock
(To:Johnruehlz)

The goal is to be able to find the working distance from where the Incident Energy which is measured in (cal/J) is lower than or equal 1.1 this defines a boundary in which I need. IE.Temp1 calculates the initial incident energy while IE.Temp2 determines the backfeed incident energy.

18-Opal
(To:Johnruehlz)

Looking further up in your sheet, I assume you mean Incident Energy should be cal/cm^2 - not cal/J.

Here is the corrected program per my previous three notes:

Yellow highlights indicate my additions.  Red arrows indicate removal of the unnecessary unit conversions.  You were essensially multiplying by 1 (that's what Valery was showing).

7-Bedrock
(To:MJG)

Wow thank you so much! You guys are great!

21-Topaz II
(To:Johnruehlz)

Announcements
Top Tags