chebfun function using mesh plot error
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I try to create a mesh plot using the chebfun function.Then using chebfun I use the roots of the polynomial to plot a mesh plot. I gt an error and do not know how to fix it:
clear;
z = linspace(-1+1.e-5,1-1.e-3,101);
d = 6;
Lambda= linspace(0.01,0.11,101);
DeltaE = linspace(0.01,0.11,101);
kappa = 1;
[Lm,DE] = meshgrid(Lambda, DeltaE );
% equations
t1 = sqrt(1+z);
t2 = sqrt(1-z);
q = sqrt(.5).*t1.*exp(-d.*sqrt(2.*Lambda).*t1);
cosfi = 1;
for k1 = 1:length(Lambda)
for k2 = 1:length(DeltaE)
myfun(k1,k2) = chebfun(@(z) (DeltaE(k2)+Lambda(k1)*z - .5*cosfi*sqrt(.5*(1-z))... .*(kappa-(1+z)./(1-z)).*exp(-d*sqrt(2*Lambda(k1)*(1+z))))/pi);
r(k1,k2) = roots(myfun(k1,k2));
if length(r) > 0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% jacobbian EigenValue:
t1 = sqrt(1+r);
t2 = sqrt(1-r);
q = sqrt(.5).*t1.*exp(-d.*sqrt(2.*Lambda).*t1);
J11 = 0;
J12 = -q.*((1 + kappa)/2).*sqrt(1-r.^2);
J21 = Lambda + (1/2).*q.*[(1./(2.*(1 + r)))-d.*sqrt(Lambda./(2.*r))].* [(1./((1+r).^2)).*(t1./t2).*kappa + (1./(1-r.^2)).*(t2./t1)];
J22 = 0;
% Eigenvalues
Eig1 = sqrt(J12.*J21);
Eig2 = -sqrt(J12.*J21);
EigReal = real(Eig1);
EigIm = imag(Eig1);
% plot
mesh(DeltaE,Lambda,EigReal);
end
end
end
axis auto;
I would highly appreciate if anyone tell me what the error means and how may i fix it.
Best, Armin
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Polynomials dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!