More on buckling columns

Coincidentally, at about the same time as I wrote about column buckling for a column with a point load on the end, Autar Kaw at The Numerical Methods Guy was writing about buckling of columns under self weight, using the theory of Stephen Timoshenko

The maximum height of a cylindrical column that will stand under its own self weight is given by: 

 

Where B2 is a constant equal to 3.483265528 and ρgpr2 is the weight of the column per unit length. 

The critical height can also be found numerically by analysing the curvature of the column using the Runge-Kutta method to find the length of the column for which the change of curvature over the total height, due to deflection under self weight, is equal to the curvature at the base.  That is, the curvature at the top of the column reduces to zero.  The VBA function to perform this calculation (in combination with the AlgLib Runge Kutta routines) is shown below: 

Function ODEFunc5(X As Double, Y As Variant, CoeffA As Variant) As Variant
Dim ResA(0 To 2) As Double
 ResA(0) = Y(1) ' slope
 ResA(1) = Y(2) ' curvature
 ResA(2) = -CoeffA(1, 1) * Y(1) * CoeffA(1, 2) * (CoeffA(1, 3) - X) ' weight x slope

 ODEFunc5 = ResA
End Function

This routine has been added to the spreadsheet ODESolver-Buckle.xls, which is available for free download, including full open source code.
The results of the analysis are shown in the screen shots below.   Note that the Runge-Kutta analysis has given exactly the same critical length as the Timoshenko equation. 

Click on any image for a full size view: 



Self weight curvature for a column at critical length

Strand7 analysis including 2nd order effects, showing increase in deflection as the column approaches critical density

Posted in AlgLib, Beam Bending, Excel, Maths, Newton, UDFs, VBA | Tagged , , , , , , | 1 Comment

Keyboard shortcuts

Having been born and raised using a different spreadsheet I’m sometimes a bit set in my ways and don’t use keyboard shortcuts as much as I could.  The trouble is there are so many of them. 

 I’ve just discovered a list of  Useful Keyboard Shortcuts from Bob Umlas that strikes me as being an excellent short selection of  really useful shortcuts, most of which I didn’t know about.

Screenshot; click on the image or the link to see full list

Any suggestions for any other shortcuts, not on Bob’s list, that I should really know about?

Posted in Excel | Tagged , , | 1 Comment

SplineBeam update

Previous SplineBeam post

I have modified the SplineBeam spreadsheet to allow input of a single span (simply supported or with end constraints), and to optionally allow input of the position of intermediate nodes, rather than dividing each span into equal segment lengths.  This allows loads to be applied at their precise location, and output of results at the point of maximum deflection. 

Download SplineBeam2_2.zip (includes full open source code)

Input of single span beam with specified node locations (click for full size view)

 

Posted in Arrays, Beam Bending, Excel, Frame Analysis, Newton, UDFs, VBA | Tagged , , , , | 1 Comment

Elegant solutions, Column buckling, and the hole through the middle of the Earth

The previous post presented some examples of solution of differential equations using an iterative process, including the simple harmonic motion problem of a ball falling through an evacuated hole through the middle of the Earth.  The final example was concerned with finding the deflection and buckling load of a column subject to an axial load with a small eccentricity.  This problem, which appears entirely unconnected at first sight, was solved with exactly the same differential equation as the oscillating ball problem, suggesting that the exact analytical solution of the two problems should also have the same form.

The equivalent terms in the applicable differential equations for the two problems are shown below:

Simple Harmonic Motion Column Buckling
Period, T Column Length
Half amplitude, R Transverse Deflection
Velocity Slope
Acceleration, g Curvature

For the case of the ball through the middle of the Earth it was shown that the period of oscillation was given by:

T = 2π(R/g)0.5

This can be rearranged as:

g = R(2π/T)2

To give the initial acceleration required for a given radius and period.

If we substitute in the equivalent terms for column buckling, noting that:

  • Curvature = M/EI = F.Delta/EI (where Delta is the eccentricity of the applied load, F, relative to the centroid of the base of the column, E is the elastic modulus of the column, and I is the second moment of area of the cross section)
  • In simple harmonic motion the period is the time for the ball to travel the distance from the surface of the Earth to the centre four times.  In the case of the column the column length is therefore equivalent to the Period/4.
  • We wish to find the axial force at the top of the column, F, at which the deflection due to the force (ignoring second order effects) is equal to the initial eccentricity at the base.

F.Delta/EI = Delta(π/2L)2

F = EI(π/2L)2   which is the Euler equation for the buckling load of a cantilever column.

But what is the physical significance of this equation, and how does it relate to the acceleration of a ball falling through the Earth, and the orbital velocity of a body with the same period?

This can be  seen if we consider a cylinder of radius delta, centred on the top of the column, with a vertical axis, as shown below:

This diagram shows the deflected column centroidal axis (red line), and the imaginary cylinder.

