Rouben Rostamian

MaplePrimes Activity


These are Posts that have been published by Rouben Rostamian

Maple's pdsolve() is quite capable of solving the PDE that describes the motion of a single-span Euler beam.  As far as I have been able to ascertain, there is no obvious way of applying pdsolve() to solve multi-span beams.  The worksheet attached to this post provides tools for solving multi-span Euler beams.  Shown below are a few demos.  The worksheet contains more demos.

 

A module for solving the Euler beam with the method of lines

beamsolve

 

The beamsolve proc solves a (possibly multi-span) Euler beam equation:``

"rho ((∂)^2u)/((∂)^( )t^2)+ ((∂)^2)/((∂)^( )x^2)(EI ((∂)^(2)u)/((∂)^( )x^(2)))=f"

subject to initial and boundary conditions.  The solution u = u(x, t) is the

transverse deflection of the beam at point x at time t, subject to the load
density (i.e., load per unit length) given by f = f(x, t). The coefficient rho 

is the beam's mass density (mass per unit length), E is the Young's modulus of

the beam's material, and I is the beam's cross-sectional moment of inertia

about the neutral axis.  The figure below illustrates a 3-span beam (drawn in green)
supported on four supports, and loaded by a variable density load (drawn in gray)
which may vary in time.  The objective is to determine the deformed shape of the
beam as a function of time.


The number of spans, their lengths, and the nature of the supports may be specified

as arguments to beamsolve.

 

In this worksheet we assume that rho, E, I are constants for simplicity. Since only
the product of the coefficients E and I enters the calculations, we lump the two

together into a single variable which we indicate with the two-letter symbol EI.

Commonly, EI is referred to as the beam's rigidity.

 

The PDE needs to be supplied with boundary conditions, two at each end, each

