More about the album: The Very Thought of You

]]>On her second solo album the Grande Dame of British folk is presenting us with a surprising, inspired selection of songs. Most of the songs on this album come in pairs, and each has a story attached. Stories referring to Norma’s childhood memories or commenting contemporary events, most of them connected to famous personalities in the world of music; people as different and remarkable as Nick Drake, Judy Garland and Freddie Mercury. The mood is quiet yet lit by Norma’s powerful and passionately smooth voice, revealing new dimensions to well-known songs. Featuring Richard Thompson, Danny Thompson, Martin Carthy and Eliza Carthy.

Fortunately someone else had had the same problem, raised a question on Stackoverflow, then answered his own question about 12 hours later:

After deleting C:\Temp\gen_py, the code above works again. Hope it can save trouble!

The same trick also worked for me, and is continuing to work with no further problems.

My gen_py folder was located at c:\Users\douga\AppData\Local\Temp\gen_py\, even though my Python installation was on my D: drive, and just in case anyone might be concerned about deleting a system folder, it contains the message: “# Generated file – this directory may be deleted to reset the COM cache…”

]]>

I recently received a new version (4.4) of the numerical integration spreadsheet by Graeme Dennes which is now available for download from:

The new spreadsheet includes significant improvements in the performance of several functions, as well as new functions:

The Tanh-Sinh quadrature workbook has been enhanced as follows:

(1) A faster Tanh-Sinh program has been implemented, increasing the speed by around 50 percent, and the speed of the DE programs has been doubled.

(2) A fast finite interval program TINT has been added. It runs at over twice the speed of the Gauss-Kronrod program.

(3) The speed of the Gauss-Kronrod program has been improved through modifications developed by Berntsen, Espelid and Sorevik.

(4) The Plotter worksheet now shows two plots: the plot of the selected function over the finite interval (a,b), and the plot of the function after being transformed by the Tanh-Sinh function.

(5) Now includes over 1200 test integrals with results correct to 15 significant digits. This may be the largest set of diverse test integrals and results available at no cost. It includes several of the “standard” sets of test integrals in wide use.

(6) The Romberg integrator, written by the author, may be the fastest and most accurate Romberg integrator available. Advice to the contrary would be most welcome.

(7) Minor change to allow compatibility with Excel 2007.

Graeme Dennes

]]>

As before, the shear design results currently only cover the simplified shear design requirements.

]]>

What is not so well known, at least I didn’t know, is that this experiment has been repeated on Earth, at a much grander scale, at NASA’s space power facility:

]]>The depth of the Neutral Axis of a reinforced concrete section, under specified bending moment and axial load, can be found with the cubic equation below (click any image for full size view):

Derivation of the constants A to G is shown below. As before, the equation may either be solved using a Python function (FindDNA), or by evaluating a lambda function entered as text on the spreadsheet. In the former case the constants are passed to the function as an array; in the latter the constants are converted to their numerical value in the text on the spreadsheet, as shown below. Note that this is done automatically using the Eval function:

Results calling Func Type 1 (FindDNA) are shown below:

Using Func Type 2 (evaluating the text function on the spreadsheet) returns the same results. Note that the xl_BrentA arguments must be edited to remove the final argument (the array of constant values), otherwise the function will return an error. To edit an array function:

]]>

]]>

The solutions to this problem described below can be downloaded from:

and

The ItSolve.xlsb spreadsheet contains a user defined function (UDF) to solve iterative problems using Brent’s method, so the first approach was to modify this to return an array of results, with the input variables defined by a column and row of data, solving a function entered as text on the spreadsheet:

This works, but it is quite slow, taking about 10 seconds to return results for a 21 x 21 array. I then modified the UDF to work as a subroutine, solving a short VBA function, rather than the text string on the spreadsheet:

Function TempFunc(Coefficients As Variant, T As Double) Dim G_1 As Double, G_2 As Double, G_3 As Double, G_4 As Double, G_5 As Double, epsilon As Double, alpha As Double G_1 = Coefficients(1, 1) G_2 = Coefficients(2, 1) G_3 = Coefficients(3, 1) G_4 = Coefficients(4, 1) G_5 = Coefficients(5, 1) epsilon = Coefficients(6, 1) alpha = Coefficients(7, 1) TempFunc = G_1 * epsilon * T ^ 4 + G_2 * (T - 320) ^ 1.25 - G_3 * alpha - G_4 - G_5 End Function

Input and results are shown below:

A 3D contour plot can now be generated quickly using Excel’s “surface chart” option:

This reduced the computation time for the 21×21 matrix down to about 0.25 seconds.

The xlwings/Python spreadsheet xlwScipy3.xlsb also has a function using Brent’s method (linking to the Scipy brentq function). I have modified this to return results as a 2D array, with input of a single column and row of data:

Input for the Eng-Tips problem is shown below:

The xl_BrentA function will work on either a function entered as text on the spreadsheet, or link to a Python function. The screen-shot below shows results calling the Python function “TempFunc” (included in the download files).

Exactly the same results are generated using the text function on the spreadsheet:

Both options complete the calculation of the 21×21 array in about 5 milliseconds, about 50 times faster than the solution using a VBA function, or 2000 times faster than solving the string function entered on the spreadsheet!

PM claims Australia will meet Paris target ‘in a canter’ despite emissions climbing.

Morrison says rate of increase not as high as previous years and renewables investment will ensure Australia meets commitment

pm-claims-australia-will-meet-paris-target-in-a-canter-despite-emissions-climbing

What the government numbers say:

What the government numbers say when you look a little closer:

quarterly-update-australias-national-greenhouse-gas-inventory-march-2018

]]>To calculate the number of hours between two dates we can simply subtract the two values and multiply by 24. This returns a decimal value though. If we want the time in hours and minutes (or hours minutes and seconds), things get a bit more complicated:

The screen-shot shows various alternatives for displaying the number of hours between the date/time in cell B3 and the start of the date in B2.

The first row shows the result of multiplying the date difference by 24. This shows the correct result if formatted as a decimal, but if is formatted as time it shows the wrong value.

Microsoft recommends use of the Text function, with the format string “h:mm”. Note that the format string overrides the cell format, so the returned text displays the same regardless of the cell number format. This will work correctly for time differences up to 24 hours, but the display resets to zero after each 24hours, so the 36 hour time difference above displays as 12 hours. This can be changed to display days, hours and minutes with the format string “d:h:mm”.

Another approach is to leave the time difference as a date number and format to display as hours. The default time format has the same problem as the “h:mm” format string, so 36 hours displays as 12, but it is possible to display the correct number of hours:

- On the Home tab, select the Number Format dialogue.
- Select Custom, then h:mm.
- Edit in the Type box by putting square brackets around the h: “[h]:mm”.
- Time differences greater than 24 hours should now display correctly in hours and minutes (see cell F8 below).
- It is possible to use the same approach with the Text function (Row 9 below). Note that the time difference now displays in hours and minutes, regardless of the cell format.

Update 1 Oct 18: As noted by Doug Glancy in the comments, the [h]:mm:ss format is available from the format dialog. In my version (Office 365) it is at the end of the time formats, near the bottom of the custom format list.

]]>