/*********************************************************************** * 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.000 deg * * eps. xx : 10.000 mm * * eps. yy : -5.000 mm * * gam. xy : 20.000 mm * * * * REDUCED STIFFNESS MATRIX (MAIN AXES): * * * * 41.0509 3.2841 0.0000 * * 3.2841 10.2627 0.0000 * * 0.0000 0.0000 4.5000 * * * * REDUCED STIFFNESS MATRIX (X, Y AXES): * * * * 28.3391 8.2989 9.5611 * * 8.2989 12.9450 3.7706 * * 9.5611 3.7706 9.5148 * * * * 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 * * * * -------------------------------------------------------------------- * * C++ Release By J-P Moreau, Paris. * * (www.jpmoreau.fr) * ***********************************************************************/ #include #include #define NMAX 3 typedef double MAT[NMAX+1][NMAX+1]; double EL,ET,NULT,GLT,TEMP,TH,EXX,EYY,GXY,PI; int I; MAT Q, Q1; double S[NMAX+1], S1[NMAX+1], E[NMAX+1]; void MATNUL(int N, MAT A) { int I,J; for (I=1; I<=N; I++) for (J=1; J<=N; J++) A[I][J]=0.0; } void MATMULT(int N, MAT A, double *B, double *C) { double SUM; int I,K; for (I=1; I<=N; I++) { SUM= 0.0; for (K=1; K<=N; K++) SUM += A[I][K]*B[K]; C[I]=SUM; } } void MATPRINT(char *title, int N, MAT A) { int I,J; printf("\n%s\n\n", title); for (I=1; I<=N; I++) { for (J=1; J<=N; J++) printf(" %10.4f", A[I][J]); printf("\n"); } } double dcos4(double t) { double a; a=cos(t); return (a*a*a*a); } double dsin4(double t) { double a; a=sin(t); return (a*a*a*a); } void main() { PI = 4.0*atan(1.0); // material constants (GPa) EL = 40.0; ET = 10.0; NULT = 0.32; GLT = 4.5; // initial data TH = 30.0; EXX = 0.01; EYY =-5e-03; GXY = 2e-02; printf("\n STRESSES IN A UNIDIRECTIONAL COMPOSITE LAYER\n\n"); printf(" Angle of fibers: %7.3f deg\n", TH); printf(" eps. xx : %7.3f mm\n", 1000*EXX); printf(" eps. yy : %7.3f mm\n", 1000*EYY); printf(" gam. xy : %7.3f mm\n", 1000*GXY); // reduced stiffness matrix in main axes (L,W) MATNUL(3,Q); Q[1][1] = EL/(1.0-((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; MATPRINT(" REDUCED STIFFNESS MATRIX (MAIN AXES):",3,Q); // reduced stiffness matrix in axes (x,y) MATNUL(3,Q1); TH = 30.0*PI/180.0; TEMP = sin(TH)*sin(TH)*cos(TH)*cos(TH); Q1[1][1]=Q[1][1]*dcos4(TH)+Q[2][2]*dsin4(TH)+2.0*(Q[1][2]+2.0*Q[3][3])*TEMP; Q1[1][2]=(Q[1][1]+Q[2][2]-4.0*Q[3][3])*TEMP+Q[1][2]*(dcos4(TH)+dsin4(TH)); 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.0*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.0*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(TH)+2.0*(Q[1][2]+2.0*Q[3][3])*TEMP+Q[2][2]*dcos4(TH); TEMP = sin(TH)*sin(TH)*sin(TH)*cos(TH); Q1[2][3]=(Q[1][1]-Q[1][2]-2.0*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.0*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.0*(Q[1][2]+Q[3][3]))*TEMP+Q[3][3]*(dsin4(TH)+dcos4(TH)); MATPRINT(" REDUCED STIFFNESS MATRIX (X, Y AXES):",3,Q1); // stresses in axes (x, y) E[1]=EXX; E[2]=EYY; E[3]=GXY; MATMULT(3,Q1,E,S); printf("\n Stresses in axes x, y:\n\n"); for (I=1; I<=NMAX; I++) printf(" %10.4f MPa\n", 1000*S[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.0*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); MATMULT(3,Q,S,S1); printf("\n Stresses in main axes:\n\n"); for (I=1; I<=NMAX; I++) printf(" %10.4f MPa\n", 1000*S1[I]); printf("\n");; } //end of file Compos01.cpp