While executing this program i am getting Error using symengine Operands are invalid. Error in sym/privBinaryOp (line 973) Csym = mupadmex(op,args{1}.s, args{2}.s, varargin{:}); Error in / (line 353) X = privBinaryOp(A, B, 'sy

1 次查看(过去 30 天)
syms E
ec=1.6*10^(-19);
del= 1.3*10^(-3)*ec;
k= 1.3807*10^(-23);
T=1.5;
V= linspace(0,5);
i=int((abs(E))/(sqrt(E.^2-del.^2))*(1/(1+exp((E-ec.*V)/(k.*T))-1/(1+exp(E./(k.*T))))), E, -inf, -1*del)
+ int((abs(E))/(sqrt(E.^2-del.^2))*(1/(1+exp((E-ec.*V)/(k.*T))-1/(1+exp(E./(k.*T))))), E, del, inf);
plot(V,i);

回答(2 个)

Ameer Hamza
Ameer Hamza 2018-4-28
You are getting this error because you are dividing 1 by 1x100 sym array, by using / symbol. You need to use ./ notation for the element-wise division. Inside the int change
(1/(1+exp((E-ec.*V)/(k.*T))-1/(1+exp(E./(k.*T)))))
to
(1./(1+exp((E-ec.*V)/(k.*T))-1/(1+exp(E./(k.*T)))))

Walter Roberson
Walter Roberson 2018-4-28
You are creating a vector of values. You need to use ./ instead of /
However, the left side of the addition, the integral from negative infinity, gives an infinite result for all V, and the right side of the addition, the integral to +infinity, gives 0 for all V.

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by