gusucode.com > 热力学传导matlab源码程序 > Code\VirtualScan.m

    % Thermal Distortion Due to the Heat Transfer through the Air

%%%%%%%%%%%%%%% Store the Temperatures from COMSOL Model %%%%%%%%%%%%%%%%%

data = textread('DATA2.txt');
%%%%%%%%%%%%%%%%%%%%% Define the Topograghy of the Probe %%%%%%%%%%%%%%%%%%

htip = 18e-6; % Tip Height
thtip = (pi/180)*54; % Tip Angle
omega = 0.262; % Cantiliver Substrate Angle
dtip = 100e-9; % Tip Diameter
wtip = 14e-6; % Tip Width

Ltip = htip/[sin(thtip)]; % Tip Length
Lcant = 150e-6; % Cantilever Length
wcant = 120e-6; % Cantilever Width
dcant = 350e-9; % Cantilever Depth 

L = Ltip + Lcant; % Total Length

Lcantw = 90e-6; % Wide Section Length
Lcants = Lcant - Lcantw; % Small Section Length

xspan = linspace(0,L,200); % x Range

% Defining width and depth of Si3N4 over range of x
wSi = [ ]; % Si3N4 Width
dSi = [ ]; % Si3N4 Depth

% In Range 1: Lcantw - Lcant

SiGrad1w = (wtip - wcant)/(Lcant - Lcantw);
SiInt1w = SiGrad1w*(-Lcant) + wtip;

% In Range 2: Lcant - Ltip

SiGrad2w = (dtip - wtip)/(L - Lcant);
SiInt2w = SiGrad2w*(-L) + dtip;

SiGrad2d = (dtip - dcant)/(L - Lcant);
SiInt2d = SiGrad2d*(-L) + dtip;



for i = 1:length(xspan)
    
    if xspan(i) <= Lcantw
        
        wSi(i) = wcant;
        dSi(i) = dcant;
        
    elseif xspan(i) <= Lcant
        
        wSi(i) = SiGrad1w*xspan(i) + SiInt1w;
        dSi(i) = dcant;
        
    else
        
        wSi(i) = SiGrad2w*xspan(i) + SiInt2w;
        dSi(i) = SiGrad2d*xspan(i) + SiInt2d;
        
    end
    
    ASi(i) = wSi(i) * dSi(i);
    
end
        
% Defining width and depth of Au over range of x
wAu = [ ]; % Au Width
dAu = [ ]; % Au Depth

wAucant = 56e-6; % Width of Au connectors
wAuwide = 102e-6; % Width of wide Au Section
wAutip = 9e-6; % Width of Au at tip

dAuStandard = 145e-9; % Standard Au depth

LAuOffset = 8e-6; % Length of wide Au section

% In Range 1: Lcantw - Lcant

AuGrad1w = (wAutip - wAuwide)/(Lcant - Lcantw);
AuInt1w = AuGrad1w*(-Lcant) + wAutip;

for j = 1:length(xspan)
    
    if xspan(j) <= (Lcantw - LAuOffset)
        
        wAu(j) = wAucant;
        dAu(j) = dAuStandard;
        
    elseif xspan(j) <= Lcantw
        
        wAu(j) = wAuwide;
        dAu(j) = dAuStandard;
         
    elseif xspan(j) <= Lcant
        
        wAu(j) = AuGrad1w*xspan(j) + AuInt1w;
        dAu(j) = dAuStandard;
        
    else
        
        wAu(j) = 0;
        dAu(j) = 0;
        
    end
    
    AAu(j) = wAu(j) * dAu(j);
    
end     

% Defining width and depth of Pt over range of x
wPt = [ ]; % Pt Width
dPt = [ ]; % Pt Depth

wPtStandard = 3.2e-6; % Standard Pt Width
dPtStandard = 40e-9; % Standard Pt Depth


% In Range 1: Lcant - L

PtGrad1w = (dtip - wPtStandard)/(L - Lcant);
PtInt1w = PtGrad1w*(-L) + dtip;

for jj = 1:length(xspan)
    
    if xspan(jj) <= Lcant
        
        wPt(jj) = 0;
        dPt(jj) = 0;
        
    else
        
        wPt(jj) = PtGrad1w*xspan(jj) + PtInt1w;
        dPt(jj) = dPtStandard;
        
    end
    
    APt(jj) = wPt(jj) * dPt(jj);
    
