Why is the following numerical integration not working?
2 ビュー (過去 30 日間)
古いコメントを表示
clc;clear;close all
k = 2;theta = 0;
Integrand = Optics(k,theta);
area = @Optics;
TMD = integral2(Optics,0,2,0,2*pi);
function Integrand = Optics(k,theta)
gamma = 0.2;
pi = 3.14;
a = 0.3;
hbar = 0.2;
electron = 0.2;
w = 1;
correction = 0.001;
Normalization = 1/sqrt(2*gamma*(exp(1i*a*k*cos(theta))+2*exp(-0.5*1i*a*k*cos(theta))*cos(sqrt(3)/2*a*k*sin(theta)))*(exp(-1i*a*k*cos(theta))+2*exp(0.5*1i*a*k*cos(theta))*cos(sqrt(3)/2*a*k*sin(theta))));
SolutionOne = Normalization*[gamma*(exp(1i*a*k*cos(theta))+2*exp(-0.5*1i*a*k*cos(theta))*cos(sqrt(3)/2*a*k*sin(theta)));sqrt(gamma*(exp(1i*a*k*cos(theta))+2*exp(-0.5*1i*a*k*cos(theta))*cos(sqrt(3)/2*a*k*sin(theta)))*(exp(-1i*a*k*cos(theta))+2*exp(0.5*1i*a*k*cos(theta))*cos(sqrt(3)/2*a*k*sin(theta))))];
SolutionTwo = Normalization*[sqrt(gamma*(exp(1i*a*k*cos(theta))+2*exp(-0.5*1i*a*k*cos(theta))*cos(sqrt(3)/2*a*k*sin(theta)))*(exp(-1i*a*k*cos(theta))+2*exp(0.5*1i*a*k*cos(theta))*cos(sqrt(3)/2*a*k*sin(theta))));-gamma*(exp(1i*a*k*cos(theta))+2*exp(-0.5*1i*a*k*cos(theta))*cos(sqrt(3)/2*a*k*sin(theta)))];
velocity = [0 1i*a*gamma*(exp(1i*k*a*cos(theta))-exp(-1i*k*a*cos(theta))*cos(k*sin(theta)*a*sqrt(3)/2));-1i*a*gamma*(exp(-1i*k*a*cos(theta))-exp(1i*k*a*cos(theta))*cos(k*sin(theta)*a*sqrt(3)/2)) 0];
EigenOne = sqrt(gamma*(exp(1i*a*k*cos(theta))+2*exp(-0.5*1i*a*k*cos(theta))*cos(sqrt(3)/2*a*k*sin(theta)))*(exp(-1i*a*k*cos(theta))+2*exp(0.5*1i*a*k*cos(theta))*cos(sqrt(3)/2*a*k*sin(theta))));
EigenTwo = -EigenOne;
Jumper = SolutionOne'*velocity*SolutionTwo;
Integrand = k*1i*hbar*electron*electron/(2*pi)^2/(EigenOne-EigenTwo)*(Jumper')*Jumper/(hbar*w-(EigenOne-EigenTwo)+correction);
end
This is a 2D integral but Matlab always responds with 'Not enough inputs'
0 件のコメント
回答 (2 件)
Star Strider
2020 年 10 月 6 日
Try this:
TMD = integral2(@Optics,0,2,0,2*pi);
(I did not run your code, so there may be other errors as well.)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Optics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!