Range of matrices?
Show older comments
I am having trouble with getting a range of Qbar matrix values for my different orientation angles below. I input the number of plies (n) and the orientation for each ply (theta). Now, I am trying to calculate a Qbar matrix for each ply based on its orientation but I keep getting an error. So i defined k=1:n and that u=theta(k)*pi/180 to convert it to radians. I do not know if I am even applying the orientation angle right for each ply. Does anyone know what I am doing wrong?
Thank you.
% Number of plies and orientation of each ply
prompt2 = {'Number of plies'};
dlgtitle2 = 'Number of plies definition';
dims2 = [1 100];
definput2 = {'4'}; % Default input
answer2 = inputdlg(prompt2,dlgtitle2,dims2,definput2);
n = str2num(answer2{1});
theta = zeros(1,n);
for i = 1:length(theta)
prompt3 = {sprintf('Enter orientation angle (in degrees) for ply #%d',i)};
dlgtitle3 = 'Laminate stacking sequence definition';
dims3 = [1 100];
definput3 = {'0'}; % Default input
answer3 = inputdlg(prompt3,dlgtitle3,dims3,definput3);
theta(i) = str2num(answer3{1});
end
%
% define an array h that stores the location of ply interfaces here ...
% the array should be the length of the theta array plus one (i.e., there
% are n+1 interfaces for a n ply laminate)
% be careful to take account of the cases of even and odd number of plies
% when there are an odd number of plies, interfaces are located at 1.5t, 2.5t, etc.
%%
% Compute Qbar for each ply
for k=1:n
u = theta(k)*pi/180;
c = cos(u);
s = sin(u);
Tsigma(k)= [c^2 s^2 2*c*s;...
s^2 c^2 -2*c*s;...
-c*s c*s c^2-s^2];
Tepsilon(k)= [c^2 s^2 c*s;...
s^2 c^2 -c*s;...
-2*c*s 2*c*s c^2-s^2]
Teps = inv(Tepsilon)
Sbar(k) = Teps*S*Tsigma
Qbar(k) = inv(Sbar);
end
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!