Effacer les filtres
Effacer les filtres

integral of equation with known boundary

1 vue (au cours des 30 derniers jours)
sookyung Kang
sookyung Kang le 23 Juin 2020
Commenté : sookyung Kang le 23 Juin 2020
Ep = 1.27;
SDB = 0.19 ;
Delta = 0.44 ;
U = 0.2 ;
T = 300 ;
Teq = 500 ;
Nh = 5*10^21 ;
Nsisi = 2*10^23 ;
k = 8.61733*10^(-5);
q = 1.602*10^-19;
Ef = 0.35 ;
Evp = 0 ;
Eu = 0.085 ;
x = linspace(0, 1.7);
Gamma = Nv.*(Nh/Nsisi).^((k.*Teq)/(4*Eu)).*((2*Eu.^2)./((2*Eu)-(k.*Teq))).*exp(-(1/(2*Eu)).*(Ep-Evp-((SDB.^2)./(4*Eu))));
Pegd = (1./sqrt(2*SDB.^2*pi)).*exp((-((x+k.*Teq*log(2)-Ep)+((SDB.^2)./(2*Eu))).^2)./(2*SDB.^2));
Fe_eq = 1./(1+exp(x-Ef)/(k.*Teq));
Fegd = 1./(1+exp((x+k.*Teq*log(2))-Ef)/(k.*Teq));
De_eq = Gamma.*((2./Fe_eq).^((k.*Teq)./(2*Eu))).*Pe ;
Degd = Gamma.*((2./Fegd).^((k.*Teq)./(2*Eu))).*Pegd;
Pega = (1./sqrt(2*SDB.^2*pi)).*exp((-((x-U-k.*Teq*log(2))+((SDB.^2)./(2*Eu))-Ep).^2)./(2*SDB.^2));
Fe_eq = 1./(1+exp(x-Ef)/(k.*Teq));
Fega = 1./(1+exp((x-U-k.*Teq*log(2))-Ef)/(k.*Teq));
Dega = Gamma.*((2./Fega).^((k.*Teq)./(2*Eu1))).*Pega;
y = @(x)((Degd.*(1-Fegd))+(Dega.Fegd));
F = int(y, 0, 1.7); plot(F,x, [0 1.7]);xlabel('x'), ylabel ('y');
I'd like to know why there is a mistake to obtain intergal graph by this code.
I've received the message "Check for missing argument or incorrect argument data type in call to function 'int'. "
Thanks for the advance.
  2 commentaires
Alan Stevens
Alan Stevens le 23 Juin 2020
Try "integrate" instead of "int".
sookyung Kang
sookyung Kang le 23 Juin 2020
I tried and still it is not fixed.

Connectez-vous pour commenter.

Réponse acceptée

Alan Stevens
Alan Stevens le 23 Juin 2020
Sorry, i meant "integral". However, there were some other problems, but the code below works:
Ep = 1.27;
SDB = 0.19 ;
Delta = 0.44 ;
U = 0.2 ;
T = 300 ;
Teq = 500 ;
Nh = 5*10^21 ;
Nsisi = 2*10^23 ;
k = 8.61733*10^(-5);
q = 1.602*10^-19;
Ef = 0.35 ;
Evp = 0 ;
Eu = 0.085 ;
Nv = 1; Pe = 1; Eu1 = 1; %%%%%%%%%%%%% You need to enter the correct values here.
x = linspace(0, 1.7);
Gamma = Nv.*(Nh/Nsisi).^((k.*Teq)/(4*Eu)).*((2*Eu.^2)./((2*Eu)-(k.*Teq))).*exp(-(1/(2*Eu)).*(Ep-Evp-((SDB.^2)./(4*Eu))));
Pegd = (1./sqrt(2*SDB.^2*pi)).*exp((-((x+k.*Teq*log(2)-Ep)+((SDB.^2)./(2*Eu))).^2)./(2*SDB.^2));
Fe_eq = 1./(1+exp(x-Ef)./(k.*Teq));
Fegd = 1./(1+exp((x+k.*Teq*log(2))-Ef)./(k.*Teq));
De_eq = Gamma.*((2./Fe_eq).^((k.*Teq)./(2*Eu))).*Pe ;
Degd = Gamma.*((2./Fegd).^((k.*Teq)./(2*Eu))).*Pegd;
Pega = (1./sqrt(2*SDB.^2*pi)).*exp((-((x-U-k.*Teq*log(2))+((SDB.^2)./(2*Eu))-Ep).^2)./(2*SDB.^2));
Fe_eq = 1./(1+exp(x-Ef)./(k.*Teq));
Fega = 1./(1+exp((x-U-k.*Teq*log(2))-Ef)./(k.*Teq));
Dega = Gamma.*((2./Fega).^((k.*Teq)./(2*Eu1))).*Pega;
y = @(x)((Degd.*(1-Fegd))+(Dega.*Fegd));
F = integral(y, 0, 1.7,'ArrayValued',true);
plot(x,F);xlabel('x'), ylabel ('y');
  1 commentaire
sookyung Kang
sookyung Kang le 23 Juin 2020
It works! Thanks a lot :)

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Operating on Diagonal Matrices 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!

Translated by