condition prescribing a value (possibly time-dependent) for one of u, u__x, u__xx, u__xxx 
(that's 36 possible combinations!) where I have used subscripts to indicate

derivatives.  Thus, for a single-span beam of length L, the following is an admissible

set of boundary conditions:
u(0, t) = 0, u__xx(0, t) = 0, u__xx(L, t) = 0, u__xxx(t) = sin*t.   (Oops, coorection, that last
condition was meant to be uxxx(L,t) = sin t.)

Additionally, the PDE needs to be supplied with initial conditions which express

the initial displacement and the initial velocity:
"u(x,0)=phi(x),   `u__t`(x,0)=psi(x)."

 

The PDE is solved through the Method of Lines.  Thus, each span is subdivided into

subintervals and the PDE's spatial derivatives are approximated through finite differences.

The time derivatives, however, are not discretized.  This reduces the PDE into a set of

ODEs which are solved with Maple's dsolve().  

 

Calling sequence:

        beamsolve(L, n, options)

 

Parameters:

        L:  List of span lengths, in order from left to right, as in [L__1, L__2 .. (), `L__ν`].

        n The number of subintervals in the shortest span (for the finite difference approximation)

 

Notes:

• 

It is assumed that the spans are laid back-to-back along the x axis, with the left end
of the overall beam at x = 0.

• 

The interior supports, that is, those supports where any two spans meet, are assumed
to be of the so-called simple type.  A simple support is immobile and it doesn't exert
a bending moment on the beam.  Supports at the far left and far right of the beam can
be of general type; see the BC_left and BC_right options below.

• 

If the beam consists of a single span, then the argument L may be entered as a number
rather than as a list. That is, L__1 is equivalent to [L__1].

 

Options:

        All options are of the form option_name=value, and have built-in default values.

        Only options that are other than the defaults need be specified.

 

        rho: the beam's (constant) mass density per unit length (default: rho = 1)

        EI: the beam's (constant) rigidity (default: EI = 1)

        T: solve the PDE over the time interval 0 < t and t < T (default: T = 1)

        F: an expression in x and t that describes the applied force f(x, t)  (default: F = 0)
        IC: the list [u(x, 0), u__t(x, 0)]of the initial displacement and velocity,  as
                expressions in x (default: IC = [0,0])

        BC_left: a list consisting of a pair of boundary conditions at the left end of
                the overall (possibly multi-span beam.  These can be any two of
                u = alpha(t), u_x = beta(t), u_xx = gamma(t), u_xxx = delta(t). The right-hand sides of these equations

                can be any expression in t.  The left-hand sides should be entered literally as indicated.

                If a right-hand side is omitted, it is taken to be zero.   (default: BC_left = [u, u_xx] which

                corresponds to a simple support).

        BC_right: like BC_left, but for the right end of the overall beam (default: BC_right = "[u,u_xx])"

 

The returned module:

        A call to beamsolve returns a module which presents three methods.  The methods are:

 

        plot (t, refine=val, options)

                plots the solution u(x, t) at time t.  If the discretization in the x direction

                is too coarse and the graph looks non-smooth, the refine option

                (default: refine=1) may be specified to smooth out the graph by introducing

                val number of intermediate points within each discretized subinterval.

                All other options are assumed to be plot options and are passed to plots:-display.

 

        plot3d (m=val, options)

                plots the surface u(x, t).  The optional m = val specification requests

                a grid consisting of val subintervals in the time direction (default: "m=25)"

                Note that this grid is for plotting purposes only; the solution is computed

                as a continuous (not discrete) function of time. All other options are assumed

                to be plot3d options and are passed to plots:-display.

 

        animate (frames=val, refine=val, options)

                produces an animation of the beam's motion.  The frames option (default = 50)

                specifies the number of animation frames.  The refine option is passed to plot
                (see the description above. All other options are assumed to be plot options and
                are passed to plots:-display.

Note:

        In specifying the boundary conditions, the following reminder can be helpful.  If the beam

        is considered to be horizontal, then u is the vertical displacement, `u__x ` is the slope,  EI*u__xx

        is the bending moment, and EI*u__xxx is the transverse shear force.

 

A single-span simply-supported beam with initial velocity

 

The function u(x, t) = sin(Pi*x)*sin(Pi^2*t) is an exact solution of a simply supported beam with

"u(x,0)=0,   `u__t`(x,0)=Pi^(2)sin(Pi x)."  The solution is periodic in time with period 2/Pi.

sol := beamsolve(1, 25, 'T'=2/Pi, 'IC'=[0, Pi^2*sin(Pi*x)]):
sol:-animate(size=[600,250]);

The initial condition u(x, 0) = 0, u__t(x, 0) = 1  does not lead to a separable form, and

therefore the motion is more complex.

sol := beamsolve(1, 25, 'T'=2/Pi, 'IC'=[0, 1]):
sol:-animate(frames=200, size=[600,250]);


 

A single-span cantilever beam

 

A cantilever beam with initial condition "u(x,0)=g(x),  `u__t`(x,0)=0," where g(x) is the
first eigenmode of its free vibration (calculated in another spreadsheet).  The motion is
periodic in time, with period "1.787018777."

g := 0.5*cos(1.875104069*x) - 0.5*cosh(1.875104069*x) - 0.3670477570*sin(1.875104069*x) + 0.3670477570*sinh(1.875104069*x):
sol := beamsolve(1, 25, 'T'=1.787018777, 'BC_left'=[u,u_x], 'BC_right'=[u_xx,u_xxx], 'IC'=[g, 0]):
sol:-animate(size=[600,250]);

If the initial condition is not an eigenmode, then the solution is rather chaotic.

sol := beamsolve(1, 25, 'T'=3.57, 'BC_left'=[u,u_x], 'BC_right'=[u_xx,u_xxx], 'IC'=[-x^2, 0]):
sol:-animate(size=[600,250], frames=100);


 

A single-span cantilever beam with a weight hanging from its free end

 

sol := beamsolve(1, 25, 'T'=3.57, 'BC_left'=[u,u_x], 'BC_right'=[u_xx,u_xxx=1]):
sol:-animate(size=[600,250], frames=100);


 

A single-span cantilever beam with oscillating support

 

sol := beamsolve(1, 25, 'T'=Pi, 'BC_left'=[u=0.1*sin(10*t),u_x], 'BC_right'=[u_xx,u_xxx]):
sol:-animate(size=[600,250], frames=100);


 

A dual-span simply-supported beam with moving load

 

Load moves across a dual-span beam.

The beam continues oscillating after the load leaves.

d := 0.4:  T := 4:  nframes := 100:
myload := - max(0, -6*(x - t)*(d + x - t)/d^3):
sol := beamsolve([1,1], 20, 'T'=T, 'F'=myload):
sol:-animate(frames=nframes):
plots:-animate(plot, [2e-3*myload(x,t), x=0..2, thickness=1, filled=[color="Green"]], t=0..T, frames=nframes):
plots:-display([%%,%], size=[600,250]);


 

A triple-span simply-supported beam with moving load

 

Load moves across a triple-span beam.

The beam continues oscillating after the load leaves.

d := 0.4:  T := 6: nframes := 100:
myload := - max(0, -6*(x - t)*(d + x - t)/d^3):
sol := beamsolve([1,1,1], 20, 'T'=T, 'F'=myload):
sol:-plot3d(m=50);
sol:-animate(frames=nframes):
plots:-animate(plot, [2e-3*myload(x,t), x=0..3, thickness=1, filled=[color="Green"]], t=0..T, frames=nframes):
plots:-display([%%,%], size=[600,250]);

z3d;


 

A triple-span beam, moving load falling off the cantilever end

 

In this demo the load move across a multi-span beam with a cantilever section at the right.

As it skips past the cantilever end, the beam snaps back violently.

d := 0.4:  T := 8: nframes := 200:
myload := - max(0, -6*(x - t/2)*(d + x - t/2)/d^3):
sol := beamsolve([1,1,1/2], 10, 'T'=T, 'F'=myload, BC_right=[u_xx, u_xxx]):
sol:-animate(frames=nframes):
plots:-animate(plot, [1e-2*myload(x,t), x=0..3, thickness=1, filled=[color="Green"]], t=0..T, frames=nframes):
plots:-display([%%,%], size=[600,250]);


 


Download worksheet: euler-beam-with-method-of-lines.mw

 

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

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

 

Download square-partitioned-into-pyramids.mw

 

 

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

 

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) block-sliding-on-conveyor-belt-stripped.mw

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:  thicken.mw

 

 

1 2 Page 1 of 2