Wednesday, March 12, 2014

Subscripts and Nested Arrays


  The use of subscripts in mathematics came about as a effort to simplify the terms of a series. In 1827 Thomas Jarrett proposed a system of algebraic notation which included the subscript and superscript notation that is now used with Σ and Π for sums and products. An appendix on the system can be found in a 1829 work by Brooke. Prior to that a sequence of points was often indicated by letters given in alphabetical order and this was a common practice in Geometry. This can be found in the works of ancient mathematicians such as Euclid and Ptolemy. The use of Greek letters to designate a list of stars in a constellation was originated by Bayer in 1603 and refers to the position of stars in the heavens. In Ptolemy's star catalog the order of the stars are in order of longitude and latitude in a constellation. Bayer's notation is a lot in common with the index notation.

  The use of nested arrays in programming came about in the 1970's as an improvement of APL by I. P. Sharp Associates and was used with time sharing computers. This Canadian company also was an early developer of packet systems and email which are now used with cell phones and over the internet. A lot of computer programs use the function notation with parenthesis to designate the components of vectors and matrices such as v(i) and m(i,j) for example. Mathcad follows the mathematics convention of using subscripts.

  Placing objects in a package the way that the spheres and cylinders are nested in a vector for the ball and stick models is similar to the use of clay tokens by the Sumerians. With the use of nested arrays we don't have to just use numbers as the values of the components of an array. So, none of the ideas that I used for the ball and stick models are new except maybe the use of Mathcad to do them.

Tuesday, March 11, 2014

Mathcad 3D Graphics - Bucky Ball


  Carbon atoms can be placed at the vertices of a truncated icosahedron to form a molecule known as Buckminsterfullerene. The ball and stick model for the truncated icosahedron can be modified by changing the radius of the balls to give a more realistic molecule.


Saturday, March 8, 2014

Mathcad 3D Graphics - Polyhedra


  My primary motivation for boosting Mathcad's graphics capabilities was to do a ball and stick model based on some regular and irregular polyhedra such as the icosahedron and the truncated icosahedron. I originally used the 3D scatter plot but had the problem with the extraneous lines when I tried to connect the points. It simplifies matters if you can let the computer determine what lines to include in the table containing the link point indices. This was accomplished by first finding the nearest neighbors of each point and then entering a line in the table if the index of the end point was greater than that of the initial point. This avoids plotting duplicate lines.



Mathcad 3D Graphics - Chemistry Ball & Stick Models


  I modified the sticks function program to use a matrix table containing the lines to be drawn in a model and tried doing a couple of Chemistry ball and stick models. I modified the tetrahedral model used previously to create a ball and stick model of methane and another of ethane. Rotating the model of ethane allows one to view and capture it from different angles.



Thursday, March 6, 2014

Mathcad 3D Graphics - Ball & Stick Glitchs


  It's a little surprising that the ball and stick surface plots actually work as well as they do. The 3D plotter doesn't appear to be designed to handle complex data sets. Nor is its matrix handling capabilities quite up to the task. Mathcad 11 does have a limited capability for handling nested matrices (those whose elements are also matrices). So I was able to simplify the process for creating a ball and stick model but had to write a few Mathcad programs to compute the spheres and cylinders and stack them. It would be better to use an indexed set of objects to be plotted but the plotter wasn't designed to handle them. Using the stacked matrices produces lines linking the objects if one tries to draw the grids on their surfaces. But one normally would not be interested in that much detail.


For the tetrahedral model one needs to know the positions of the vertices and some parameters to specify the dimensions of the balls and sticks.


The coordinates of the points were initially chosen for convenience and then translated so that the origin was at their mean. Next the set of balls, B, was found using the balls function and the set of sticks, S, using the sticks function. Both B and S contain nested sets of arrays of points and had to be converted into stacked matrices for the plotter. We see from the following data that B is a nested vector with four rows and S has 6 rows. They contain the 4 balls and 6 sticks. Each sphere in B has 20 lines of "latitude" and 30 lines of "longitude" while for the cylinders there are 20 and 10 respectively with two extra lines of longitude for the center points of the spheres and end points of the cylinders. For each point of latitude and longitude there is a 3 dimensional point.


The plotter just needs the two sets of three coordinates to plot the surfaces.


In this case all six links were needed for the model but in general one would probably have to use a table to specify which lines are to be plotted. For chemistry ball and stick models of atoms one would have to plot each set of atoms separately giving them different colors.

Wednesday, March 5, 2014

Mathcad 11 3D Graphics - Ball & Stick Models


  One do surface plots of more complicated surfaces such as ball and stick models with Mathcad 11. I started with a simple dumbbell shape consisting of two spheres and a connecting rod. One can plot both spheres at the same time by stacking the two matrices containing a grid of points on their surfaces. The rod is a simple cylinder shape and is done separately. Each group of objects can be assigned separate surface properties.


The technique can be used to draw more complicated ball and stick figures such as a simple tetrahedral model.


One can change the point of view for the 3D surface plot by clicking and holding a point in the plot then dragging it to a new position. This makes it easier to visualize more complicated objects.

Mathcad 11 3D Graphics


  After taking a little break from doing posts during February I got around to exploring the 3D graphics capabilities of Mathcad 11 a little further. One can make models of solid objects and I started out with a simple torus.


This simple torus can be morphed into more complicated shapes by modifying the mathematical equations used to define the surface.


To create a surface one starts by defining a simple curved line, x, that forms the "backbone" for the surface. The curve's tangent, t, and a normal, e, perpendicular to the unit vector in the direction of the third axis are needed to define a matrix, y, specifying some of the points of the surface. The 3D plotter uses the matrices specifying the set of coordinates (ξ, η, ζ) to create a surface graph.


The 3D plotter's dialog box can be used to change the appearance of the object's surface and one can make the shape of the surface more complicated. One can also use lighting to add a little more realism.