'************************************************************************ '* This program calculates the stresses in a unidirectional layer of a * '* composite material, knowing deformations exx, eyy, gxy, and angle * '* theta of fibers in x direction. We consider here that we have a * '* plane stress state. * '* * '* The stresses sxx, syy and sxy are calculated: * '* * '* 1. in plane (x,y), * '* 2. in the main axes (L,W) of the layer. * '* * '* -------------------------------------------------------------------- * '* SAMPLE RUN: * '* * '* STRESSES IN A UNIDIRECTIONAL COMPOSITE LAYER * '* * '* Angle of fibers: 30 deg * '* eps. xx : 10 mm * '* eps. yy : -5 mm * '* gam. xy : 20 mm * '* * '* REDUCED STIFFNESS MATRIX (MAIN AXES): * '* * '* 41.050903 3.284072 0.000000 * '* 3.284072 10.262726 0.000000 * '* 0.000000 0.000000 4.500000 * '* * '* REDUCED STIFFNESS MATRIX (X, Y AXES): * '* * '* 28.339080 8.298851 9.561120 * '* 8.298851 12.944992 3.770552 * '* 9.561120 3.770552 9.514778 * '* * '* Stresses in axes x, y: * '* * '* 433.1189 MPa * '* 93.6746 MPa * '* 267.0540 MPa * '* * '* Stresses in main axes: * '* * '* 579.5334 MPa * '* -52.7399 MPa * '* -13.4567 MPa * '* * '* END OF PROGRAM * '* -------------------------------------------------------------------- * '* Basic Release By J-P Moreau, Paris. * '* (www.jpmoreau.fr) * '************************************************************************ 'PROGRAM COMPOS01 DEFDBL A-H, O-Z DEFINT I-N DIM NULT AS DOUBLE NMAX = 3 DIM Q(NMAX, NMAX), Q1(NMAX, NMAX) DIM S(NMAX), S1(NMAX), E(NMAX) DIM Title AS STRING PI = 4# * ATN(1#) ' material constants (GPa) EL = 40# ET = 10# NULT = .32# GLT = 4.5# ' initial data TH = 30# EXX = .01# EYY = -.005# GXY = .02# CLS PRINT PRINT " STRESSES IN A UNIDIRECTIONAL COMPOSITE LAYER" PRINT PRINT " Angle of fibers: "; TH; " deg" PRINT " eps. xx : "; 1000 * EXX; " mm" PRINT " eps. yy : "; 1000 * EYY; " mm" PRINT " gam. xy : "; 1000 * GXY; " mm" ' reduced stiffness matrix in main axes (L,W) GOSUB 500 'CALL MATNUL(Q) Q(1, 1) = EL / (1# - ((ET / EL) * NULT * NULT)) Q(2, 2) = (ET / EL) * Q(1, 1) Q(1, 2) = NULT * Q(2, 2) Q(2, 1) = Q(1, 2) Q(3, 3) = GLT Title = "REDUCED STIFFNESS MATRIX (MAIN AXES):" GOSUB 600 'CALL MATPRINT("REDUCED STIFFNESS MATRIX (MAIN AXES):",Q) ' reduced stiffness matrix in axes (x,y) GOSUB 501 'CALL MATNUL(Q1) TH = TH * PI / 180# GOSUB 700: GOSUB 701 'calculate dcos4 and dsin4 TEMP = SIN(TH) * SIN(TH) * COS(TH) * COS(TH) Q1(1, 1) = Q(1, 1) * dcos4 + Q(2, 2) * dsin4 + 2# * (Q(1, 2) + 2# * Q(3, 3)) * TEMP Q1(1, 2) = (Q(1, 1) + Q(2, 2) - 4# * Q(3, 3)) * TEMP + Q(1, 2) * (dcos4 + dsin4) Q1(2, 1) = Q1(1, 2) TEMP = SIN(TH) * COS(TH) * COS(TH) * COS(TH) Q1(1, 3) = (Q(1, 1) - Q(1, 2) - 2# * Q(3, 3)) * TEMP TEMP = SIN(TH) * SIN(TH) * SIN(TH) * COS(TH) Q1(1, 3) = Q1(1, 3) + (Q(1, 2) - Q(2, 2) + 2# * Q(3, 3)) * TEMP Q1(3, 1) = Q1(1, 3) TEMP = SIN(TH) * SIN(TH) * COS(TH) * COS(TH) Q1(2, 2) = Q(1, 1) * dsin4 + 2# * (Q(1, 2) + 2# * Q(3, 3)) * TEMP + Q(2, 2) * dcos4 TEMP = SIN(TH) * SIN(TH) * SIN(TH) * COS(TH) Q1(2, 3) = (Q(1, 1) - Q(1, 2) - 2# * Q(3, 3)) * TEMP TEMP = COS(TH) * COS(TH) * COS(TH) * SIN(TH) Q1(2, 3) = Q1(2, 3) + (Q(1, 2) - Q(2, 2) + 2# * Q(3, 3)) * TEMP Q1(3, 2) = Q1(2, 3) TEMP = SIN(TH) * SIN(TH) * COS(TH) * COS(TH) Q1(3, 3) = (Q(1, 1) + Q(2, 2) - 2# * (Q(1, 2) + Q(3, 3))) * TEMP + Q(3, 3) * (dsin4 + dcos4) Title = "REDUCED STIFFNESS MATRIX (X, Y AXES):" GOSUB 601 'CALL MATPRINT("REDUCED STIFFNESS MATRIX (X, Y AXES):",Q1) S\$ = " ####.#### MPa" ' stresses in axes (x, y): E(1) = EXX E(2) = EYY E(3) = GXY GOSUB 550 'CALL MATMULT(Q1,E,S) PRINT PRINT " Stresses in axes x, y:" PRINT FOR I = 1 TO NMAX PRINT USING S\$; 1000 * S(I) NEXT I ' stresses in main axes: TEMP = SIN(TH) * COS(TH) Q(1, 1) = COS(TH) * COS(TH) Q(1, 2) = SIN(TH) * SIN(TH) Q(1, 3) = 2# * TEMP Q(2, 1) = Q(1, 2) Q(2, 2) = Q(1, 1) Q(2, 3) = -Q(1, 3) Q(3, 1) = -TEMP Q(3, 2) = TEMP Q(3, 3) = COS(TH) * COS(TH) - SIN(TH) * SIN(TH) GOSUB 551 'CALL MATMULT(Q,S,S1) PRINT PRINT " Stresses in main axes:" PRINT FOR I = 1 TO NMAX PRINT USING S\$; 1000 * S1(I) NEXT I PRINT PRINT " END OF PROGRAM" END 'of main program 500 'SUBROUTINE MATNUL(Q) FOR I = 1 TO NMAX FOR J = 1 TO NMAX Q(I, J) = 0# NEXT J NEXT I RETURN 501 'SUBROUTINE MATNUL(Q1) FOR I = 1 TO NMAX FOR J = 1 TO NMAX Q1(I, J) = 0# NEXT J NEXT I RETURN 550 'SUBROUTINE MATMULT(Q1, E, S) FOR I = 1 TO NMAX SUM = 0# FOR K = 1 TO NMAX SUM = SUM + Q1(I, K) * E(K) NEXT K S(I) = SUM NEXT I RETURN 551 'SUBROUTINE MATMULT(Q, S, S1) FOR I = 1 TO NMAX SUM = 0# FOR K = 1 TO NMAX SUM = SUM + Q(I, K) * S(K) NEXT K S1(I) = SUM NEXT I RETURN 600 'SUBROUTINE MATPRINT(Title,Q) F\$ = " ####.######" PRINT PRINT " "; Title PRINT FOR I = 1 TO NMAX FOR J = 1 TO NMAX PRINT USING F\$; Q(I, J); NEXT J PRINT NEXT I RETURN 601 'SUBROUTINE MATPRINT(Title,Q1) PRINT PRINT " "; Title PRINT FOR I = 1 TO NMAX FOR J = 1 TO NMAX PRINT USING F\$; Q1(I, J); NEXT J PRINT NEXT I RETURN 700 'FUNCTION dcos4(TH) a = COS(TH) dcos4 = a * a * a * a RETURN 701 'FUNCTION dsin4(TH) a = SIN(TH) dsin4 = a * a * a * a RETURN 'end of file Compos01.bas