// Pb 7-17 LPF 
clear; // all variables
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 = [0,45,-45,45,0]; // deg
thickness   = [1, 1, 2, 1, 1]*2.5; // mm
N = length(thickness);  // # of laminas
// DEGRADED E-glass/polyester
d = 0.99;   // damage factor for ply discount
E1 = 204.6E3;   // MPa
E2 = 20.46E3*(1-d); // degraded
v12 = 0.3*(1-d);    // degraded
v23 = 0.5;          // assumed
G12 = 6.89E3*(1-d); // degraded
F1t = 826.8;        // MPa
F1c = 482.3;
F2t = 68.9; 
F2c = F2t;
F6 = 241.15;
// From Pb. 7.8
Q = buildQ(E1,E2,G12,v12);    
[A,B,D] = buildABD(Q,thickness,orientation);
N = [1000,1000,0]'; // ' makes it a column array
eps0 = A\N
k=1; // lamina number k
sig(:,k) = Q*eps0;        // From Pb. 7.12
T=transf(45); k=2;
eps = Reuter*T*Reuter^-1*eps0,  // 7.11
sig(:,k) = Q*eps;        // 7.12
T=transf(-45); k=3;
eps = Reuter*T*Reuter^-1*eps0;  // 7.11
sig(:,k) = Q*eps,        // 7.12, ending "," displays result on console
FT = [F1t, F2t, F6]';
FC = [F1c, F2c, F6]';
Rk(1) = maxStress(FT,FC,sig(:,1));
Rk(2) = maxStress(FT,FC,sig(:,2));
Rk(3) = maxStress(FT,FC,sig(:,3)),
Rlaminate = min(Rk)

table = sig' 
table(:,4) = Rk
if 0~=2 then 
    prettyprint(table) 
end
