Error in while loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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"
Solved! Go to Solution.
- Labels:
-
Other
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sorry
What is it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Im sorry what are you asking about?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Wow thank you so much! You guys are great!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
