Plot implicit function with the summation inside
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Peng Li
le 28 Mar 2020
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 commentaires
Voir également
Catégories
En savoir plus sur Annotations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!