end

%%%%%%%%% Define cantilever-sample seperation H(x) as 100 Node Distrobution %%%%%%%

H = [ ];
Hbase = Ltip * cos((pi / 2) - thtip - omega);

for m = 1:length(xspan)
    
    if xspan(m) <= Lcant
        
        H(m) = Hbase + (Lcant - xspan(m))*sin(omega);
        
    else
        
        H(m) = Hbase - (xspan(m) - Lcant)*cos((pi/2)- thtip - omega);
        
    end
    
end

%%%%%%%%%%%%%%% Define the Ambient Temperature and %%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%% Tip-sample Thermal Conductance %%%%%%%%%%%%%%%%%%%%%%%
 
T0 = 293; % Ambient Temp
Gts = 10e-6; % Tip Sample Thermal Conductance

%%%%%%%%%%%%%%%%%%% Establish substrate coordinater %%%%%%%%%%%%%%%%%%%%% 

r = []; % r is the coordinator for the substrate

for n = 1:length(xspan)
    
    if xspan(n) <= Lcant
        
        r(n) = cos(omega)*xspan(n);
        
    else
        
        r(n) = sin((pi/2) - thtip - omega)*xspan(n) + Lcant*(cos(omega) - sin((pi/2) - thtip - omega));
        
    end
    
end

lmax = 2*r(length(xspan)) ; % Total length of substrate to be scanned lmax = 3*rmax

l = linspace(0,lmax,2*length(xspan)); % 300 Node Substrate Coordinate (diveded into 300 points)


%%%%%%%%%%%%% Define 300 Node Substrate Topography Hsub(l) %%%%%%%%%%%%%%%

Hsub = [];
SubWidth = 42e-6;
SubStart = l((1/2)*length(l)) - SubWidth/2;
SubEnd = l((1/2)*length(l)) + SubWidth/2;
SubHeight = 5e-6;

for p = 1:length(l)
    
    if l(p) < SubStart
        
        Hsub(p) = 0;
        
    elseif l(p) <= SubEnd

        Hsub(p) = 0;

    else

        Hsub(p) = 0;

    end
    
end

%%%%%%% Define 300 Node Substrate Temperature Distrobution Tsub(l) %%%%%%%

Tsub = [];
% Tmax = 385;
% Tmin = 363;
% TempWidth = 42e-6;
% TempStart = l((2/3)*length(l)) - TempWidth/2;
% TempEnd = l((2/3)*length(l)) + TempWidth/2;

for q = 1:length(l)
    
    if l(q) <= l((1/2) * length(l))
    
        Tsub(q) = data(1);
        
%     elseif l(q) <= TempEnd
%         
%         Tsub(q) = Tmax;
        
    else
        
        Tsub(q) = data(q - 200);
        
    end
    
end


Ttip = [ ]; % Set empty matrix to store average tip temp for each iteration

for ii = 1:((1/2)*length(l))
    
    % Defining Topography and Surface Temperature Profile Under Cantilever
    % at this point of scan
    
    Hsubsec = Hsub(((1/2)*(length(l))+2-ii):(length(l)+1-ii));
    Tsubsec = Tsub(((1/2)*(length(l))+2-ii):(length(l)+1-ii));
    
    
    % Making adjustment if tip is on the topographical variation
    
    if Hsubsec(length(xspan)) > 0
        
        Hsubsec = Hsubsec - Hsubsec(length(xspan));
        
        h = HTC(Hsubsec,H,xspan);
        
    else
        
        h = HTC(Hsubsec,H,xspan);
        
    end
    
   
    
    T = CantileverHeatEqIterative(Tsubsec,T0,Gts,AAu,ASi,APt,wSi,h,xspan);
    
    Ttip(ii) = mean(T(192:200));
    
    
end
  
title('Virtual Scanning Technique');
subplot(2,1,1); plot(data,'LineWidth',2); xlabel('point'); ylabel('Temperature(K)'); 
subplot(2,1,2); plot(Ttip,'LineWidth',2);xlabel('point'); ylabel('Temperature(K)');