// Pb 7-3 max. strain
mode(0); // prints each line like MATLAB unless suppressed by ;
funcprot(0); // to avoid warnings
exec('C:/Users/EJB/OneDrive/Scilab/CLT.sci',0);
orientation = [45,-45]; // deg
thickness   = [1, 1]*0.127; // mm
N = length(thickness);  // # of laminas
// properties E-glass/polyester
E1 = 137.8E3;   // MPa
E2 = 10.E3;     // MPa
v12 = 0.3;
v23 = 0.5;      // not given
G12 = 5.236E3;    // MPa
F1t = 826.8;    // MPa
F1c = 482.3;
F2t = 68.9;
F2c = F2t;
F6 = 241.15;
// S-7.1.2 arrays to simplify failure criterion
FT = [F1t/E1, F2t/E2, F6/G12]'//strains to failure
FC = [F1c/E1, F2c/E2, F6/G12]'//strains to failure
// loads
NM = [1E-0,1E-0,0,0,0,0]';//(N/mm} ' makes it a column array
// calculate
Q = buildQ(E1,E2,G12,v12);
[A,B,D] = buildABD(Q,thickness,orientation);
ABD = [[A,B];[B',D]]
eps0kappa = ABD\NM;
eps0 = eps0kappa(1:3);  // dimensionless
kappa = eps0kappa(4:6); // 1/mm
// bottom
z = -0.127;  // mm
// lamina c.s.
eps_ = eps0 - z * kappa;  // dimensionless
eps = rotateEps_(eps_,orientation(1));
disp("For Pb. 7-2: eps ="); disp(eps*1E6)
// sigma = Q(:,:,1) * eps;
// max. strain
Ri = Macaulay(eps./FT) + Macaulay(-eps./FC);
1/Ri(1),1/Ri(2) // just to display the individual values
R = 1 ./max(Macaulay(eps./FT) + Macaulay(-eps./FC)) // minimum

