University of the Philippines DilimanCollege of
EngineeringINSTITUTE OF CIVIL ENGINEERING
CE 28 ANALYTICAL AND COMPUTATIONAL METHODS IN CIVL ENGINEERING
III2nd Semester AY 2014-2015
SHEAR STRESSES OF PRISMATIC SHAFTS WITH CIRCULAR AND TRIANGULAR
CROSS-SECTIONS
Submitted by:
Baniqued, Julius Rey2012-
Tuppil, Camille G.2012-24733
CE 28 TXY
Submitted to:
Mr. William MataInstructor
Date Submitted:
March 18, 2015
PROGRAM IMPLEMENTATION
DECLARATION OF LIBRARIES AND VARIABLESThis program makes use of
an external library matrix.h composed of matrix functions. In the
first part of the program, this library, along with other standard
libraries, were called. The value of the constant pi is also
defined.
The output of this program is a file named shear.csv. This CSV
file will contain a table of values showing the shear stress in
regularly-spaced points within the cross-section of a beam. The
program creates this file at the start of the program.
INPUTThe program first asks the user if the cross-section of the
beam is circular or triangular.
The program then proceeds to ask for other significant values
such as Internal Torque (T) in N-m, Length of Shaft (L) in m, Shear
Modulus of Elasticity (G) in Pa, radius of cross-section (r) in m
for circular cross-sections (cs=1).
For triangular cross-sections (cs=2), the program also asks for
Internal Torque (T) in N-m, Length of Shaft (L) in m, Shear Modulus
of Elasticity (G) in Pa. The program also asks for the length of
one side of the triangle (b) in m. This program assumes that the
triangle is equilateral and one side is parallel to the
horizontal.
COMPUTING FOR J, POLAR MOMENT OF INERTIAThe program proceeds to
compute for the polar moment of inertia J and the angle of twist
theta for the cross-section.
For circular cross-sections:
For triangular cross-sections:
SETTING UP THE GRID MATRIX UAfter the user provides the interval
h, the program can start setting up the grid matrix U. This matrix
represents the beams cross-section and will be the one printed in
the output CSV file. The number of grid points is computed and
stored in variable k where
For circular cross-sections,
For triangular cross-sections,
K is then set as the number of rows and columns for Matrix
U.
SETTING UP THE BOUNDARY CONDITIONSThe program makes sure that
only the grid points inside of the designated area are considered.
If the grid point is outside the circle or triangle, the program
gives it a value of 0. If the grid point is inside, the program
gives it a preliminary value or count. This serves as a number for
each grid point. The variable count also determines the number of
equations needed to solve for the Prandtl Stress Function .
For circular cross-sections:
For triangular cross-sections,
SETTING UP CONSTANT MATRIX ASetting up the constant matrix A is
the first step to computing for the values of the Prandtl Stress
Function . The number of rows and columns of matrix A is the
variable count minus 1. This ensures that the number of rows and
columns (equations) corresponds to the number of points inside the
cross-section. The program first gives all elements of Matrix A a
value of 0.
The program proceeds to set values of Matrix A based on the
values of Matrix U. If the element is in the main diagonal of the
matrix, a value of -4 is assigned to it. For any other element, the
program checks its corresponding element in Matrix U. If the
surrounding elements of element A in Matrix B is not zero, the
program assigns a value of 1 for the corressponding surrounding
element in Matrix A.
For both circular and triangular cross-sections:
SETTING UP MATRIX BMatrix B represents the other side of the
matrix equation (Ax = B). The program sets up Matrix B as a column
matrix with values equal to -2G for both circular and triangular
cross-sections.
SOLVING FOR MATRIX XUsing a Gauss-Jordan function, the program
obtains a column matrix X containing the values of for each point
in the grid.
TRANSFORMING MATRIX X INTO MATRIX PBecause Matrix X is a column
matrix, another square matrix P created to contain the values of in
grid form.
GETTING THE DERIVATIVE OF THE PRANDTL STRESS FUNCTION Because
solving for the shear stress at each point requires the derivative
of the function , a process for getting the derivative of each
point in the Matrix P is required. This part of the program uses
finite difference formulas (central, forward and backward) to
compute for the derivatives.
This part of the program also computes the shear stress of each
point in the grid using the given formula for shear stress:
The computed shear stress is stored into its corresponding
element in Matrix U.
OUTPUTThe output is printed in a CSV file containing the values
of grid Matrix U.
SAMPLE OUTPUT/RESULTS
FOR CIRCULAR CROSS-SECTIONS
*For actual data, see Sample Data Circular.xlsx
FOR TRIANGULAR CROSS-SECTIONS
*For actual data, see Sample Data Circular.xlsx
LIMITATIONS
The contour graphs produced by the program MS Excel show
discrepancies at the boundaries. The graphs make it seem like the
shear stress becomes lower at the boundaries. However, the
proponents believe that this is only because the program
interpolates the given data to create a continuous contour.
APPENDIX
FORMULASCircular Cross-SectionsTriangular Cross-Sections
Polar Moment of Inertia, J
Angle of Twist,