t0 = Id/(G0*(Vg-Vt-Id*Rs))t1 = Id/(G0*(Vg-Vt-Vd+Id*Rd))r = integral(@(t)1./(t.^2.*log(1-t)),t0,t1);Id=A/rwhere,G0 = 0.132;Vg = 0;Vt = -.485;Rs = 0.023;Rd = 0.022;Id = .003
MATLAB: I want to solve definite integral with variable limits . can i apply trapezoidal rule for the same
variable limits
Related Solutions
q = 1.6*10^-19;epsi = 12.47*10^-12*8.85;Dd = 5*10^-9;Di = 5*10^-9;a = 0.125*10^-20*1.6*10^-19;z = 100*10^-6;Vs = 2.63*10^5;G0 = (q^2*epsi*z*Vs)/(q^2*(Dd+Di)+epsi*a);Vg = 0;Vt = -0.485;Rs = 12;Rd = 12;Id = 0.002;Vd = 0;t0 = Id/(G0*(Vg-Vt-Id*Rs));t1 = Id/(G0*(Vg-Vt-Vd+Id*Rd));mu = 0.93;L = 100*10^-9;A = -(Vs*L*G0)/mu;r = integral(@(t)1./(t.^2.*log(1-t)),t0,t1)
To Everyone who might be interested in the answer. Here is the code I'm using. I've commented some things out so I could plot them all together. I used a curve fitting app but generated the code for it.
clc;%Long Channel
Vd = xlsread('W1umL3um.xlsx', 'C4:C43');Id0 = xlsread('W1umL3um.xlsx', 'D56:D95');Id2 = xlsread('W1umL3um.xlsx', 'F56:F95');Id4 = xlsread('W1umL3um.xlsx', 'H56:H95');Id6 = xlsread('W1umL3um.xlsx', 'J56:J95');Id8 = xlsread('W1umL3um.xlsx', 'L56:L95');Id10 = xlsread('W1umL3um.xlsx', 'N56:N95');Id12 = xlsread('W1umL3um.xlsx', 'P56:P95');% Fit: 'Vg = 0V'.
[xData, yData] = prepareCurveData( Vd, Id0 );% Set up fittype and options.
ft = fittype( '(a1.*0.00575.*((0-b1).*Vd - (Vd.^2/2)))*1000', 'independent', 'Vd', 'dependent', 'Id' );opts = fitoptions( 'Method', 'NonlinearLeastSquares' );opts.Display = 'Off'opts.StartPoint = [0.196595250431208 0.251083857976031];% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft, opts )% Plot fit with data.
figure( 'Name', 'Vg = 0V' );h1 = plot( fitresult, xData, yData, 'ok')h1(1).LineWidth = 1;h1(2).LineWidth = 2;%legend( h1, 'Id0 vs. Vd', 'Vg = 0V', 'Location', 'NorthEast' );
% Label axes
%xlabel Vd
%ylabel Id0
%grid on
hold on%Fit: 'Vg = 0.2V'.
[xData, yData] = prepareCurveData( Vd, Id2 );% Set up fittype and options.ft = fittype( '(a2.*0.00575.*((0.2-b2).*Vd - (Vd.^2/2)))*1000', 'independent', 'Vd', 'dependent', 'Id' );opts = fitoptions( 'Method', 'NonlinearLeastSquares' );opts.Display = 'Off';opts.StartPoint = [0.162182308193243 0.794284540683907];% Fit model to data.[fitresult, gof] = fit( xData, yData, ft, opts )% Plot fit with data.%figure( 'Name', 'Vg = 10.2V' );
h2 = plot( fitresult, xData, yData, 'ok')h2(1).LineWidth = 1;h2(2).LineWidth = 2;%legend( h2, 'Id2 vs. Vd', 'Vg = 10.2V', 'Location', 'NorthEast' );
% Label axes%xlabel Vd%ylabel Id2
grid on% Fit: 'Vg = 0.4V'.
[xData, yData] = prepareCurveData( Vd, Id4 );% Set up fittype and options.ft = fittype( '(a3.*0.00575.*((0.4-b3).*Vd - (Vd.^2/2)))*1000', 'independent', 'Vd', 'dependent', 'Id' );opts = fitoptions( 'Method', 'NonlinearLeastSquares' );opts.Display = 'Off';opts.StartPoint = [0.311215042044805 0.528533135506213];% Fit model to data.[fitresult, gof] = fit( xData, yData, ft, opts )% Plot fit with data.%figure( 'Name', 'Vg = 0.4V' );
h3 = plot( fitresult, xData, yData, 'ok')h3(1).LineWidth = 1;h3(2).LineWidth = 2;%legend( h3, 'Id4 vs. Vd', 'Vg = 0.4V', 'Location', 'NorthEast' );
% Label axes%xlabel Vd%ylabel Id4
%grid on% Fit: 'Vg = 0.6V'.
[xData, yData] = prepareCurveData( Vd, Id6 );% Set up fittype and options.ft = fittype( '(a4.*0.00575.*((0.6-b4).*Vd - (Vd.^2/2)))*1000', 'independent', 'Vd', 'dependent', 'Id' );opts = fitoptions( 'Method', 'NonlinearLeastSquares' );opts.Display = 'Off';opts.StartPoint = [0.165648729499781 0.601981941401637];% Fit model to data.[fitresult, gof] = fit( xData, yData, ft, opts )% Plot fit with data.%figure( 'Name', 'Vg = 0.6V' );
h4 = plot( fitresult, xData, yData, 'ok')h4(1).LineWidth = 1;h4(2).LineWidth = 2;%legend( h4, 'Id6 vs. Vd', 'Vg = 0.6V', 'Location', 'NorthEast' );
% Label axes%xlabel Vd%ylabel Id6
%grid on% Fit: 'Vg = 0.8V'.
[xData, yData] = prepareCurveData( Vd, Id8 );% Set up fittype and options.ft = fittype( '(a5.*0.00575.*((0.8-b5).*Vd - (Vd.^2/2)))*1000', 'independent', 'Vd', 'dependent', 'Id' );opts = fitoptions( 'Method', 'NonlinearLeastSquares' );opts.Display = 'Off';opts.StartPoint = [0.262971284540144 0.654079098476782];% Fit model to data.[fitresult, gof] = fit( xData, yData, ft, opts )% Plot fit with data.%figure( 'Name', 'Vg = 0.8V' );
h5 = plot( fitresult, xData, yData, 'ok')h5(1).LineWidth = 1;h5(2).LineWidth = 2;%legend( h5, 'Id8 vs. Vd', 'Vg = 0.8V', 'Location', 'NorthEast' );
% Label axes%xlabel Vd%ylabel Id8
%grid on% Fit: 'Vg = 1.0V'.
[xData, yData] = prepareCurveData( Vd, Id10 );% Set up fittype and options.ft = fittype( '(a6.*0.00575.*((1.0-b6).*Vd - (Vd.^2/2)))*1000', 'independent', 'Vd', 'dependent', 'Id' );opts = fitoptions( 'Method', 'NonlinearLeastSquares' );opts.Display = 'Off';opts.StartPoint = [0.689214503140008 0.748151592823709];% Fit model to data.[fitresult, gof] = fit( xData, yData, ft, opts )% Plot fit with data.%figure( 'Name', 'Vg = 1.0V' );
h6 = plot( fitresult, xData, yData, 'ok')h6(1).LineWidth = 1;h6(2).LineWidth = 3;%legend( h6, 'Id10 vs. Vd', 'Vg = 1.0V', 'Location', 'NorthEast' );
% Label axes%xlabel Vd%ylabel Id10
%grid on% Fit: 'Vg = 1.2V'.
[xData, yData] = prepareCurveData( Vd, Id12 );% Set up fittype and options.ft = fittype( '(a7.*0.00575.*((1.2-b7).*Vd - (Vd.^2/2)))*1000', 'independent', 'Vd', 'dependent', 'Id12' );opts = fitoptions( 'Method', 'NonlinearLeastSquares' );opts.Display = 'Off';opts.StartPoint = [0.380445846975357 0.567821640725221];% Fit model to data.[fitresult, gof] = fit( xData, yData, ft, opts )% Plot fit with data.%figure( 'Name', 'Vg = 1.2V' );
h7 = plot( fitresult, xData, yData, 'ok')h7(1).LineWidth = 1;h7(2).LineWidth = 2;%legend( h7, 'Id vs. Vd', 'Vg = 1.2V', 'Location', 'NorthEast' );
% Label axes%xlabel Vd%ylabel Id12
%grid ongrid onxlabel ('Drain Voltage (V)')ylabel ('Drain Current (mA/um)')title ('Drain Current vs Drain Voltage w/ varying Gate Voltage')hold off
Best Answer