Reinforced concrete elastic analysis; Circular section

Previous posts have presented the theoretical background to finding stresses and strains in a reinforced concrete section built up of trapezoidal layers and subject to combined bending and axial loads.  A spreadsheet with User Defined Functions (UDFs) and open source code was included in Reinforced Concrete Section Analysis 3.  That post included an example analysing a circular section by dividing the circle into a number of trapezoidal layers.  That analysis provides adequate accuracy, but requires considerable work to calculate the sizes of the layers and the positions of the reinforcement.  A circular section is much more conveniently defined by a single parameter (the diameter) and the reinforcement may also be completely defined by the number and diameter of the bars and the depth of cover.  The UDF Circe has been added to the spreadsheet RC design functions5.xls, which includes full open source code.

Input and output from Circe are shown in the screenshots below;  further details of the application of the theory and the coding will be given in the next post:

CircE Input

CircE output; click for full size view

Output from Circe for a range of axial loads is compared with results from the beam analysis program, using trapezoidal layers, in the screeshots below.  It can be seen that the results are virtually identical:

Depth of Neutral Axis

Top Reinforcement Stress

Bottom Reinforcement Stress

Posted in Beam Bending, Concrete, Excel, Newton, UDFs, VBA | Tagged , , , , , , | 10 Comments

Calling a function as a variable – another example

The recent posts on the Inverse Quadratic Method and Brent’s Method, and on calling a function as a variable, are leading towards a user defined function (UDF) to analyse circular reinforced concrete sections under combined bending and axial load, but since these methods are of general use, and (strangely) not everyone is interested in reinforced concrete, this post will look at how these methods are used to solve a complex equation, and the specifics of reinforced concrete beam bending theory will be saved for another post.  A spreadsheet with full open source code of the functions discussed here may be downloaded from DepthNA.zip 

In order to find the stresses and strains in a reinforced concrete section we need to find the location of a line known as the Neutral Axis: 

The Neutral Axis is the base of the area in compression, shaded blue

To do this we must find the value of X such that the function CirclQxoI evaluates to zero: 

See DepthNA.xls for full code

This is simply done by evaluating the data required by CircleQxoI (R, Ast, Xsc, Istc and Ecc) and passing this to the QuadBrent function together with the name of the function to be solved (CircleQxol) and the range within which the desired X value will lie: 

Click for full size view

The screenshot below shows an example of the function in use: 

Click for full size view

Posted in Concrete, Excel, Maths, UDFs, VBA | Tagged , , , , , | 3 Comments

Digitising logarithmic scales

At the suggestion of the Exceltipsmonster, I have modified the DigitGraph spreadsheet presented in the previous post to also work with logarithmic scales. Dowload the updated spreadsheet from here.

The function now has two additional optional arguments, Xlog and Ylog:

 =DigitGraph(Shape Name, Xmax, Ymax,  Xorigin=0, Yorigin=0 ,Xlog=False ,Ylog=False)

Either or both scales may be entered as True, in which case the corresponding origin value must be greater than zero.

Log-Log graph example, click for full size view

Posted in Excel, UDFs, VBA | Tagged , , , , | 4 Comments

How to digitise a scanned image

For instance, suppose we had a graph from a technical paper, and we wanted to extract numerical data from the graph lines.  One way would be to measure the points by hand and calculate the numbers by scaling from the axes, but that would be inaccurate, error prone and tedious.  Another way would be to scan the graph and paste it into a program that will return the screen coordinates of selected points, and scale the screen coordinates to graph coordinates.  I have written a VBA program to make this procedure quick and easy: DigitGraph.xls (including full open source code).

The procedure is:

  • Paste the scanned image, and drag to a convenient size.
  • Select the rectangle named “Axes”:
  • Drag the rectangle so the bottom left corner is at the origin.
  • Stretch the top right corner so that the left and bottom edges extend to points with known ordinates.
  • Draw over the lines or shapes to be digitised, using a single freeform shape for each line.
  • Give the drawn shapes any unique name.
  • Enter the Digitgraph function as shown below, where XLen and YLen are the true length of the X and Y axes.
  • If the origin has non-zero coordinates enter Xorigin and Yorigin.
  • Enter the function as an array function: Select the output range, press F2, then press Ctrl-Shift-Enter

The function arguments are: =DigitGraph(Shape Name, XLen, YLen, Xorigin, Yorigin)

The function will return a list of coordinates of the traced lines, to the scale of the X and Y axes.

Example output is shown in the screen shot below, using a scanned graph of a beam deflection experiment.  The DigitGraph function results are on the right, showing the number of points in the traced polyline, followed by XY coordinates, to graph scale, for each point.

Traced graph and DigitGraph output; click for full size view

Posted in Drawing, Excel, UDFs, VBA | Tagged , , , | 19 Comments

The Inverse Quadratic Method 3 – Brent’s Method

The previous post in this series presented iterative methods to solve polynomial equations using direct or inverse quadratic interpolation.  These methods have two disadvantages:

  • In some circumstances the function may converge very slowly, or not at all.
  • The name of the function to be solved must be hard coded into the solution function

The user defined function QuadBrent overcomes both of these problems:

  • Brent’s Method is used to use different interpolation techniques (quadratic, linear, or bisection) through the course of the solution.
  • The name of the function to be solved is an argument of the UDF, (using the technique described in this recent post) so the QuadBrent function may be used to solve any equation that can be evaluated with a VBA function.

In addition the quadratic interpolation may be performed either by the Inverse Quadratic Method (the default), or by using Muller’s Method.

The function is entered as shown below:
 =QuadBrent(FunctionName, Ak, Bk, Coefficients,  Max error = 1E-14, Max iterations = 20, Subroutine = 1, Xtol 1e-14)

  • FunctionName is the name of a VBA function evaluating the equation to be solved.
  • Ak and Bk are the lower and upper bounds to the solution value.
  • Coefficients is a range or array of values that will be passed to FunctionName
  • Subroutine = 1 for Inverse Quadratic method or 2 for Muller’s method

The function returns a single column array with three rows:

  • The solution to the equation
  • The number of iterations
  • The error in the function value for the given solution

In order to display all three rows the function must be entered as an array function:

  • Enter the function as normal.
  • Select the cell containing the function and the two below.
  • Press F2
  • Press Ctrl-Alt-Enter

The QuadBrent function has been added to the ItSolve Functions2.xls spreadsheet, including full open source code.  The functions previously presented, QuadMuller and QuadSolve2 have also been modified to accept the input the name of a function  to be evaluated.

Use of the Quadbrent function, along with the two earlier functions, is shown in the screen shots below:

QuadBrent solution to a quartic polynomial, click for full size view

QuadBrent solution to a cubic polynomial

Note that in the second example the function crosses the x axis at x = -3, then touches the axis, but does not cross, at x = 1.  The QuadBrent function has found the solution at x = -3, but the QuadMuller function has failed to converge:

Wikipedia Brent Method Example

The spreadsheet also includes an on-spreadsheet implementation of Brent’s Method used to solve the equation shown above.  The solution output is shown below, and may be compared with the detailed description of the evaluation given in the Wikipedia article:

Step by step output for Brent's Method, click for full size view

Posted in Excel, Maths, UDFs, VBA | Tagged , , , , , | 12 Comments