Plot implicit function with the summation inside
12 ビュー (過去 30 日間)
古いコメントを表示
Hello.
I'm trying to plot an implicit trancendental function with the summation inside the expression. Here my code:
function z=mu_ring
t=0.25;
G=0.0;
n=1:10000;
z1=@(w_c,mu) 1+w_c/pi*sum((-1).^n/n.*2*pi^2*n.*t./w_c*1./sinh(2*pi^2*n*t./w_c).*sin(2*pi*n*mu./w_c).*cos(pi*n).*exp(-2*pi*n.*G./w_c))-mu;
fimplicit(z1,[0.01 10 0 10],'MeshDensity',100,'LineWidth',3,'Color','red')
set(gca,'FontName','Times New Roman','FontSize',34)
xlabel('w_c','FontName','Times New Roman','fontsize',34,'fontweight','b');
ylabel('\mu','FontName','Times New Roman','fontsize',34,'fontweight','b');
grid on
end
After the execution I got a horizontal line with mu=1 instead something like that

Thank you in advance.
0 件のコメント
回答 (1 件)
Peng Li
2020 年 3 月 28 日
z1 = @(w_c, mu) 1 + w_c / pi ...
* sum((-1).^n / n .* 2 * pi^2 * n .* t ... % are you sure that the first / and the second to last * here correct or they should be ./ and .*?
./ w_c ...
* 1 ./ sinh(2 * pi^2 * n * t ./ w_c) ...
.* sin(2*pi*n*mu ./ w_c) ...
.* cos(pi*n) ...
.* exp(-2*pi*n.*G ./ w_c)) ...
- mu;
might be easier to read if you improve your style a bit.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Axis Labels についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!