Equation is convergent but unable to extract the output

조회 수: 1 (최근 30일)
Sun Heat
Sun Heat 2022년 5월 20일
편집: Torsten 2022년 5월 20일
hello friends,
i run the below code and found that the equation is 'convergent', but i am unable to extract the output.
clc;close all;clear all;
syms m
k=360; h=0.562; theta=35;
alpha_m=((-1)*360*sqrt(1-((m^2)*(sind(theta)^2))));
term=(k*(1-(exp(-2*alpha_m*h)))/alpha_m);
y = vpa(symsum(term, m, 2, Inf));
if isinf(y)
fprintf('divergent\n');
else
fprintf('convergent\n');
end
I used
syms m
k=360; h=0.562; theta=35;
alpha_m=((-1)*360*sqrt(1-((m^2)*(sind(theta)^2))));
term=(k*(1-(exp(-2*alpha_m*h)))/alpha_m);
y = symsum(term, m, 2, Inf);
AA=double(y) % but it didn't work
Please help me. Thanks in advance.

채택된 답변

Torsten
Torsten 2022년 5월 20일
편집: Torsten 2022년 5월 20일
The real part of y seems to converge, the imaginary part doesn't.
k=360; h=0.562; theta=35;
alpha_m = @(m)((-1)*360*sqrt(1-((m.^2)*(sind(theta)^2))));
term = @(m)(k*(1-(exp(-2*alpha_m(m)*h)))./alpha_m(m));
m = 2:10000;
y = cumsum(term(m))
plot(m,[real(y);imag(y)])

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by