Composite Plate Bending Analysis With Matlab Code Page
We assemble a sparse linear system ( [K] {w} = {f} ) and solve. Below is the complete code. It computes deflections, curvatures, and then stresses in each ply at Gauss points.
strain_global_bot = [kxx; kyy; 2*kxy] * z_bot; stress_global_bot = Q_bar * strain_global_bot; stress_local_bot = T \ stress_global_bot;
% Central difference coefficients c1 = D(1,1)/dx^4; c2 = (2*(D(1,2)+2 D(3,3)))/(dx^2 dy^2); c3 = D(2,2)/dy^4; Composite Plate Bending Analysis With Matlab Code
dx2 = dx^2; dy2 = dy^2; kxx = (w(i_center-1,j_center) - 2 w(i_center,j_center) + w(i_center+1,j_center)) / dx2; kyy = (w(i_center,j_center-1) - 2 w(i_center,j_center) + w(i_center,j_center+1)) / dy2; kxy = (w(i_center-1,j_center-1) - w(i_center-1,j_center+1) - w(i_center+1,j_center-1) + w(i_center+1,j_center+1)) / (4 dx dy);
%% Compute ABD Matrix A = zeros(3,3); B = zeros(3,3); D = zeros(3,3); for k = 1:num_plies theta_k = theta(k) * pi/180; m = cos(theta_k); n = sin(theta_k); % Transformation matrix T = [m^2, n^2, 2 m n; n^2, m^2, -2 m n; -m n, m n, m^2-n^2]; % Q_bar = T * Q * T_inv Q = [Q11, Q12, 0; Q12, Q22, 0; 0, 0, Q66]; Q_bar = T * Q * T'; % Integrate through thickness A = A + Q_bar * (z(k+1)-z(k)); B = B + Q_bar * 0.5 * (z(k+1)^2 - z(k)^2); D = D + Q_bar * (1/3) * (z(k+1)^3 - z(k)^3); end % For symmetric laminate, B should be zero (numerically small) B = zeros(3,3); % enforce symmetry We assemble a sparse linear system ( [K]
%% Plot Deflection figure; surf(x, y, w'); xlabel('x (m)'); ylabel('y (m)'); zlabel('Deflection (m)'); title('Composite Plate Bending Deflection (CLPT)'); colorbar; axis tight; view(45,30);
% Interior points for i = 3:Nx-2 for j = 3:Ny-2 n = idx(i,j); % w_xxxx K(n, idx(i-2,j)) = K(n, idx(i-2,j)) + c1; K(n, idx(i-1,j)) = K(n, idx(i-1,j)) - 4 c1; K(n, idx(i,j)) = K(n, idx(i,j)) + 6 c1; K(n, idx(i+1,j)) = K(n, idx(i+1,j)) - 4 c1; K(n, idx(i+2,j)) = K(n, idx(i+2,j)) + c1; % w_yyyy K(n, idx(i,j-2)) = K(n, idx(i,j-2)) + c3; K(n, idx(i,j-1)) = K(n, idx(i,j-1)) - 4 c3; K(n, idx(i,j)) = K(n, idx(i,j)) + 6 c3; K(n, idx(i,j+1)) = K(n, idx(i,j+1)) - 4 c3; K(n, idx(i,j+2)) = K(n, idx(i,j+2)) + c3; % w_xxyy K(n, idx(i-1,j-1)) = K(n, idx(i-1,j-1)) + c2; K(n, idx(i-1,j)) = K(n, idx(i-1,j)) - 2 c2; K(n, idx(i-1,j+1)) = K(n, idx(i-1,j+1)) + c2; K(n, idx(i,j-1)) = K(n, idx(i,j-1)) - 2 c2; K(n, idx(i,j)) = K(n, idx(i,j)) + 4 c2; K(n, idx(i,j+1)) = K(n, idx(i,j+1)) - 2 c2; K(n, idx(i+1,j-1)) = K(n, idx(i+1,j-1)) + c2; K(n, idx(i+1,j)) = K(n, idx(i+1,j)) - 2*c2; K(n, idx(i+1,j+1)) = K(n, idx(i+1,j+1)) + c2; strain_global_bot = [kxx
[ \begin{Bmatrix} \mathbf{N} \ \mathbf{M} \end{Bmatrix} = \begin{bmatrix} \mathbf{A} & \mathbf{B} \ \mathbf{B} & \mathbf{D} \end{bmatrix} \begin{Bmatrix} \boldsymbol{\epsilon}^0 \ \boldsymbol{\kappa} \end{Bmatrix} ]