Ignore:
Timestamp:
Jul 20, 2011 9:40:32 AM (11 years ago)
Author:
srkline
Message:

Changed 2-yukawa to have better names for the parameters, a macro to plot g(r), and to return S(q)=1000 if the calculation fails, to be more obvious.

Added a Corrlation matrix function (in Wrapper.ipf), but it's not linked anywhere yet, since I don't know yet how best to display it.

Simplified the function to list .ASC files

Added comments to the polarization panel procedures.

Location:
sans/Dev/trunk/NCNR_User_Procedures/Analysis
Files:
2 edited

Legend:

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

    r773 r824  
    6161        xwave_1yuk = alog(log(qmin) + x*((log(qmax)-log(qmin))/num))     
    6262        Make/O/D coef_1yuk = {0.1,50,-1,10} 
    63         make/o/t parameters_1yuk = {"volume fraction","Radius (A)","scale, K","charge, Z"} 
     63        make/o/t parameters_1yuk = {"volume fraction","Radius (A)","scale, K","Decay constant, Z"} 
    6464        Edit parameters_1yuk,coef_1yuk 
    6565        Variable/G root:g_1yuk 
     
    113113        xwave_2yuk = alog(log(qmin) + x*((log(qmax)-log(qmin))/num))     
    114114        Make/O/D coef_2yuk = {0.2,50,6,10,-1,2} 
    115         make/o/t parameters_2yuk = {"volume fraction","Radius (A)","scale, K1","charge, Z1","scale, K2","charge, Z2"} 
     115        make/o/t parameters_2yuk = {"volume fraction","Radius (A)","scale, K1","Decay constant, Z1","scale, K2","Decay constant, Z2"} 
    116116        Edit parameters_2yuk,coef_2yuk 
    117117        Variable/G root:g_2yuk 
     
    162162End 
    163163 
     164// with the regular 2-yukawa plotted, this uses the coefficients to plot g(r) 
     165// 
     166// - no dependency is created, it would just slow things down. So you'll 
     167// need to re-run this every time. 
     168// 
     169//              gr is scaled to dimensionless distance, r/diameter 
     170// 
     171Macro Plot_2Yukawa_Gr() 
     172        //if the regular 2-yukawa procedure is already plotted 
     173        // -- then append it to thte graph yourself 
     174        Duplicate/O ywave_2yuk ywave_2yuk_Igor 
     175 
     176        fTwoYukawa(coef_2yuk,xwave_2yuk,ywave_2yuk_Igor) 
     177         
     178        DoWindow/F Gr_plot 
     179        if(V_flag==0) 
     180                Display gr 
     181                DoWindow/C Gr_plot 
     182                Modifygraph log=0 
     183                SetAxis bottom 0,10 
     184                Modifygraph lsize=2 
     185                Label left "g(r)";DelayUpdate 
     186                Label bottom "dimensionless distance (r/diameter)" 
     187                legend 
     188        endif 
     189         
     190         
     191         
     192End 
     193 
     194 
     195 
    164196// 
    165197Function fTwoYukawa(cw,xw,yw) : FitFunc 
     
    190222                        yw = SqTwoYukawa(xw*radius*2, Z1, Z2, K1, K2, phi, a, b, c1, c2, d1, d2) 
    191223//                      printf("%g      %g\n",q,sq) 
     224                else 
     225                        yw = 1000               //return a really bogus answer, as Yun suggests 
    192226                endif 
    193227        endif 
     
    16021636        gr[0] = 0 
    16031637         
     1638        SetScale/P x,0,dr, gr 
     1639         
    16041640//      Killwaves/Z temp 
    16051641 
  • sans/Dev/trunk/NCNR_User_Procedures/Analysis/Packages/Wrapper_v40.ipf

    r801 r824  
    14581458        return(1) 
    14591459End 
     1460 
     1461// displays the covariance matrix for the current data set in the popup 
     1462// AND whatever was the last fit for that data set. it may not necessarily 
     1463// be the displayed function... 
     1464Function DisplayCovarianceMatrix() 
     1465 
     1466        ControlInfo/W=wrapperpanel popup_0 
     1467        String folderStr=S_Value 
     1468         
     1469        SetDataFolder $("root:"+folderStr) 
     1470         
     1471        Wave M_Covar=M_Covar 
     1472        Duplicate/O M_Covar, CorMat      // You can use any name instead of CorMat 
     1473        CorMat = M_Covar[p][q]/sqrt(M_Covar[p][p]*M_Covar[q][q]) 
     1474        Edit CorMat 
     1475         
     1476        SetDataFolder root: 
     1477         
     1478        return(0) 
     1479End 
Note: See TracChangeset for help on using the changeset viewer.