3D plots with the latest Matplotlib

Installing Python on a new computer, I found I had to downgrade Matplotlib to release 3.5.2 to get my 3D plotting functions to work. Further investigation found that the problem was the Axes3D function.

Changing:

    ax = axes3d.Axes3D(fig)
to:
ax = fig.add_subplot(1,1,1, projection='3d')

the 3D plotting functions worked without further changes to the code. Some additional functionality was also added:

  • The new “roll” angle and focal length attributes were addded.
  • The calculation of the viewpoint coordinates offset and the zoom factor were modified.
  • Scroll bars were added to the spreadsheet to control the zoom factor and viewpoint location.

The new code for the Plot3D function and the new Plot Frame spreadsheet can be downloaded from:

Matplotlib3D.zip.

New spreadsheet:

Posted in Animation, Coordinate Geometry, Drawing, Excel, Link to Python, Newton, NumPy and SciPy, PyXLL, UDFs | Tagged , , , , , , | 2 Comments

Installing Python and pyxll from scratch

Updated 28th September 2022. Matplotlib latest version OK.

I recently installed Python and pyxll (plus the required additional libraries) on a new computer, which raised a few problems with incompatible versions, so here is a summary of what worked (as of 26th September 2022):

Office should be installed and working before starting the Python installation. Then download and install Python Rel. 3.10.7 (must be the same bit number as Excel). Make sure that the options to install pip and tcl/tk and IDLE are selected.

When Python is installed the pip library installer can be used to install the rest of the required packages, including pyxll. To install pyxll (see here for more details) enter at a command line:

pip install pyxll
pyxll install

As a minimum, numpy, scipy and pandas should also be installed. For many of the applications published on this blog the numba jit compiler is also required:

pip install numpy
pip install scipy
pip install pandas
pip install numba

For applications requiring the solution of large sparse matrix equations the pypardiso library is recommended as being much faster than the sparse solvers included in scipy. This may now be installed simply with pip:

pip install pypardiso

For working with text based equations and units the following libraries are required:

pip install sympy
pip install pint

Note that sympy requires mpmath for multi-precision arithmetic, but this is now included in the pip installation.

For plotting graphics (including 3D graphs and animations) the following libraries are required. Note that the specific kaleido release listed below is required. My code has now been updated so that the latest release of matplotlib works without problems. (Updated 28Sep22).

pip install matplotlib
pip install plotly
pip install kaleido==0.1.0post

If earlier or later releases of matplotlib or kaleido have been installed, they can be replaced with the required release with:

pip install –upgrade matplotlib
pip install –upgrade kaleido==0.1.0post

The “–upgrade” command will work to either “upgrade” or “downgrade” the installed package.

Finally, the sectionproperties application, including all required additional libraries, may now be simply installed with:

pip install sectionproperties

Posted in Animation, Arrays, Charts, Coordinate Geometry, Differential Equations, Excel, Finite Element Analysis, Link to Python, Maths, Newton, Numerical integration, NumPy and SciPy, Python Pandas, PyXLL, UDFs | Tagged , , , , , , , , , , , , , , | Leave a comment

Australasian Engineering Heritage Conference 2022

https://www.engineersaustralia.org.au/event/2022/03/australasian-engineering-heritage-conference-2022-41536

The Australasian Engineering Heritage Conference will be held at the Engineers Australia Sydney offices at 44 Market Street, Sydney on 12-13 October 2022.

The theme of the conference is: Transport and Communications: Looking Forward – Looking Back.

In addition to a wide range of speakers on engineering heritage and heritage engineering, there will be two very notable keynote speakers: Howard Collins, Chief Operations Officer in Transport for NSW, and Pamela Henderson, Executive Director, Technical Services in Transport for NSW. At the end of the first day there will be an informal networking dinner, when the guest speaker will be Scott MacGregor, the well-known railway presenter and tour guide. There will also be site tours on the second afternoon to Central Station Clocktower and the new Metro Station at Central.

For more information and to register see:

Australasian Engineering Heritage Conference 2022

Posted in Historic Bridges, Newton | Tagged | Leave a comment

RC Design Functions 9.02; DevLength function

The RC Design Functions spreadsheet has now been updated to Version 9.02, and is available for free download from:

RC Design Functions9.zip

Changes in the new version include:

The new DevLength function returns reinforcement development length to AS 3600, AS 5100, Eurocode 2, or BS 5400 requirements. An example of the function can be found on the “UMom Out” sheet:

The function output returns the development length followed by the required code factors, which are different for each code:

On the same sheet, the MaxAx function has been updated to return all values:

On the “UShear” sheet examples have been added of the ShearCapEC2 and ShearCapBS5400 functions, which can also be called from the UMomPF function. There is also a correction to the shear capacity results to AS 3600 and AS 5100:

Finally, the shear results from the UMom function have been updated so that the full results are returned with array input of applied actions. See the “Array exmples” sheet for an example:

Posted in Beam Bending, Concrete, Excel, Newton, UDFs, VBA | Tagged , , , , , , , , , , | Leave a comment

Stereograms

Click for full size view

Stereograms, when looked at the right way, reveal a hidden 3D image, or perhaps a hidden message.

The example above was created at:

Easy Stereogram Builder

As well as a very simple tool to create your own stereograms, there are many excellent examples, and background information on ways to see the hidden image.

Another one of mine:

The World in 3D
Posted in Newton | Tagged , | Leave a comment