## 7013 Reputation

16 years, 222 days

## Partitioning a cube into pyramids: An an...

Maple

Here is a little cute demo that shows how a cube may be paritioned into three congruent pyramids.  This was inspired by a Mathematica demo that I found in the web but I think this one's better :-)

A Cube as a union of three right pyramids

Here is an animated demo of the well-known fact that a cube may be partitioned

into three congruent right pyramids.

2020-05-21

 > restart;
 > with(plots):
 > with(plottools):

A proc to plot a general polyhedron.
list of vertices
list of faces

An entry  in describes a face made of the vertices  etc.

 > polyhedron := proc(V::list, F::list)   seq(plottools:-polygon([seq( V[F[i][j]], j=1..nops(F[i]))]), i=1..nops(F));   plots:-display(%); end proc:

Define the vertices and faces of a pyramid:

 > v := [[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1]]; f := [ [1,2,3,4], [5,2,3], [5,3,4], [1,5,4], [1,2,5] ];

Build three such pyramids:

 > P1 := polyhedron(v, f): P2 := reflect(P1, [[1,0,0],[1,1,0],[1,0,1]]): P3 := reflect(P1, [[0,1,0],[1,1,0],[0,1,1]]):

This is what we have so far:

 > display(P1,P2,P3, scaling=constrained);

Define an animation frame.  The parameter  goes from 0 to 1.

Any extra options are assumed to be plot3d options and are

passed to plots:-display.

 > frame := proc(t)   plots:-display(     P1,     rotate(P2, Pi/2*t, [[1,1,0],[1,0,0]]),     rotate(P3, Pi/2*t, [[0,1,0],[1,1,0]]),     color=["Red", "Green", "Blue"], _rest); end proc:

Animate:

 > display(frame(0) \$40, seq(frame(t), t=0..1, 0.01), frame(1) \$40,   insequence, scaling=constrained, axes=none,   orientation=[45,0,120], viewpoint=circleleft);

## Container sliding on the floor subject t...

Maple 2019

Here we simulate the motion of a container with a flat bottom that can slide on a horizontal surface subject to dry friction (Coulomb friction).  Installed inside the container is an ordinary mass/spring/damper system where the mass slides horizontally.  We impart an initial velocity to the container.  That sets the mass into motion which then affects the container's motion.  Under certain conditions the container will undergo a stick-slip motion which is evident in the simulation.

This simulation very roughly approximates the motion of a partially filled bucket of water that slides on the floor when kicked.  The idea arose in a discussoin with Carl Love and mmcdara:
https://www.mapleprimes.com/posts/211677-Mass-Spring-Conveyor-Belt-And-Dry-Friction

In the animation below, the container is shown in dark color when it slides against the floor, and light color when it sticks.

Worksheet: slosh.mw

## Mass, spring, conveyor belt, and dry fri...

Maple 2019

Here is an animation of a mass-spring system where the mass slides horizontally on a steadily moving conveyor belt.

The contact between the block of mass and the belt is of the dry friction kind (Coulomb's friction). Consequently the block periodically sticks to the belt and moves forward with it until the force of the stretching spring overcomes the force of friction and yanks it back, making it to slip against the belt. In the animation the block is shown in a dark color while slipping, and a light color while sticking.

The fully executed Maple worksheet can be slow to load and requires a good deal of memory. Therefore I have attached two versions which are identical in all respects except that in one of them I have removed the Maple output to make is easy to load if your computer has limitations.

Doiwnload worksheet (with Maple output) (sorry, exceeds MaplePrime's size limit)

## Preparing a parametrized surface for 3D ...

Maple

Although the graph of a parametrized surface can be viewed and manipulated on the computer screen as a surface in 3D, it is not quite suitable for printing on a 3D printer since such a surface has zero thickness, and thus it does not correspond to physical object.

To produce a 3D printout of a surface, it needs to be endowed with some "thickness".  To do that, we move every point from the surface in the direction of that point's nomral vector by the amount ±T/2, where T is the desired thickness.  The locus of the points thus obtained forms a thin shell of thickness T around the original surface, thus making it into a proper solid. The result then may be saved into a file in the STL format and be sent to a 3D printner for reproduction.

The worksheet attached to this post provides a facility for translating a parametrized surface into an STL file.  It also provides a command for viewing the thickened object on the screen.  The details are documented within that worksheet.

Here are a few samples.  Each sample is shown twice—one as it appears within Maple, and another as viewed by loading the STL file into MeshLab which is a free mesh viewing/manipulation software.

Here is the worksheet that produced these:  thicken.mw

## A finite difference scheme for the heat ...

Maple
 I describe here a finite difference scheme for solving the boundary value problem for the heat equation for the unknown temperature subject to the boundary conditions and the initial condition   This finite difference scheme is designed expressly with the goal of avoiding differentiating the conductivity , therefore  is allowed to be nonsmooth or even discontinuous. A discontinuous  is particularly important in applications where the heat conduction takes place through layers of distinct types of materials.   The animation below, extracted from the worksheet, demonstrates a solution  corresponding to a discontinuous .  The limit of that solution as time goes to infinity, which may be calculated independently and exactly, is shown as a gray line.