Ignore:
Timestamp:
Dec 6, 2010 5:24:17 PM (12 years ago)
Author:
srkline
Message:

Updated the parameter names for Raspberry models.

Added Macro to calculate the 2-yukawa potential and graph it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Models/NewModels_2010/Yukawa_SQ_v40.ipf

    r770 r772  
    199199        return (0) 
    200200End 
     201 
     202 
     203Macro Plot_2YukawaPotential() 
     204        fPlot_2YukawaPotential() 
     205End 
     206 
     207Function fPlot_2YukawaPotential() 
     208 
     209        Variable k1,z1,k2,z2,radius 
     210        Variable ii=0,num=500,rmax=10,rval 
     211         
     212        if(exists("root:coef_2yuk") == 0) 
     213                Abort "You must plot the 2-Yukawa model before plotting the potential" 
     214        else 
     215                WAVE coef_2yuk = root:coef_2yuk 
     216        endif 
     217         
     218        radius = coef_2yuk[1] 
     219        K1 = coef_2yuk[2] 
     220        Z1 = coef_2yuk[3] 
     221        K2 = coef_2yuk[4] 
     222        Z2 = coef_2yuk[5] 
     223 
     224        Make/O/D/N=(num) TwoYukawa_Potential,TwoYukawa_Potential_r 
     225        TwoYukawa_Potential_r = x/num*rmax 
     226         
     227        do 
     228                rval = TwoYukawa_Potential_r[ii] 
     229                if(rval <= 1) 
     230                        TwoYukawa_Potential[ii] = inf 
     231                else 
     232                        TwoYukawa_Potential[ii] = -1*K1*(exp(-1*Z1*(rval-1))/rval) - K2*exp(-1*Z2*(rval-1))/rval 
     233                endif 
     234         
     235                ii+=1 
     236        while(ii<num) 
     237         
     238         
     239//      if graph is not open, draw a graph 
     240        DoWindow YukawaPotential 
     241        if(V_flag == 0) 
     242                Display/N=YukawaPotential TwoYukawa_Potential vs TwoYukawa_Potential_r 
     243                ModifyGraph marker=29,msize=2,mode=4,grid=1,mirror=2 
     244                Label bottom "r/Diameter" 
     245                Label left "V(r)/kT" 
     246        endif 
     247         
     248        return(0) 
     249End 
     250 
    201251 
    202252 
Note: See TracChangeset for help on using the changeset viewer.