Beam actions and deflections, 3D or 2D

Two new functions have been added to the ConBeamU spreadsheet, last discussed here.

The new version can be downloaded from ConBeamU.zip, including full open-source code.

The new functions, BeamAct3D and BeamAct2D calculate forces, moments, deflections and rotations along a 3D or 2D beam under specified end conditions and loading.  The output is calculated based on the conditions specified at End1, and optionally the error in the calculated values at End 2, compared with the input values, may be returned.  If this option is not used the End2 data is ignored.

The examples below show input for a uniform beam, but the beam may be subdivided into any number of segments with differing section properties.  The current version of the functions performs linear analysis only, but the section properties can be easily adjusted on the spreadsheet, based on the output actions, to provide non-linear materials analysis.  Later versions will have this functionality built-in, and will also provide for geometric non-linear effects.

Details of the function input and output are shown in the screenshots below (taken from the Functions sheet of the spreadsheet).  For more details of how to use Excel User Defined Functions and Array Functions see: Using Array Functions and UDFs.

BeamAct1

BeamAct Functions Input 1

BeamAct2

BeamAct Functions Input 2

The output consists of 12 or 6 columns for the 3D or 2D version respectively:

BeamAct3

Examples of both functions are found on the BeamAct sheet:

BeamAct4

BeamAct3D Input

BeamAct5

BeamAct3D Input

BeamAct6

BeamAct3D Output; click for full size view

BeamAct7

BeamAct3D Deflection Results Compared with Strand7

BeamAct8

BeamAct2D Input 1

BeamAct9

BeamAct2D Input 2

BeamAct10

BeamAct2D results

BeamAct11

BeamAct2D Results compared with Strand7

Posted in Beam Bending, Excel, Finite Element Analysis, Frame Analysis, Newton, Strand7, UDFs, VBA | Tagged , , , , , , | 2 Comments

New Links: Scientific Python and Engineering Excel

The previous post had a link to Cyrille Rossant which is worth a closer look.  The blog has many detailed posts on scientific applications of Python, as well as links to Galry: a high performance interactive visualization package in Python and his IPython mini-book.

Spreadsheets 4 Simulation is a new blog focussing on engineering applications of Excel and Google Sheets, which has some impressive looking applications and animations, including:

Posted in Excel, Link to Python, Newton, NumPy and SciPy, VBA | Tagged , , , , | Leave a comment

The speed of loops in Python

This post is based on exercises published by Cyrille Rossant in his book “Learning IPython for Interactive Computing and Data Visualization”.  Cyril also has a blog well worth looking at: http://cyrille.rossant.net/blog/ (Thanks to Alfred Vachris and Boris Vishnevsky for the links).

As has been noted here before, pure Python can be very slow when looping through large blocks of data, but there are simple ways to speed things up dramatically.  This is illustrated by alternative techniques to search a list of 10 million 2D coordinates to find the point closest to a specified location.

The screenshot below shows Python code to loop through the coordinates in the list “positions” and return the index of the one closest to “position”.
closest1
The positions list is generated with the random function, and the closest function is then run with a position of (.5, .5), as shown below:

closest2
The Python routine takes 7.1 s to loop through the 10 million rows of the positions list.

To speed things up, using Numpy, the procedure is:

  • Import pylab with the command %pylab, which is the most convenient way of using NumPy in an IPython interactive session.
  • Generate the positions array with the rand function.
  • Extract single column arrays, x and y, from the positions array.
  • Create the distances array with the command:
    distances = (x – .5)**2 + (y-.5)**2
  • Extract the minimum distance from the distance array with:
    ibest = distances.argmin()

closest3

The total time to execute this procedure on the 10 million rows of the positions array was 218 ms, better than 30 times faster than the original code.

The message is, whenever working with large arrays, use Numpy functions that operate on the entire array with efficient C based code, rather than looping through the arrays with interpreted Python code.

Posted in Arrays, Link to Python, NumPy and SciPy | Tagged , , , , | Leave a comment

Jack Orion

This is what Wikipedia says of the music played by The Pentangle:

Pentangle are usually characterised as a folk-rock band. Danny Thompson preferred to describe the group as a “folk-jazz band.”[25] John Renbourn also rejected the “folk-rock” categorisation, saying, “One of the worst things you can do to a folk song is inflict a rock beat on it. . . Most of the old songs that I have heard have their own internal rhythm. When we worked on those in the group, Terry Cox worked out his percussion patterns to match the patterns in the songs exactly. In that respect he was the opposite of a folk-rock drummer.”[26] This approach to songs led to the use of unusual time signatures: “Market Song” from Sweet Child moves from 7/4 to 11/4 and 4/4 time,[27] and “Light Flight” from Basket of Light includes sections in 5/8, 7/8 and 6/4.[28]

Writing in The Times,Henry Raynor struggled to characterise their music: “It is not a pop group, not a folk group and not a jazz group, but what it attempts is music which is a synthesis of all these and other styles as well as interesting experiments in each of them individually.”

There is no better example of their unique style than their version of “Jack Orion” on their 1970 album “Cruel Sister”, and I have just discovered an uninterrupted recording of the full 18 minute song on You Tube:

Posted in Bach | Tagged , | Leave a comment

Frame Analysis with Excel

Starting from 2009 I have posted a series on frame analysis using Excel, starting from a simple “on-sheet” solution and working through to applications able to solve large 2D or 3D problems. To follow the analysis process it is best to read these posts in sequence, but the links between them are hidden in the comments, and in one case the link seems to be missing, so here is a list of all the frame analysis related posts, in date order:

This covers all the posts here directly related to the frame analysis spreadsheets.  There are also many related posts covering analysis of continuous beams, and on-going work on linking the frame analysis spreadsheets to Python based solver routines, and these may be found by selecting Frame Analysis in the Categories drop-down box in the top-right corner.

Posted in Excel, Frame Analysis, VBA | Tagged , , , | 1 Comment