Transcendental equation solution solution, graph plot.

조회 수: 15 (최근 30일)
Kumar Vishal
Kumar Vishal 2017년 8월 18일
답변: Arun Mathamkode 2017년 8월 22일

Hello All,

I am trying to solve transcendental equation and plot graph for left and right part of this equation (g.c(1+r)=n+(1/pi)*atan(-(A/B))). It suppose to look like the attached images constants are also mention there.

 n>2
 n=(3:1:8) and
 c>0
 c=(1:0.2:2).

Where A and B are

A=cos(g.*c.*pi.*r).*cos(g.*sqrt((c.^2)-1).*pi.*r)+sqrt(1-(1./(c.^2))).*sin(g.*c.*pi.*r).*sin(g.*sqrt(c.^2-1).*pi.*r);
B=sin(g.*c.*pi.*r).*cos(g.*sqrt((c.^2)-1).*pi.*r)-sqrt(1-(1./(c.^2))).*cos(g.*c.*pi.*r).*sin(g.*sqrt(c.^2-1).*pi.*r);

I tried this on Matlab:

close all
clc;
g = sqrt(8);
r = 0.20;
n = 3:1:8; 
c = 1:0.2:2;
A_S=cos(g.*c.*pi.*r).*cos(g.*sqrt((c.^2)-1).*pi.*r)+sqrt(1-(1./(c.^2))).*sin(g.*c.*pi.*r).*sin(g.*sqrt(c.^2-1).*pi.*r);
B_S=sin(g.*c.*pi.*r).*cos(g.*sqrt((c.^2)-1).*pi.*r)-sqrt(1-(1./(c.^2))).*cos(g.*c.*pi.*r).*sin(g.*sqrt(c.^2-1).*pi.*r);
A_A=cos(g.*c.*pi.*r).*sin(g.*sqrt((c.^2)-1).*pi.*r)-sqrt(1-(1./(c.^2))).*sin(g.*c.*pi.*r).*cos(g.*sqrt(c.^2-1).*pi.*r);
B_A=sin(g.*c.*pi.*r).*sin(g.*sqrt((c.^2)-1).*pi.*r)+sqrt(1-(1./(c.^2))).*cos(g.*c.*pi.*r).*cos(g.*sqrt(c.^2-1).*pi.*r);
F=g*c*(1+r);
T_S=atan(-(A_S./B_S));
w_S=(n+(1/pi)).*T_S;
T_A=atan(-(A_A./B_A));
w_A=(n+(1/pi)).*T_A;
figure;
plot(c,F,'b')
hold on;
plot(c, w_S ,'r')
plot(c, w_A, 'g') 
grid on
hold off;

Thank you!

답변 (1개)

Arun Mathamkode
Arun Mathamkode 2017년 8월 22일
If your implementation of the equations are right, then this might work
close all
clc;
g = sqrt(8);
r = 0.20;
%n = 3:1:8;
c = 1:0.2:2;
A_S=cos(g.*c.*pi.*r).*cos(g.*sqrt((c.^2)-1).*pi.*r)+sqrt(1-(1./(c.^2))).*sin(g.*c.*pi.*r).*sin(g.*sqrt(c.^2-1).*pi.*r);
B_S=sin(g.*c.*pi.*r).*cos(g.*sqrt((c.^2)-1).*pi.*r)-sqrt(1-(1./(c.^2))).*cos(g.*c.*pi.*r).*sin(g.*sqrt(c.^2-1).*pi.*r);
A_A=cos(g.*c.*pi.*r).*sin(g.*sqrt((c.^2)-1).*pi.*r)-sqrt(1-(1./(c.^2))).*sin(g.*c.*pi.*r).*cos(g.*sqrt(c.^2-1).*pi.*r);
B_A=sin(g.*c.*pi.*r).*sin(g.*sqrt((c.^2)-1).*pi.*r)+sqrt(1-(1./(c.^2))).*cos(g.*c.*pi.*r).*cos(g.*sqrt(c.^2-1).*pi.*r);
F=g*c*(1+r);
plot(c,F,'b')
for n=3:8
T_S=atan(-(A_S./B_S));
w_S=(n+(1/pi)).*T_S;
T_A=atan(-(A_A./B_A));
w_A=(n+(1/pi)).*T_A;
hold on;
plot(c, w_S ,'r')
plot(c, w_A, 'g')
end
grid on
hold off;
end

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by