While loop help
While loop help
(OP)
Hi. I am trying to write a while loop to solve the iteration in the screenshot attached. Using Prime 9.0. Help would be greatly appreciated! 
The function f(x) should be evaluated for x until the the value of 4 inch is reached. x should be incremented by 1 starting at 1. I have very limited programming knowledge and been looking at all of the examples and can't seem to figure it out.
Thank you for the help!

The function f(x) should be evaluated for x until the the value of 4 inch is reached. x should be incremented by 1 starting at 1. I have very limited programming knowledge and been looking at all of the examples and can't seem to figure it out.
Thank you for the help!
RE: While loop help
Cheers
Greg Locock
New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?
RE: While loop help
> are angle units in degrees? unusual to see 360/x in a radian environment
> presumably, Rebar should be return in inches
> what changes x as a function of i? nothing in rebar[i is a function of i
> the while test seems like it should be a function of x and not f(x), and the condition should be "≤" and not the opposite
TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg
FAQ731-376: Eng-Tips.com Forum Policies forum1529: Translation Assistance for Engineers Entire Forum list http://www.eng-tips.com/forumlist.cfm
RE: While loop help
The sin (360/x) should give me the arc angel needed to calculate the spacing in a circular pattern. I am trying to do the following.
I have a fixed diameter rebar cage and it needs a lot of vertical rebar for a design, for this particular design, I will need 2 rebar rings (one inside of each other). The spacing is the concern as it is required to allow for concrete to flow properly. So, the following is what I intend to iterate:
1. I want to have a maximum of 4inch of spacing between the bars in a circular pattern
2. I want to know how many bars will fit into the outside ring
3. If all of the bars fit, then only 1 ring is required
4. If only some of the bars fit with the 4 inch spacing, then go on to design and iterate for the inside ring (of a smaller diameter than the outside ring)
Just for reference, the outside cage would be 36 bars in a 96in cage = f(36) = ((sin(360deg/36))*radius of cage)-diameter of rebar = 6.099 inches and the inside ring will be 32 bars in a 84in cage at 5.937 inches.
I am trying to set up the sheet to automate this process and eliminate the iterations in excel and/or hand calcs.
RE: While loop help
Mathcad defaults to radians, not degrees, hence the question.
You've not answered the other issues
TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! https://www.youtube.com/watch?v=BKorP55Aqvg
FAQ731-376: Eng-Tips.com Forum Policies forum1529: Translation Assistance for Engineers Entire Forum list http://www.eng-tips.com/forumlist.cfm