Rouben Rostamian

MaplePrimes Activity

These are Posts that have been published by Rouben Rostamian

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.






A proc to plot a general polyhedron.
V = [[x, y, z], [x, y, z], () .. (), [x, y, z]]                list of vertices
F = [[n__1, n__2, () .. ()], [n__1, n__2, () .. ()], () .. (), [n__1, n__2, () .. ()]]  list of faces

An entry "[`n__1`,`n__2`. ...]" in Fdescribes a face made of the vertices "V[`n__1`], V[`n__2`], ...," etc.

polyhedron := proc(V::list, F::list)
  seq(plottools:-polygon([seq( V[F[i][j]], j=1..nops(F[i]))]), i=1..nops(F));
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] ];

[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [0, 0, 1]]

[[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 t goes from 0 to 1.

Any extra options are assumed to be plot3d options and are

passed to plots:-display.

frame := proc(t)

    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:


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);





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:

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



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.

Download worksheet (no Maple output)

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

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:



I describe here a finite difference scheme for solving the boundary value
problem for the heat equation

"(&PartialD; u)/(&PartialD; t)= ((&PartialD;)^)/((&PartialD;)^( )x^)(c(x)(&PartialD; u)/(&PartialD; x)) + f(x,t)   a<x<b,   t>0"

for the unknown temperature u(x, t)subject to the boundary conditions

u(a, t) = alpha(t), u(b, t) = beta(t), t > 0

and the initial condition

"u(x,0)=`u__0`(x),    a < x < b."


This finite difference scheme is designed expressly with the goal of avoiding

differentiating the conductivity c(x), therefore c(x) is allowed to be

nonsmooth or even discontinuous. A discontinuous c(x) 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 c(x).  The limit of that solution as time goes to

infinity, which may be calculated independently and exactly, is shown as a gray

Download worksheet:


1 2 3 Page 2 of 3