10. Company Strategy/Issues
Internet search engines
Sales
Drive-through restaurants
DVDs
Analog TVs
Boeing 787
Electric vehicles
iPods
3-D game players
3D printers
Xbox 360
*
4 - *
74. of a future valueThis point is
actually the
mean of a
probability
distribution
Figure 4.9
4.0 –
3.0 –
2.0 –
1.0 –
| | | | | | |
0 1 2 3 4 5 6 7
Area payroll (in $ billions)
Nodel’s sales
(in$ millions)
3.25
Regression line,
89. =
Weight for period n( ) Demand in period n( )( )∑
Weights∑
=
Weight for period n
( )
Demand in period n
( )
( )
å
Weights
å
MAD =
Actual - Forecast∑
n
MAD=
Actual - Forecast
å
n
MSE =
Forecast errors( )
2
∑
n
90. MSE=
Forecast errors
( )
2
å
n
MSE =
Forecast errors( )
2
∑
n
=1,526.52 / 8 =190.8
MSE=
Forecast errors
( )
2
å
n
=1,526.52/8=190.8
MAPE=
100 Actuali −Forecasti
i=1
n
∑ / Actuali
n
95. Thus,
ˆ
y=56.70+10.54x
=
1,128
12 months
= 94
=
1,128
12 months
= 94
=
Average monthly demand for past 3 years
Average monthly demand
=
Average monthly demand for past 3 years
Average monthly demand
ŷseasonal = Index × ŷtrend forecast
ˆ
y
seasonal
=Index´
ˆ
y
trend forecast
96. ŷI = (1.30)($100,000)=$130,000
ŷII = (.90)($120,000)=$108,000
ŷIII = (.70)($140,000)=$98,000
ŷIV = (1.10)($160,000)=$176,000
ˆ
y
I
=(1.30)($100,000)=$130,000
ˆ
y
II
=(.90)($120,000)=$108,000
ˆ
y
III
=(.70)($140,000)=$98,000
ˆ
y
IV
=(1.10)($160,000)=$176,000
x =
x∑
6
=
18
6
= 3 y =
y∑
99. =
(y-y
c
)
2
å
n-2
Sy,x =
y2 −a y∑ −b xy∑∑
n−2
S
y,x
=
y
2
-ay
å
-bxy
åå
n-2
Sy,x =
y2 −a y∑ −b xy∑∑
n− 2
=
39.5−1.75(15.0)−.25(51.5)
6− 2
= .09375
100. = .306 (in $ millions)
S
y,x
=
y
2
-ay
å
-bxy
åå
n-2
=
39.5-1.75(15.0)-.25(51.5)
6-2
=.09375
=.306 (in $ millions)
r =
n xy− x y∑∑∑
n x2 − x∑( )
2
∑
⎡
⎣ ⎢
⎤
⎦ ⎥
n y2 − y∑( )
2
∑
104. y=1.80+.30x
1
-5.0x
2
=
(Actual demand in period i−Forecast demand in period i)∑
Actual−Forecast∑
n
=
(Actual demand in period i-Forecast demand in period i)
å
Actual-Forecast
å
n
MAD =
Forecast errors∑
n
=
85
6
=14.2
MAD=
Forecast errors
å
n
=
85
105. 6
=14.2
Tracking signal =
Cumulative error
MAD
=
35
14.2
= 2.5 MADs
Tracking signal=
Cumulative error
MAD
=
35
14.2
=2.5 MADs
Sample Computing Project Report
Square Plate in Orthogonal Guides
Keith D. Hjelmstad
June 19, 2015
106. Introduction
The subject of the investigation for the Sample Computing
Project is the
Square Plate in Orthogonal Guides. The system is illustrated in
Fig. 1.
The mechanism consists of a square plate of uniform thickness
and
dimension b that is constrained in such a way that two of its
corners must
move in orthogonal guides—one horizontal and the other
vertical. We
assume that the guides do not have friction and are restrained
against
motion in either direction (i.e., there is no possibility of uplift).
The corner
B is subjected to a constant force P acting vertically. As the
plate moves,
the corner C moves and the plate rotates (by an angle θ, as
shown in the
sketch). We assume that the guide that constrains point B can
pass by the
guide that constrains point C so that point B can actually move
below the
horizontal guide. The task is to describe the behavior of this
system.
In this report we first derive the equations of motion that are
implemented
in the code and verify the code by observing certain aspects of
the response
in certain specific scenarios. With the verified code we explore
several
aspects of the response of the system, including the influence of
the initial
angle, the initial angular velocity, and the magnitude of the
applied load. We extend the scope of the
107. problem slightly by adding a viscous damping term. We make
observations on the behavior of the horizontal
reaction force at point B under dynamic loads and we make an
observation about the geometry of the motion
of the corners of the plate as constrained by the guides. We also
comment on other aspects of the problem
which could be explored using the code, but are not covered in
this report.
Theory
Derivation of the equations of motion. The motion of the plate
can be completely characterized by the
angle θ, which depends upon time. The system is a rigid body
undergoing motion in a plane. The body must
respect balance of linear and angular momentum. There are no
mechanisms of energy dissipation (e.g.,
friction). Therefore, the system should conserve energy and we
can use that fact to derive the equations of
motion and verify the code. The full derivation of the equations
of motion can be found in Appendix B
(which is also the solution to HW problem 0.0.0).
Note that in the derivation we first characterize the motion with
two variables (θ and z) and subsequently
enforce the constraint that the motion must be along the guides
at the two constrained points. Note that due
to the kinematic description we have selected, the constraint at
point C is automatically satisfied. We achieve
the constraint at B by forcing the velocity at that point to be
zero in the 1e (horizontal) direction. Setting
1 0B ⋅
can use that relationship to eliminate the variable z
from our equations (but note that we sometimes still use z to
keep the algebra simpler).
108. P
b
b
B
C
θ
Fig. 1 Illustration of
application problem
Sample Computing Project Square Plate in Orthogonal Guides
2
The equations of motion for the system are—either from
conservation of energy or from balance of angular
momentum—given by the equation (see Appendix B for details
of the derivation)
( )3 34 2 cos sin 0
P g
W b
109. where 2W gbρ= is the total weight of the plate (density time
thickness times area), P is the applied force,
b is the length of the sides of the plate, g is the acceleration of
gravity, and ( )tθ is the angle that the plate
makes with the horizontal. The equation is a second-order,
nonlinear differential equation in the variable θ.
We will solve this equation numerically and include initial
in our program so that they can be varied and studied.
The horizontal reaction force at point B can be obtained from
balance of linear momentum. The magnitude
of this force is
(2)
The derivation of this expression can also be found in Appendix
B.
Equations for Numerical Analysis. The equations for numerical
integration of a second order dynamical
system were derived in the Course Notes entitled Numerical
Methods—integrating the equations of motion
(Hjelmstad, 2013). Let the angle, angular velocity and angular
acceleration at the discrete time nt t= be
denoted as follows:
The generalized trapezoidal rule allows us to estimate the
values of the angle and angular velocity at the
next time step 1n nt t t+ = + ∆ (where t∆ is the size of the time
step) as
( )
110. ( )
1 1
1 1
(1 )
(1 )
n n n n
n n n n
v v t a a
x x t v v
β β
β β
+ +
+ +
= + ∆ + −
= + ∆ + −
(4)
where β is a numerical analysis parameter (which we usually set
to 0.5). If we also satisfy the equation of
motion at the next time step, then we have enough equations to
solve for the three state variables at the new
time step. Those three equations, then, enable the solution of
the differential equation starting from known
initial conditions and marching forward in time. The equation of
111. motion in the discrete variables is
( )3 31 1 14 2 cos( ) sin( ) 0n n n
P g
a x x
W b+ + +
(5)
In anticipation of using Newton’s Method (see the Course Notes
entitled Newton’s Method—solving
nonlinear algebraic equations (Hjelmstad, 2013) for details) to
solve the equations of motion we define the
residual as
( )3 31 1 1 14 2( ) cos( ) sin( )n n n n
P g
g a a x x
W b+ + + +
(6)
The tangent for this residual is simply the derivative of g with
respect to its argument 1na +
( )1 3 31 1 14 2
112. 1
( )
1 sin( ) cos( )nn n n
n
g a P g
A x x
a W b
ζ++ + +
+
(7)
where 2 21 1( ) / ( ) (1 )n nd x d a tζ β+ += = ∆ − by virtue of
Eqn. (4) and as shown in detail in Appendix B. Note
that we have used the chain rule in the derivation of the tangent
matrix. Since there is only one variable the
Sample Computing Project Square Plate in Orthogonal Guides
3
tangent matrix is 1 1× . We can solve the equations in the code
by applying Newton’s method, with these
definitions. The code is given in Appendix A.
113. Code Verification. In order to verify that the code computes the
intended results we will consider several
verification scenarios. Because the governing equation of
motion is nonlinear there are no known analytical
solutions to compare the results to. However, we can verify that
the energy is conserved by plotting the
energy versus time (that is an independent verification because
we do not actually use conservation of
energy to advance the solution in the code). Figure 2 shows the
response of the system initially at rest with
P/W = 0.65.
We can also verify the code if we can specify initial conditions
and a force P that is in static equilibrium.
By statics, we can easily show that when the plate is initially at
rest then a force of 12P W= should hold
the plate in static equilibrium (at any angle). Figure 3 shows the
system with initial angle set to 0.4oθ =
0 5 10 15 20
0
5
10
15
t
T
(
bl
ue
116. ity
Angular Velocity vs. Time
Fig 2. Verification problem. Plate is initially at rest with
P/W=0.65. The energy plot
shows that the net energy (energy minus work done by the
load), shown in black,
remains constant. The kinetic energy is shown in blue, the
potential energy is shown
in red, and the work done by the load is shown in cyan.
0 1 2 3 4 5 6 7 8 9 10
-1
0
1
2
t
A
ng
le
Angle vs. Time
0 1 2 3 4 5 6 7 8 9 10
-1
-0.5
0
117. 0.5
1
t
A
ng
lu
la
r
V
el
oc
ity
Angular Velocity vs. Time
Fig 3. Verification problem. Plate has initial angle of θο = 0.4,
zero initial angular
velocity and load P=W/2. The plot shows that the angle remains
constant with zero
angular velocity (that is the definition of static).
Sample Computing Project Square Plate in Orthogonal Guides
4
118. with zero initial angular velocity. The plot of angle and angular
velocity versus time shows that the angle
remains constant. That is the definition of static. The picture
from the animation (a movie, which in this
case does not move) is shown to depict the (static) position of
the plate.
As a final verification, we can observe that values of 12P W<
should result in a downward motion
(counterclockwise rotation) initially because the weight of the
block should overcome the upward force and
values 12P W> should result in upward motion (clockwise
rotation) initially because the upward force
should overcome the weight. This observation is best done
through the animation. However, you can see
from Fig. 2 that in the case where the load trumps the weight
the angle initially moves in the positive
direction. According to our sign convention that is a clockwise
angle, as expected.
Study and Results
The physical system in this computing project is a very specific
one; in essence, it is a device. The aim of
the study for this project is to understand the behavior of the
device under various initial conditions and by
looking at it through various lenses (essentially the output
graphics generated by the code). We will try to
find general trends and make general conclusions about the
behavior. We will extend the scope of the
problem slightly by introducing a velocity-dependent damping
mechanism. To accomplish this task we will
need to augment our theory and add the new feature to the code.
The damped system will allow us to
examine the eventual static repose of the system when all of the
kinetic energy has been drained (through
damping) from the system.
119. General motion of the system. In the verification section we
have already been introduced to some aspects
of the motion of the system. Recall that Fig. 2 showed the
response of the system initially horizontal (θ =
0) and at rest, subjected to a load of P/W = 0.65. We have
already observed that the motion of the system
is initially in the direction of the load (i.e., the load overwhelms
the weight). Both the angle and angular
velocity move initially in the positive direction. One can
observe from those response curves that the angle
achieves a maximum of 1.57θ = radians. That means that the
plate rotates all the way to the other side
(180 degrees) before turning around and rotating back the other
way.
Another observation is that the velocity at the peak of the
motion (i.e., where the angle is greatest) is zero.
The angular velocity is the rate of change of the angle. When
the angle turns around, its rate of change must
pass through zero. This is, in fact, another verification of the
correctness of the code.
One can also see in Fig. 2 that the period of oscillation (time
between peaks) of the motion is approximately
8 seconds. The apparent period of oscillation of the energy is
exactly half that value. The reason that the
energy oscillates twice as fast as the motion itself, is a property
of energy. In motion, the system converts
potential to kinetic energy, and vice versa. The kinetic energy is
maximum when the motion is at its peak
and returns to its initial value (zero in this case) when the plate
reaches its extreme angle. Observe that the
angular velocity peaks twice in each cycle (once positive and
once negative).
120. Initial Angle. In Fig. 4 we examine the effect of varying the
initial angle for that same experiment. The
response curves show that the plate rotates exactly to the
complement of the initial angle, giving a
completely symmetric response. The first case oscillates
between 0 and π. The second case oscillates
between 0.3 and π−0.3. The third case oscillates between 0.6
and π−0.6.
The angular velocity curves in Fig. 4 do appear to pass through
zero at the same time, but seem to lose some
coherence as time goes on. The cause of this phenomenon is
unknown. It could be due to loss of accuracy
of the numerical integration, but reduction of the time step
seems to rule this out. Perhaps this phenomenon
is worthy of more study in the future (time and space do not
allow it here).
Sample Computing Project Square Plate in Orthogonal Guides
5
Initial velocity. We can examine the effects of changing the
initial angular velocity. Many of the trends are
best made from observing the animation of the motion. Some
experimentation with small values of P show
that the system tends oscillate like a pendulum for low initial
angular velocities. With no damping, there is
an initial angular velocity great enough to get the system
spinning. If damping is added for such a case, the
system will spin until it loses enough energy, after which it will
oscillate with decreasing amplitude until it
comes to rest in its static position. The magnitude of the force P
121. has a significant effect on the dividing line
between spinning and oscillating—the larger P is, the more
inclined the system is to oscillate. The force
acts as a stabilizing influence.
Load magnitude. Experiments with changing the magnitude of
the load showed that no matter how large
or small the load is, the tendency of the plate to oscillate
between the initial angle and its complement did
not change. This result is not intuitively obvious (at least not to
me). Energy is put into the system only
through the load P. One might imagine that P could put larger
and larger amounts of energy in by increasing
the magnitude of P. With more energy in it seems like the plate
should be flung further and further. Figure
5 shows the case with an initial angle of θo = 0.2 and a large
load ratio of P/W = 10. The extremes of the
0 2 4 6 8 10 12 14 16 18 20
0
0.5
1
1.5
2
t
A
ng
le
122. Angle vs. Time
0 2 4 6 8 10 12 14 16 18 20
-1
-0.5
0
0.5
1
t
A
ng
lu
la
r
V
el
oc
ity
Angular Velocity vs. Time
Fig 4. Study of the effect of initial angle. The system in
initially at rest in each case, but the initial angle is θo
=0.0, 0.3, and 0.6. No matter what the force P the plate
rotates only to the complementary angle and back again.
123. 0 2 4 6 8 10 12 14 16 18 20
0
0.5
1
1.5
t
A
ng
le
Angle vs. Time
Fig 5. Study of the effect of increasing the magnitude of
the load P. The system in initially at rest with initial
angle is θo =0.2. The load ratio is P/W =10. The effect is
to increase the frequency of the motion, but the
amplitude remains the same as P/W =0.65.
Sample Computing Project Square Plate in Orthogonal Guides
6
oscillation are not affected by the large load. The main effect of
the larger load ratio is that the frequency
of the oscillation is dramatically increased. The reason we
124. cannot put arbitrary amounts of energy into the
system is that the mechanism pulls back on the load during part
of the motion, thereby extracting energy
back out of the system.
The horizontal reaction at B. From the perspective of
design, it is interesting to examine the behavior of the
reaction forces in the dynamic scenario. How strong do
the guides need to be? For the static case the horizontal
reaction at point B is always zero. For dynamic motion it
is not. Figure 6 shows a plot of the horizontal reaction
force (normalized by the value of the weight W) for the
case of an initially horizontal plate starting at rest with
P/W = 0.65.
As expected the reaction force is not zero. It oscillates
back and forth at magnitude about equal to the weight of
the plate (for this case). Notice also that the nature of the
motion is not the (roughly) sinusoidal response of the
angle and angular velocity. Half way between the
extremes of motion the reaction force changes most
rapidly and it changes from negative to positive and vice
versa. The shape of the response curve changes
significantly as the load level P/W changes.
The effect of varying the load (as a fraction of the weight) is
shown in Table 1. The system starts from rest
in the horizontal position, subjected to the load magnitude
given. The largest horizontal reaction occurs
when there is no load applied to the system (i.e., the plate
simply falls under its own weight). At the static
load (P/W=0.5) there is no reaction (and no motion). For load
values above the static load the amplitude of
the horizontal reaction gets larger again. For values of P/W>2
the reaction gets larger and larger.
125. Table 1. Effect of load ratio on horizontal reaction
P/W NB/W P/W NB/W
0.00 18.9 0.55 0.44
0.10 15.1 0.60 0.88
0.20 11.4 0.70 1.77
0.30 7.57 0.80 2.65
0.40 3.78 0.90 3.53
0.45 1.89 1.00 4.42
0.50 0.00 2.00 13.2
Damped motion. In order to explore damped motion we must
augment our equations of motion with a
velocity-dependent term. The coefficient of the velocity
dependent term is called the damping coefficient.
It is not important to ascribe a physical origin or value to this
constant for the study, except to note that you
can increase the effects of damping by making the damping
coefficient larger and decrease them by making
it smaller. Damping continuously takes energy out of the
system. The equation of motion with damping is
(see Appendix B)
Fig 6. Angle (top) and horizontal reaction
at point B (bottom) versus time. The plate
is initially at rest with P/W=0.65.
0 2 4 6 8 10 12 14 16 18 20
0
0.5
1
1.5
126. 2
t
A
ng
le
Angle vs. Time
0 2 4 6 8 10 12 14 16 18 20
-2
-1
0
1
2
t
N
B
/W
Reaction at B vs. Time
Sample Computing Project Square Plate in Orthogonal Guides
127. 7
( )3 34 2 cos sin 0
P g
W b
where µ is the damping constant (which will be a user-specified
value in the code). The residual and tangent
for Newton’s method are easily computed to be
( )3 31 1 1 1 14 2( ) cos( ) sin( )n n n n n
P g
g a a v x x
W b
µ+ + + + +
(9)
and
( )1 3 31 1 14 2
1
( )
128. 1 sin( ) cos( )nn n n
n
g a P g
A x x
a W b
µη ζ++ + +
+
= = + − −
(10)
where 1 1( ) / ( ) (1 )n nd v d a tη β+ += = ∆ − , in accord with
the generalized trapezoidal rule (and the chain rule).
The code is very simple to change to account for this additional
term (note that the code in Appendix B has
this term in it).
Figure 7 shows a case with damping. The system starts in the
horizontal position at rest with load ratio of
P/W = 0.65, as before. The damping takes energy out of the
system, which you can see from the energy plot
in the figure. The black line is the total net energy. The total net
energy levels off to a minimum value as
time goes on. The motion damps to a static position (i.e., when
none of the fields change with time). It is
obvious (at least in retrospect) that the static position is the one
where the hinges in the guides align with
the direction of the applied force.
Motion of the corners. There is one final observation on the
129. response of this system that is worth pointing
out. In the animations we include a tracer line (the position for
recent times) for the corners. It is not a
surprise that the motions of the constrained points B and C are
straight lines along the guides. It is somewhat
surprising to find that the other corners also trace straight lines
along a 45 degree line. Figure 8 shows these
lines for a snapshot of a certain motion.
Upon reflection it might be an obvious geometric truth about
the two constraints. In fact, one should be
able to prove that the position of the corners must lie along
these lines. The proof is beyond the scope of
this report. It is worth noting that seeing is believing and it is
unlikely that anyone would think to make
such a proof without first seeing it in the animation.
0 5 10 15 20 25 30 35 40
0
0.5
1
1.5
t
A
ng
le
Angle vs. Time
0 5 10 15 20 25 30 35 40
130. -0.5
0
0.5
1
t
A
ng
lu
la
r
V
el
oc
ity
Angular Velocity vs. Time
Fig 7. Damped motion. The system in initially horizontal and at
rest with P/W = 0.65. The damping coefficient
is set to µ=0.2. Observe how the motion damps to the static
value. The snapshot of the animation shows that the
static position has the hinges aligned with the load. The viscous
damping removes energy from the system.
0 5 10 15 20 25 30 35 40
0
132. ac
k)
Energy and Work vs. Time
Sample Computing Project Square Plate in Orthogonal Guides
8
Other aspects. The code is a very general solution to this
problem. Any of the physical parameters could be studied in
more detail. We have considered some of those, and even
within those studies, only a small number of parameter values.
We have not looked at the effects of varying some of the
parameters, e.g., the dimension b of the plate or the total
weight W.
It would also be possible to examine the performance of the
numerical integration scheme. In particular, we could vary the
time step to determine what value is needed to get good
accuracy. For these computations we have used 0.01t∆ = ,
which appears to be sufficiently accurate.
It would not be difficult to modify the formulation to have a
load P that varies with time. We could use such a code to
model a process like a string pull to start an engine. We could
then try to find an optimal pulling strategy to get the plate
spinning as fast as possible (for a certain input of work). Many
other extensions are possible.
Conclusions
This report has documented the derivation of the equations of
133. motion for a square plate with opposite
corners constrained to move in orthogonal guides. The system is
a single degree of freedom system that can
be described in terms of the angle of rotation of the plate as a
function of time. The equations of motion are
nonlinear, but they can be integrated numerically. The code in
Appendix A carries out the numerical
integration and produces graphical response (including an
animation, which cannot be shown in a static
report).
In the study we explored the effects of the initial angle, the
magnitude of the load (relative to the weight of
the plate), the evolution of the horizontal reaction at point B,
and the static position (by way of damped
equations of motion). We discovered that the response is always
symmetric with the plate oscillating
between the initial angle and its complement, independent of
the magnitude of the load. Changing the
magnitude of the load change the frequency of oscillation of the
system (with larger loads giving higher
frequencies). The reaction force at point B showed non-
sinusoidal oscillations with magnitudes that varied
with the applied load P (whereas the reaction is zero for the
static case).
References
K. D. Hjelmstad. (2013). Numerical Methods—integrating the
equations of motion. Course notes for CEE
212 Engineering Mechanics II—Dynamics. Arizona State
University.
K.D. Hjelmstad (2013). Newton’s Method—a method to solve
nonlinear algebraic equations. Course notes
for CEE 212 Engineering Mechanics II—Dynamics. Arizona
State University.
134. Fig 8. Snapshot of plate in motion from the
animation. The blue lines are the recent
positions of the corners the yellow dot is
point B, the white dot is point C.
Sample Computing Project Square Plate in Orthogonal Guides
9
Appendix A. MATLAB code.
% *-------------------------------------------------------------------*
% | Sample CP -- Square Plate (Implicit Version)
|
% | Square plate constrained to move in horizontal and
guides |
% | and pulled up by a constant force. This code adds a drag
term |
% | that models friction in the glides (not part of the
Assessment |
% | problem) this helps to see how the system would get to a
|
% | final static configuration (it lets the dynamics damp out).
|
% *-------------------------------------------------------------------*
clear; clc;
%.... Print Banner to command window
fprintf('%sn','*------------------------------------------------*')
fprintf('%sn','| Sample CP |')
fprintf('%sn','| K. D. Hjelmstad |')
135. fprintf('%sn','| |')
fprintf('%sn','| Original Version: 10.25.2013 |')
fprintf('%sn','| Latest Update: 06.23.2015 |')
fprintf('%sn','*------------------------------------------------*')
%.... Input physical problem data
gravity = 9.81; % acceleration of gravity (m/s^2)
Wt = 4; % Total weight of plate
b = 5; % plate dimension (m)
pr = 2.0; % Ratio of applied force to weight
P = pr*Wt; % Total force
drag = 0.0; % drag coefficient
%.... Initial conditions and analysis start and end times
xo = 0.0; % initial angle of plate
vo = 0.0; % initial angular velocity of plate
to = 0.0; % initial time (usually zero)
tf = 20; % final time (end of analysis)
%.... Compute coefficient of equation of motion (constant)
c = (3-6*pr)*gravity/(4*b); % coefficient of equation
%.... Compute an estimate of the maximum angular velocity (xo
= 0)
omax = sqrt(vo^2 + 2*(1-sqrt(2))*c);
%.... Numerical analysis parameters. Put all parameters that are
% associated with the numerical methods here. For implicit
methods
% you can put the parameters that describe and control
Newton's method.
dt = 0.01; % analysis time step
beta = 0.5; % numerical integration parameter
tol = 1.e-8; % Newton iteration tolerance
itmax = 10; % Newton max no. iterations
eta = (1-beta)*dt; % Integration parameter
136. zeta = eta^2; % Integration parameter
%.... Select figures to plot (1=yes, 0=no)
dofig1 = 1; % theta and omega vs. time
dofig2 = 0; % energy vs. time
dofig3 = 0; % theta vs. omega
dofig4 = 1; % Reaction at B vs time.
dofig5 = 0; % Simulation movie
%.... Set up a history array to save results ever once in a while
% This part is simply to avoid plotting every point that we
compute
% It does not take that many points to give a nice
representative
% response curve. We need to compute more points to get
accuracy in
% the solution.
nitems = 18; % number of items stored in history
nreport = 4000; % number of steps to output
nsteps = ceil((tf-to)/dt); % total number of analysis time
steps
nreport = min(nreport,nsteps); % report only what you
compute
noutput = ceil(nsteps/nreport); % set frequency of output
history = zeros(nreport,nitems); % initialize storage for
history
Sample Computing Project Square Plate in Orthogonal Guides
10
%.... Echo input values to screen
137. fprintf('rr%sn', ' PHYSICAL PROPERTIES ')
fprintf('%s%8.3fn', ' b (plate width) ',b)
fprintf('%s%8.3fn', ' pr = (P/W) ',pr)
fprintf('%s%8.3fn', ' Maximum angular velocity (est.)
',omax)
fprintf('%s%8.3fn', ' Initial time (to) ',to)
fprintf('%s%8.3fn', ' Final time (tf) ',tf)
fprintf('rr%sn', ' INTEGRATION OF EQUATIONS
')
fprintf('%s%8.3fn', ' Time increment (dt) ',dt)
fprintf('%s%8.3fn', ' Numerical integration (beta)
',beta)
fprintf('%s%8in', ' Number of time steps
',nsteps)
fprintf('%s%8in', ' Number of steps to report
',nreport)
fprintf('%s%8in', ' Output frequency (no. of steps)
',noutput)
fprintf('rr%sn', ' INITIAL CONDITIONS ')
fprintf('%s%8.3fn', ' Initial position (xo) ',xo)
fprintf('%s%8.3fn', ' Initial velocity (vo) ',vo)
%.... Set time and output counters to get ready to start analysis
t = to; out = 0; iout = 0; its = 0;
%.... Initialize position and velocity (put in 'xold' and 'vold'
arrays)
xold = xo;
vold = vo;
%.... Compute initial acceleration from the equation of motion
aold = -c*(cos(xold) - sin(xold)) - drag*vo;
%.... Compute motion by numerical integration--loop over time
138. steps
for i=1:nsteps
%....... Write the values out to history, if appropriate
% This segment writes a row to 'history' every 'noutput'
steps
% Note that for quantities that are not needed to advance
the
% numerical solution (e.g., speed and xcomp) we only need
to
% compute them if it is an output step.
if (out==0)
iout = iout + 1;
%......... compute the locations of the four corners
nvec = [ sin(xold); cos(xold)];
mvec = [-cos(xold); sin(xold)];
x1 = -(sin(xold) - cos(xold))*b*[1; 0];
x2 = x1 + b*mvec;
x3 = x2 + b*nvec;
x4 = x1 + b*nvec;
xc = [ x1', x2', x3', x4'];
%......... Compute work and energy
T = (Wt*b^2/(3*gravity))*vold^2; % Kinetic
energy
U = Wt*b*(cos(xold) + sin(xold))/2; % Potential
energy
Work = P*b*(cos(xold) + sin(xold) - 1); % Work of
force
netE = T + U - Work; % Energy - Work
%......... Compute reaction force at B
csum = cos(xold) + sin(xold);
cdif = cos(xold) - sin(xold);
NB = -(b/2)*(aold*csum + vold^2*cdif);
%......... Write results to 'history' array
history(iout,:) =
[t,xold,vold,aold,its,xc,T,U,Work,netE,NB];
139. out = noutput;
end
out = out - 1;
%....... Compute the values of the state for the next time step
t = t + dt;
%....... Initialize Newton loop
err = 1.0; its = 0;
bn = xold + vold*dt + aold*beta*(1-beta)*dt^2;
cn = vold + aold*beta*dt;
anew = aold;
Sample Computing Project Square Plate in Orthogonal Guides
11
%....... Compute new acceleration from equation of motion
while (err > tol) && (its < itmax)
its = its + 1; % iteration
xnew = bn + zeta*anew; % angle
vnew = cn + eta*anew; % ang. vel.
g = anew + c*(cos(xnew) - sin(xnew)) + drag*vnew; %
residual
A = 1 - c*zeta*(sin(xnew) + cos(xnew)) + drag*eta; %
Tangent
anew = anew - g/A; % ang. accel.
err = norm(g); % error
end % while loop
%....... Compute new angular velocity and angle by trapezoidal
rule
140. vnew = vold + dt*(beta*aold + (1-beta)*anew);
xnew = xold + dt*(beta*vold + (1-beta)*vnew);
%....... Put current state (new) into old slot to get ready for new
step
% Note that this approach allows us to only store two states
as
% we carry out the calculation: 'old' and 'new'
aold = anew;
vold = vnew;
xold = xnew;
end % loop over time steps
max (history(:,18))
%.... GRAPHICAL OUTPUT SECTION
% In this section we create plots to display the results that
were
% stored in the array history. Each row of history contains
the values
% of the response at a given time. The value "iout" refers to
the last
% row number in history. Thus, history(1:iout,1) is time, etc.
xmina = floor(min(history(1:iout,6:13)));
xmaxa = ceil(max(history(1:iout,6:13)));
xmin = min((xmina)); xmax = max((xmaxa));
xsize = max(abs(xmin),abs(xmax));
%.... Plot time history of angle
if (dofig1==1)
fig=figure(1); clf;
subplot(2,1,1); grid on; hold on;
xlabel('t'); ylabel('Angle'); title('Angle vs. Time');
p = plot(history(1:iout,1),history(1:iout,2));
set(p,'Color','b','LineWidth',1.5);
141. subplot(2,1,2); grid on; hold on;
xlabel('t'); ylabel('Anglular Velocity');
title('Angular Velocity vs. Time');
p = plot(history(1:iout,1),history(1:iout,3));
set(p,'Color','r','LineWidth',1.5);
end % dofig1
%.... Plot energy vs. time
if (dofig2==1)
fig=figure(2); clf;
grid on; axis square; hold on;
xlabel('t'); ylabel('T (blue), U (red), Wk (cyan), E
(black)');
title('Energy and Work vs. Time');
p = plot(history(1:iout,1),history(1:iout,14));
set(p,'Color','b','LineWidth',1.5);
p = plot(history(1:iout,1),history(1:iout,16));
set(p,'Color','c','LineWidth',2);
p = plot(history(1:iout,1),history(1:iout,15));
set(p,'Color','r','LineWidth',1.5);
p = plot(history(1:iout,1),history(1:iout,17));
set(p,'Color','k','LineWidth',2);
end % dofig2
%.... Plot phase portrait
if (dofig3==1)
fig=figure(3); clf; grid on; axis square; hold on;
xlabel('Angle'); ylabel('Angular Velocity');
Sample Computing Project Square Plate in Orthogonal Guides
12
142. title('Phase Portrait');
p = plot(history(1:iout,2),history(1:iout,3));
set(p,'Color','r','LineWidth',2);
end % dofig3
%.... Reaction at B vs. time
if (dofig4==1)
fig=figure(4); clf;
subplot(2,1,1); grid on; hold on;
xlabel('t'); ylabel('Angle');
title('Angle vs. Time');
p = plot(history(1:iout,1),history(1:iout,2));
set(p,'Color','b','LineWidth',2);
subplot(2,1,2); grid on; hold on;
xlabel('t'); ylabel('NB/W');
title('Reaction at B vs. Time');
p = plot(history(1:iout,1),history(1:iout,18));
set(p,'Color','g','LineWidth',2.5);
end % dofig4
%.... Plot 3D simulation as a movie
if (dofig5==1)
fig5=figure(5);
kframes = 10; kforget = 5;
numframes = floor(iout/kframes);
for k=1:numframes
rect = get(fig5,'Position'); rect(1:2) = [0 0]; axis equal;
grid on; axis ([-xsize xsize -xsize xsize]);
xlabel('x'); ylabel('y');title('Animation');
hold on;
%........ Plot the guide tracks
yb1 = [-xsize, xsize]; xb1 = [0,0];
xb2 = [-xsize, xsize]; yb2 = [0,0];
plot(xb1,yb1,'Color','k','Linewidth',15);
143. plot(xb2,yb2,'Color','k','Linewidth',15);
plot(xb1,yb1,'Color','g','Linewidth',11);
plot(xb2,yb2,'Color','g','Linewidth',11);
%........ Plot the traces of the path of the tip of the corners
kk = k - kforget; kk = (kk + abs(kk))/2;
istart = 1 + kframes*kk; iend = kframes*k;
p = plot(history(istart:iend,6),history(istart:iend,7));
set(p,'Color','b','LineWidth',1);
p = plot(history(istart:iend,8),history(istart:iend,9));
set(p,'Color','b','LineWidth',1);
p = plot(history(istart:iend,10),history(istart:iend,11));
set(p,'Color','b','LineWidth',1);
p = plot(history(istart:iend,12),history(istart:iend,13));
set(p,'Color','b','LineWidth',1);
%........ Plot the four sides of the box
for iii=1:4
i1 = (iii-1)*2+6; i2 = i1+1; i3 = i2+1; i4 = i3+1;
if (iii==4)
i3 = 6; i4 = 7;
end
xb = [history(iend:iend,i3),history(iend:iend,i1)];
yb = [history(iend:iend,i4),history(iend:iend,i2)];
plot(xb,yb,'Color','k','Linewidth',2);
end % loop on iii
%........ Plot the rollers in the guides
plot(history(iend:iend,6), history(iend:iend,7),...
'o','MarkerFaceColor','w','Linewidth',2,...
'MarkerEdgeColor','k','MarkerSize',11);
plot(history(iend:iend,10), history(iend:iend,11),...
'o','MarkerFaceColor','y','Linewidth',2,...
'MarkerEdgeColor','k','MarkerSize',11);
144. Sample Computing Project Square Plate in Orthogonal Guides
13
%........ Put timer in upper left corner
time = num2str(history(iend,1),'%4.1f');
xplace = -xmax*0.65;
yplace = xmax*0.85;
text(xplace,yplace,time,...
'FontSize',16,'HorizontalAlignment','right')
%........ Store frame for movie (set view point)
M(:,k) = getframe(fig5,rect);
clf;
end % loop over frames
%...... Play (and record) movie with play speed factor faster that
actual
clf; N=1; PlaySpeed = 5;
FPS = ceil(PlaySpeed*numframes/tf);
movie(fig5,M, N,FPS,rect)
end % dofig5 block
fprintf('r%sr',' Normal Termination of Program')
%.... End of program Sample CP
CEE 212—Dynamics
147. 1
1
( , , ) ( ) ( ) ( )
( ) ( , , )
x y t z t x t y t
z t x y t
= + +
= +
x e n m
e r
Geometry
2e
1e
( )tθ
A
nm
O 1( )z t e
r
x
y
148. ( , , )
( , , )
x y t x y
x y t x y
= +
= −
r n m
p m n
( )
( )
x y
x y
x y
x y
θ
θ
θ
θ
= +
= − +
= −
149. = −
= +
=
r n m
m n
p
p m n
n m
r
It will also be convenient to introduce a (non-unit) vector r
from corner D to the typical particle A in terms of the spatial
variables x and y (which measure distance in the n and m
directions, respectively):
( , , )x y t x y= +r n m
150. We can also introduce a (non-unit) vector p, orthogonal to r
( , , )x y t x y= −p m n
Note that the time derivative of r is related to p as shown in
the box at right.
Note that we have introduced the time-dependent variable
z(t) to help describe the motion. Due to the two constraints at
points B and C, z is not independent of θ. However, it will be
convenient to sort out the constraint once we compute the
velocity.
Relationships between r and p:
P
b
b
B
C
θ
D
CEE 212—Dynamics
Arizona State University
Sample Computing Project
Keith D. Hjelmstad
152. We know that at point B (x=b, y=b) the velocity is only in the
e2 direction. We can use this constraint to
eliminate z as a variable. Note that the velocity constraint at C
is already satisfied by the kinematics
( )
( )( )
( )
( )
( )
1
1 1 1
1 10
0 cos sin
cos sin
B
B
z b
z b
z b
z b
z b
153. θ
θ
θ
θ θ θ
θ θ θ
= − −
⋅ = − − ⋅
= − ⋅ − ⋅
= + +
= − +
x e m n
x e e m n e
m e n e
154. ( )
( )
( ) ( ){ } { }
1
1
2 2
1
1 sin cos
cos sin
cos sin sin cos
b
b
b
θ θ
155. θ θ θ θ
θ θ θ θ θ θ θ θ
= − + − +
= − + −
= − + + − + − −
x e r
x e p
x e p r
If we implement the constraint into the
position vector we have
( )
( ) ( )
2
1
2
1
156. z
z x y x y
θ θ
θ θ
= − +
= − − − +
x e p r
e m n n m
where zo is constant. The first derivative of
this expression, with respect to time, is
( )sin cos oz b zθ θ= − − +
Note that we have found out that the rate
of change of z is a function of the rate of
change of θ. Hence, only one of these is
independent. We can integrate this
equation to find how z is related to θ.
What if z turned out to be
157. ( )cos
That is the expression we have. Therefore,
the expression for z is the correct integral
of the velocity constraint equation we have
derived.
( )1 1sin cosoz b θ θ= − − +x e e r
It appears that zo is unknown, but its value really
only depends upon where we take the origin O. If
we select the origin to be located a position a
distance b to the right of the intersection of the
guides (i.e., zo=−b) then the final expressions for
the position, velocity, and acceleration vectors are
OK, so we got rid of z because it is not independent from θ.
However, for algebra purposes, it will be
convenient to continue to use z, knowing that we can, in the
end, substitute the expression in terms of θ.
1
1
2
1
z
z
z
θ
158. θ θ
= +
= −
= − +
x e r
x e p
x e p r
( )
( )
( ) ( ){ }2
1 sin cos
cos sin
cos sin sin cos
z b
z b
160. potential energies of the system as follows:
( ) ( )
( ) ( )( )
( ) ( ) ( ) ( )
1
2
1
1 12
2 2 2 21
2
2 2 2 21 1
2 2
( , ) ( , )
2 cos sin
cos sin ( )
A
A
A
A A A A
T x y x y dA
z z dA
161. z z x y x y dA
z dA z x dA z y dA x y dA
ρ
ρ θ θ
ρ θ θ θ θ
ρ θ θ ρ θ θ ρ θ ρ
= ⋅
= − ⋅ −
= − + + +
= − − + +
∫
∫
∫
∫ ∫ ∫ ∫
x x
e p e p
162. ( ) ( )
[ ] [ ]
2 2 2 2
0
3 31 1
3 30 00 0
4 22 2
3 3
b b
A o
b bb b
x y dA x y dx dy
x y x y
W
b b
g
163. ρ ρ
ρ ρ
ρ
+ = +
= =
∫ ∫ ∫
( )1 1
cos sin
x y
x yθ θ
⋅ = − ⋅
= − −
p e m n e
1 2
1 2
sin cos
cos sin
θ θ
θ θ
= +
164. = − +
n e e
m e e
[ ] [ ]
[ ] [ ]
0 0
2
0 0
0 0
2
0 0
b b
A
b b
b b
A
b b
g dA g dx dy
g x y g b
dA dx dy
x y b
166. A
b b
b b
A
b b
x dA x dx dy
x y b
y dA y dx dy
y x b
ρ ρ
ρ ρ
ρ ρ
ρ ρ
=
=
∫ ∫ ∫
∫ ∫ ∫
167. The expressions have several integrals over the area of
the domain. These can be evaluated as follows:
A.2. Identify initial (or other special) conditions. This problem
will be implemented as a CP so we will
employ general initial conditions so that they can be varied
when we run the program
( )
2
1 2
( , )
cos sin
A
A
A A
U g x y dA
g z x y dA
g x dA g y dA
ρ
ρ
168. θ ρ θ ρ
= ⋅
= − + + ⋅
= +
∫
∫
∫ ∫
x e
e n m e
( )312 cos sinU bρ θ θ= +
( )( )
2
2 2 21 1 1
2 2 3cos sin
b
T z z b b
g
ρ
Evaluating the integrals gives:
( )
169. ( )
( )
22 2 2
2 2
cos sin
cos sin
cos sin
z b
z b
b z b
θ θ θ
θ θ θ
θ θ θ θ
= +
= +
= +
173. 0
t
B B
t
C C
W dt
W dt
= ⋅ =
= ⋅ =
∫
∫
N v
N v
We can compute the work done by the forces as
( ) ( )
4
2 31 1
3 2 cos sin cos sin 1P
b
E T U W b Pb
174. g
ρ
L. Conservation of energy. Total energy (which is conserved if
we account for the work put in). The total
net energy is
The work done by the normal forces is zero because they are
orthogonal to the velocity at that point (the velocity is along
the guide, the normal force is normal to the guide).
( ) ( )cos sin 1 sin cosd
dt
Note that we can check the anti-derivative by
taking the derivative of the result and showing
that it gives us back our integrand.
Note that without putting any work into the system, energy is
constant. If we add positive work (i.e., force
in the same direction of velocity) then the amount of energy
increases. Therefore, T + U = WP + const.
(i.e., the current energy is the constant plus the work put in).
Therefore, the total net energy should be
conserved.
We can use conservation of energy to determine the equation of
motion
( ) ( )
4
175. 2 31 1
3 2 cos sin cos sin 1
b
E b Pb
g
ρ
( ) ( )
( )( )
4
32 1
3 2
4
32 1
3 2
sin cos sin cos
cos sin 0
d b
E b Pb
dt g
b
b Pb
176. g
ρ
θ θ ρ θ θ θ θ θ θ
ρ
θ ρ θ θ θ
= + − + − − +
( )3 34 2 cos sin 0
P b
W g
θ θ θ
For this equation to be true for all time, noting that while
angular velocity might be zero at certain times it
is certainly not zero for all time, the term in square brackets
must be zero. Hence, dividing through by the
leading term in front of the first term, we get the equation of
178. 2 2
1 2 2 2 1
B C A A
B C A A
B C A A A A
P g dA dA
N N P g dA z dA
N N P g dA z dA x dA y dA
ρ ρ
ρ ρ θ θ
ρ ρ ρ θ θ ρ θ θ
+ + − =
+ + − = − + + −
∫ ∫
∫ ∫
∫ ∫ ∫ ∫
N N e e x
179. e e e e e p r
e e e e e m n n m
( ) ( )
( ) ( ) ( )( )
2 2 3 2 3 21 1
1 2 2 2 1 2 2
2 2 3 21
1 2 1 2
B C
B C
N N P gb b z b b
N N P gb b z b
ρ ρ ρ θ θ ρ θ θ
ρ ρ ρ θ θ
+ + − = − − − +
180. + + − = + − + +
e e e e e m n n m
e e e n m n m
( ) ( )( )
( ) ( )( )
2 3 21
12
3 21
22
B
C
N b z b
N W P b
ρ ρ θ θ
ρ θ θ
181. = + − + + ⋅
= − + − + + ⋅
n m n m e
n m n m e
1 2
1 2
sin cos
cos sin
θ θ
θ θ
= +
= − +
n e e
m e e
( )
( )
( )
( )
1
182. 1
2
2
sin cos
sin cos
cos sin
cos sin
θ θ
θ θ
θ θ
θ θ
+ ⋅ = −
− ⋅ = +
+ ⋅ = +
− ⋅ = −
n m e
n m e
n m e
183. n m e
We can find the integrals we need from the earlier results. If we
use those here we end up with the
following equations.
We can dot this equation successively with e1 and e2 to get
expression for the two reaction forces in terms
of the motion variables.
The dot products can be evaluated as shown at right
( ) ( )( )
( ) ( )( )
2 3 21
2
2 3 21
2
sin cos sin cos
cos sin cos sin
B
C
N b z b
N b P b
ρ ρ θ θ θ θ θ θ
ρ ρ θ θ θ θ θ θ
186. = +
= −
× = +
n e e
n e e
m e e
m e e
n m e
r n m
p m n
r p e
( ) ( )( )
( ) ( )( ) ( ) ( )( )
( ) ( )( )
( ) ( )( )
2 3 21
2
3 2 3 21
2
3 21
2
3 21
2
sin cos sin cos
187. sin cos sin cos sin cos sin cos
sin cos sin cos
sin cos sin cos
BN b z b
b b
b
b
ρ ρ θ θ θ θ θ θ
ρ θ θ θ θ θ θ ρ θ θ θ θ θ θ
ρ θ θ θ θ θ θ
ρ θ θ θ θ θ θ
= + + + −
= − + + − + + + −
= − + + −
= − + + −
188. ( ) ( ) ( ) ( )
( )
( ) ( ) ( ) ( )( ) ( ) ( )( )
( ) ( )
2 1 2
2
1
2 2 1 1 2 2
1
3 3 3 3 3sin cos sin cos cos sin
BA
A
BA
A A
B AA
x y g dA b N P
z dA
189. g x g y dA bN b P
z dA dA
g x y dA b N b N b P b P
ρ
ρ θ θ
ρ ρ
ρ ρθ
ρ θ θ θ θ θ
+ × − + + × +
−
∫
∫
∫
∫ ∫
∫
190. n m e m n e e
r e p r
n e m e m × e n × e m × e n × e
r e r p
e e e e e
( )
( ) ( ) ( )
( )
3
2 2
3 3 3
31
3 32
3 41 2
3 32 3
cos sin
191. cos sin sin cos cos sin
cos sin
A A
B
x z y z dA x y dA
b bN bP
b z b
θ
ρ θ ρ θ ρ θ
ρ θ θ θ θ θ θ
ρ θ θ ρ θ
− − + − −
= + −
∫ ∫
3
e
e e e
e e e
192. e e
E.2. Then, balance of angular momentum about point C gives
Dot this equation with e3 and substitute the expressions for the
reactions and the second derivative
of z to get
The expressions for the reaction forces still contain z. We can
eliminate it by recalling that
From the kinematics section (Part C)
( )3 34 2 cos sin 0
P b
W g
θ θ θ
which is the same as the equation we got from conservation of
energy. This calculation again shows that
193. the two approaches give identical results. The details of the
calculation is a bit different in each case (there
are some similarities) and sometimes one approach is quite a bit
simpler than the other.
Substituting, we get
( ) ( )( )
( ) ( )( )
3 21
2
2 3 21
2
sin cos sin cos
cos sin cos sin
B
C
N b
N b P b
ρ θ θ θ θ θ θ
ρ ρ θ θ θ θ θ θ
= − + + −
= − + − + +
195. P b
a x x
W g
+ + + +
+ + +
We can implement this problem in a CP format. The residual
can be expressed at time step tn+1 as
( )
( )
3 3
4 2
3 3
4 2
1 sin cos
1 sin cos
rgA
196. a
P b d
W g da
P b
W g
θ
θ θ
ζ θ θ
∂
=
∂
= −
Where an+1 is the angular acceleration at time tn+1. We can
write the angle and angular velocity in terms of the angular
acceleration a using the generalized trapezoidal rule as
{ }
{ }
( ){ }
1 1
197. 1
1
1 1
1
2 2 2
1
1
(1 )
(1 )
(1 )
(1 ) (1 )
(1 ) (1 )
n n n n
n n n
n n
n n n n
n n n n n
n n n n
n n
198. v v t a a
v t a t a
c a
x x t v v
x t v v t a t a
x t v t a t a
b a
β β
β β
η
β β
β β β β
β β β
ζ
+ +
+
+
+ +
+
+
199. +
= + ∆ + −
= + ∆ + ∆ −
= +
= + ∆ + −
= + ∆ + − + ∆ + ∆ −
= + ∆ + − ∆ + ∆ −
= +
(1 )
n n nc v t a
t
β
η β
= + ∆
=∆ −
2
2 2 2
(1 )
(1 )
n n n nb x t v t a
200. t
β β
ζ β η
= + ∆ + − ∆
=∆ − =
1
1
1
1
n
n
n
n
d x
d a
d v
d a
ζ
η
+
201. +
+
+
=
=
The tangent is the derivative of the residual with respect to its
argument:
One of the things we would like to do in our study is add a
viscous damping term to the equation of motion:
( )3 34 2 cos sin 0
P b
W g
θ µθ θ θ
Now the residual and tangent are:
Damping coefficient (user specified)µ =
( )3 31 1 1 1 14 2( ) cos sinr n n n n n
P b
202. g a a v x x
W g
µ+ + + + + +
( )3 3 1 14 21 sinx cosn n
P b
A x
W g
µη ζ + +
( )
( )
( )
n n
n n
n n
x t
v t
204. The benchmark case will be used to demonstrate
that your code works for the in-class code check.
CP 2 - STRAIN TRANSFORMATION FOR UNIFORM
MOTION
Deformation Gradient and Strain Tensor
----- F ----- ----- E -----
1.500 0.200 0.645 0.280
0.200 1.300 0.280 0.365
Principal Strains
e1 = 0.818 e2 = 0.192
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
y
205. z
Deformed and Undeformed Block
0.5536
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
y
z
Deformed and Undeformed Block
0.0000
Original orientation
Principal orientation
206. 0.2 0.3 0.4 0.5 0.6 0.7 0.8
-0.3
-0.2
-0.1
0
0.1
0.2
0.3
Mohrs Circle
CEE 213—Deformable Solids The Mechanics Project
Arizona State University CP 2—Multiaxial States
1
Computing Project 2
Multiaxial States
207. The computing project Multiaxial States concerns the analysis
of strain and stress at a point
in a solid body. The goal is to write a MATLAB program that
will allow the computation
of the strain associated with a prescribed motion and the stress
associated with that strain
through Hooke’s Law. We will compute principal values,
maxima, and graphically repre-
sent the state by mapping the motion both in the (x,y)
coordinates and in the principal co-
ordinates. Finally, we will produce Mohr’s circle to represent
the state.
The theory needed to execute this project is contained in the
Course Notes entitled Multi-
axial Strain.
The general steps are as follows:
1. Specify the components of the deformation tensor (matrix) F
and use it to compute
strain tensor E. The tensor F is the mapping matrix. We can use
it to compute the
deformed location of points that we identify in the undeformed
configuration (e.g.,
the vertices of the initial square of material).
2. Develop code to plot both the undeformed square and the
deformed version of it.
Establish the vertices of the square with the points (0,0), (1,0),
(0,1), and (1,1).
Compute the deformed positions of those points using F.
3. Compute the angle for the principal directions along with the
principal values of
208. strain. Develop code to plot the undeformed and deformed
square defined in the
coordinate system associated with the principal directions (i.e.,
take the initial
square to have its sides along those directions and map the
vertices to find the
deformed body.
4. Compute the stresses associated with the strains by virtue of
Hooke’s law for plane
strain.
5. Solve the problem of finding principal values using the
eigenvalue solver (the
“eig” command) in MATLAB. Output the principal values of
stress, the maximum
shear stress, and plot Mohr’s circle for the stress state. Do the
same for the strain.
6. Examine the implications of different states of strain. For
example:
a. What happens in a state of uniform dilatation (elongation
without shear-
ing)?
b. Verify that pure shear has principal directions at 45 degrees
from the orig-
inal orientation of the block.
CEE 213—Deformable Solids The Mechanics Project
Arizona State University CP 2—Multiaxial States
2
209. c. Show that the principal directions for stress and strain are the
same. Is this
due to the nature of Hooke’s Law? Do you expect it to be true
for all ma-
terial models?
d. Explore any other feature of the problem that you find
interesting.
e. Extend the code to do three dimensional states of strain for an
extra nice
project. Note that this step is not required but you are
encouraged to do it
to earn top marks. The visualization plots (especially the
deformed and
undeformed cube need to be rendered in 3D).
Write a report documenting your work and the results (in accord
with the specification
given in the document Guidelines for Doing Computing
Projects). Post it to the Critviz
website prior to the deadline.
Please consult the document Evaluation of Computing Projects
to see how your project
will be evaluated to make sure that you can get full marks. Note
that there is no peer review
process for reports in this course.