I want to plot my eigenvector against r and theta, but I don't know how?

조회 수: 8 (최근 30일)
Friso de Swart
Friso de Swart 2021년 9월 9일
답변: Ashutosh Singh Baghel 2021년 9월 21일
syms S r a theta
sigma_rr = (S/2)*(1-(a/r)^2)+(S/2)*(1-4*((a/r)^2)+3*(a/r)^4)*cos(2*theta)
sigma_00 = (S/2)*(1+(a/2)^2)-(S/2)*(1+3*(a/3)^4)*cos(2*theta)
sigma_0r = -(S/2)*(1+(2*(a/r)^2)-3*(a/r)^4)*sin(2*theta)
A= [sigma_rr, sigma_0r ; sigma_0r, sigma_00]
B= [cos(theta), sin(theta) ; -sin(theta), cos(theta)]
C=transpose(B)
D = C*B*A
e= eig(D)
[V,E]= eig(D)
plotmatrix(A)

답변 (1개)

Ashutosh Singh Baghel
Ashutosh Singh Baghel 2021년 9월 21일
Hi Friso,
I understand that you wish to plot the symbolic equations related to 'e'(eigenvector) against 'r' and 'theta'.
Please refer to the following workaround.
S = 5; %Define S;
a = 5; %Define a;
syms r theta
sigma_rr = (S/2)*(1-(a/r)^2)+(S/2)*(1-4*((a/r)^2)+3*(a/r)^4)*cos(2*theta);
sigma_00 = (S/2)*(1+(a/2)^2)-(S/2)*(1+3*(a/3)^4)*cos(2*theta);
sigma_0r = -(S/2)*(1+(2*(a/r)^2)-3*(a/r)^4)*sin(2*theta);
A = [sigma_rr, sigma_0r ; sigma_0r, sigma_00];
B = [cos(theta), sin(theta) ; -sin(theta), cos(theta)];
C = transpose(B);
D = C*B*A;
e = eig(D);
[V,E] = eig(D);
count = 0;
for i = [1 2]
subplot(2,1,i);
ezplot(e(i,1),[-10,10],[-2*pi,2*pi]);
end
Please feel free to refer to the documentation to the 'ezplot' function in MATLAB Documentation.

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by