Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

While loop help

Status
Not open for further replies.

bespokeengineeringllc

Civil/Environmental
Joined
Apr 22, 2023
Messages
2
Location
US
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!
Screenshot_2023-04-22_143101_iumrdr.png


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!
 
> 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! faq731-376 forum1529 Entire Forum list
 

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.
 
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.

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! faq731-376 forum1529 Entire Forum list
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top