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