Help with a Matrix for different angles
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Greetings,
I am running the following code and I want to find out the value of sigma1, sigma2, and tau6 at each angle starting from 0. I was thinking of doing a for-lopp, but the problem is that I am not able to do negative thetas or 0.
I think the problem is that MatLAb is taking ALL the angles and creating one big solution based on all angles? i might be wrong here, but any help to achieve my goal would be greatly appreciated
theta=0:5:90;
m=cosd(theta);
n=sind(theta);
sigma1=sym('sigma_1');
sigma2=sym('sigma_2');
tau6=sym('tau_6');
stress=[sigma1; sigma2; tau6];
sigmax=0;
sigmay=0;
tau5=sym('taus');
stress_rotation=[sigmax; sigmay; tau5];
T=[m.^2 n.^2 2.*m.*n;
n.^2 m.^2 -2.*m.*n;
-m.*n m.*n m.^2-n.^2];
equation=stress==T.*stress_rotation;
solution=solve(equation, stress);
sigma1_f=vpa(solution.sigma_1);
sigma2_f=vpa(solution.sigma_2);
tau6_f=vpa(solution.tau_6);
9 Kommentare
Walter Roberson
am 31 Mär. 2021
stress=[sigma1; sigma2; tau6];
That is a vector of length 3
equation=stress(i)==T.*stress_rotation(i);
but you index it at i where i can be up to length(theta)
Also your stress_rotation vector is length 3 as well.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!