Consider a line coincident with the centroid of the column at the base (green line), and spiralling up the surface of the cylinder at a constant slope, so that at the top of the column it has passed through a right angle around the cylinder.  If this line is projected onto the XY plane (the plane of the deflected column) it will exactly follow the deflected shape of the column centroid.  It can be seen that:

  • The slope of the line from the vertical, around the surface of the cylinder = (Delta.π/2)/L =  (Delta.π)/2L
  • The curvature of the line in the XY plane at the base = Slope2/Delta =  ((Delta.π)/2L)2/Delta = Delta(π/2L)2
  • Therefore at the buckling load F.Delta/EI =  Delta(π/2L)2
  • Buckling load, F = EI(π/2L)2
Posted in Beam Bending, Differential Equations, Newton | Tagged , , | 5 Comments

Using the AlgLib ODE (Runge-Kutta) Solver with Excel

Or to be more correct, the AlgLib Cash-Karp Solver, Cash-Karp being a refinement of the Runge-Kutta method of solving ordinary differential equations.

Solution of differential equations is an iterative process requiring the repeated application of the solver routine followed by evaluation of the differential equation using an external routine.  This is performed in AlgLib by a process known as reverse communication, whereby an initialisation routine creates a “State” object which is used to transfer data between the solver routine and the external equation evaluation routine (which is in this case a VBA function).  The steps required to wrap this process in an Excel User Defined Function (UDF) are:

  1. Read the name of the ODE evaluation routine and the required input data from the spreadsheet.
  2. Convert data in spreadsheet ranges to variant arrays.
  3. Convert variant arrays (which will always be base 1, 2 dimension arrays) into the form required by the AlgLib routines, which will always be base 0, and may be 1 or 2 dimensional.
  4. Evaluate any additional values required by the AlgLib routines
  5. Set up any required output arrays
  6. Call the appropriate AlgLib routine to initialise the State object
  7. Loop through the AlgLib solver routine and the external ODE evaluation routine until the solver routine returns “False”, which indicates that it has finished.  The VBA function named in “FuncName” is called using the Application.Run method.
  8. Extract the desired results from the State object using the appropriate AlgLib routine
  9. If necessary convert the AlgLib output arrays to a form suitable for Excel.
  10. Assign the output array to the function return value.
  11. Import the necessary AlgLib routines; in this case the only required modules are ODESolver.bas and ap.bas

This process is illustrated in the code for the UDF ODE() shown below (may take some time to display correctly). 

 This code and all the related AlgLib and other routines are included in the file ODESolver.zip.

Function ODE(FuncName As String, Initial As Variant, XA As Variant, _
CoeffA As Variant, Optional Eps As Double = 0.000001, _
Optional Step As Double = 0, Optional MaxIts As Long = 100)
Dim M As Long, N As Long, State As ODESolverState, _
YA() As Double, XA2() As Double, YA2() As Double, i As Long, _
Rtn As Boolean, Rep As ODESolverReport, NC As Long

' The VBA function arguments are the name of the VBA
' ODE evaluation routine, followed by the required input data.

' Convert data in spreadsheet ranges to variant arrays
Initial = GetArray(Initial)
XA = GetArray(XA)
CoeffA = GetArray(CoeffA)

' Convert variant arrays (which will always be base
' 1, 2 dimension arrays) into the form required by the AlgLib
' routines, which will always be base 0, and may be 1 or 2 dimensional.
Rtn = VarAtoDouble1D_0(Initial, YA, N, NC)
If N = 1 And NC > 1 Then N = NC
Rtn = VarAtoDouble1D_0(XA, XA2, M, NC)

' Evaluate any additional values required by the AlgLib routines
MaxIts = MaxIts * M

'Set up any required output arrays
ReDim YA2(0 To M - 1, 0 To N - 1)

'Call the appropriate AlgLib routine to initialise the State object
Call ODESolverRKCK(YA(), N, XA2, M, Eps, Step, State)

' Loop through the AlgLib solver routine and the external ODE
' evaluation routine until the solver routine returns "False",
' which indicates that it has finished.
' The VBA function named in "FuncName" is called using
' the Application.Run method.
Rtn = True
i = 0
Do While Rtn = True And i < MaxIts
Rtn = ODESolverIteration(State)
State.DY = Application.Run(FuncName, State.X, State.Y, CoeffA)
i = i + 1
Loop

 ' Extract the desired results from the State
 ' object using the appropriate AlgLib routine
 Call ODESolverResults(State, M, XA2, YA2, Rep)

' If necessary convert the AlgLib output array(s) to
' a form suitable for Excel. In this case YA2 is
' a 2D base 0 array, which may be assigned to the
' function return value without further processing.

' Assign the output array to the function return value
 ODE = YA2

End Function

The screen shots below show examples of the application of the ODE() function (more details of the final example, buckling of a strut, will be given in the next post):

ODE input and output details, click for full size view

Example 1; First Order kinetic process

Example 1 Output

Example 2; Process dependent on X and Y

Example 2 results

Example 3; damped vibration system

Example 3 output

Example 4; Undamped SHM, ball through the centre of the Earth

Example 4 results

Example 5; deflection of a cantilever strut and buckling load

Example 5 results

Posted in AlgLib, Beam Bending, Differential Equations, Excel, Maths, Newton, UDFs, VBA | Tagged , , , , , , , , | 8 Comments