Changeset 941


Ignore:
Timestamp:
May 21, 2020 12:03:11 PM (2 years ago)
Author:
ilavsky
Message:

Added Unified Form Factor to Modeling package Mass Fractal. Improved GUI a bit.

Location:
trunk/User Procedures/Irena
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/User Procedures/Irena/IR1_Fractals.ipf

    r893 r941  
    19161916        Bracket = ( Eta * RC^3 / (BetaVar * Radius^3)) * ((Ksi/RC)^Dv )
    19171917        if(UseUFFormFactor)                                                             //use Unified fit Form factor for sphere...
    1918                 tempFractFitIntensity = Phi * Contrast* 1e-4 * IR1V_SpheroidVolume(Radius,1) * (Bracket * sin((Dv-1)*atan(Qvec*Ksi)) / ((Dv-1)*Qvec*Ksi*(1+(Qvec*Ksi)^2)^((Dv-1)/2)) + (1-Eta)^2 )* IR1V_UnifiedSphereFFSquared(which,Qvec, PDI)
     1918                tempFractFitIntensity = Phi * Contrast* 1e-4 * IR1V_SpheroidVolume(Radius,1) * (Bracket * sin((Dv-1)*atan(Qvec*Ksi)) / ((Dv-1)*Qvec*Ksi*(1+(Qvec*Ksi)^2)^((Dv-1)/2)) + (1-Eta)^2 )* IR1V_UnifiedSphereFFSquared(Radius,Qvec, PDI)
    19191919        else
    19201920                if(BetaVar>1.01 || BetaVar<0.99)
     
    19511951///******************************************************************************************
    19521952
    1953 Function IR1V_UnifiedSphereFFSquared(which, Qvalue, PDI)
    1954         variable Qvalue, which, PDI                                                                             //does the math for Unified fit Sphere Form factor function
    1955 
    1956         NVAR Radius=$("MassFr"+num2str(which)+"_Radius")
     1953Function IR1V_UnifiedSphereFFSquared(Radius, Qvalue, PDI)
     1954        variable Qvalue, Radius, PDI                                                                            //does the math for Unified fit Sphere Form factor function
     1955
     1956        //NVAR Radius=$("MassFr"+num2str(which)+"_Radius")
    19571957   Variable G1=1, P1=4, Rg1=sqrt(3/5)*radius
    19581958   variable B1=PDI*1.62*G1/Rg1^4
  • trunk/User Procedures/Irena/IR2_ModelingMain.ipf

    r893 r941  
    11#pragma rtGlobals=3             // Use modern global access method.
    2 #pragma version=1.31
    3 Constant IR2LversionNumber = 1.24
     2#pragma version=1.32
     3
     4
     5
     6Constant IR2LversionNumber = 1.25
    47
    58//*************************************************************************\
     
    912//*************************************************************************/
    1013
    11 
     14//1.32 add Unified Fit Form Factor to MassFractals.
    1215//1.31 added ability to save individual pop data when running from Scripting tool. COnverted to rtGlobals=3, which may cause some issues...
    1316//1.30 Combined together with IR2L_NLSQFfunctions
     
    481484
    482485                //Mass Fractal
     486                CheckBox MassFrUseUFFF,pos={30,300},size={25,16},proc=IR2L_ModelTabCheckboxProc,title="Use Unified Fit Form Factor?"
     487                CheckBox MassFrUseUFFF,variable= root:Packages:IR2L_NLSQF:MassFrUseUFFF_pop1, help={"Mass Fractal Use Uniofied Fit Form Factor?"}
     488
    483489                SetVariable MassFrPhi,limits={0,Inf,0},variable= root:Packages:IR2L_NLSQF:MassFrPhi_pop1,proc=IR2L_PopSetVarProc
    484                 SetVariable MassFrPhi,pos={8,330},size={140,15},title="Particle Volume = ", help={"Volume of particle (see manual)"}
     490                SetVariable MassFrPhi,pos={8,330},size={140,15},title="Part Vol  = ", help={"Volume of particle (see manual)"}
    485491                CheckBox MassFrPhiFit,pos={155,330},size={25,16},proc=IR2L_ModelTabCheckboxProc,title="Fit?"
    486492                CheckBox MassFrPhiFit,variable= root:Packages:IR2L_NLSQF:MassFrPhiFit_pop1, help={"Fit the MassFrPhi?"}
     
    491497       
    492498                SetVariable MassFrRadius,limits={0,Inf,0},variable= root:Packages:IR2L_NLSQF:MassFrRadius_pop1,proc=IR2L_PopSetVarProc
    493                 SetVariable MassFrRadius,pos={8,350},size={140,15},title="Radius           = ", help={"Q position for this peak"}
     499                SetVariable MassFrRadius,pos={8,350},size={140,15},title="Radius      = ", help={"Q position for this peak"}
    494500                CheckBox MassFrRadiusFit,pos={155,350},size={25,16},proc=IR2L_ModelTabCheckboxProc,title="Fit?"
    495501                CheckBox MassFrRadiusFit,variable= root:Packages:IR2L_NLSQF:MassFrRadiusFit_pop1, help={"Fit the Radius position?"}
     
    500506
    501507                SetVariable MassFrDv,limits={1,2.999,0.1},variable= root:Packages:IR2L_NLSQF:MassFrDv_pop1,proc=IR2L_PopSetVarProc
    502                 SetVariable MassFrDv,pos={8,370},size={140,15},title="Dv (Fract. dim.)  = ", help={"Dv for this fractal"}
     508                SetVariable MassFrDv,pos={8,370},size={140,15},title="Dv (Frac D)= ", help={"Dv for this fractal"}
    503509                CheckBox MassFrDvFit,pos={155,370},size={25,16},proc=IR2L_ModelTabCheckboxProc,title="Fit?"
    504510                CheckBox MassFrDvFit,variable= root:Packages:IR2L_NLSQF:MassFrDvFit_pop1, help={"Fit the Dv width position?"}
     
    509515
    510516                SetVariable MassFrKsi,limits={0,Inf,0},variable= root:Packages:IR2L_NLSQF:MassFrKsi_pop1,proc=IR2L_PopSetVarProc
    511                 SetVariable MassFrKsi,pos={8,390},size={140,15},title="Correl. length = ", help={"Correlation lenght [A]"}
     517                SetVariable MassFrKsi,pos={8,390},size={140,15},title="Correl. len = ", help={"Correlation lenght [A]"}
    512518                CheckBox MassFrKsiFit,pos={155,390},size={25,16},proc=IR2L_ModelTabCheckboxProc,title="Fit?"
    513519                CheckBox MassFrKsiFit,variable= root:Packages:IR2L_NLSQF:MassFrKsiFit_pop1, help={"Fit the Correlation lenght?"}
     
    518524
    519525                SetVariable MassFrBeta,limits={0,inf,0},variable= root:Packages:IR2L_NLSQF:MassFrBeta_pop1, proc=IR2L_PopSetVarProc
    520                 SetVariable MassFrBeta,pos={5,410},size={200,16},title="Particle aspect ratio          =    ", help={"Aspect ratio, 1 for sphere"}
     526                SetVariable MassFrBeta,pos={5,410},size={230,16},title="Particle aspect ratio        =    ", help={"Aspect ratio, 1 for sphere"}
    521527                SetVariable MassFrEta,limits={0,1,0},variable= root:Packages:IR2L_NLSQF:MassFrEta_pop1, proc=IR2L_PopSetVarProc
    522                 SetVariable MassFrEta,pos={5,430},size={200,16},title="Volume filling                   =      ", help={"Volume filling, between 0 and 1"}
     528                SetVariable MassFrEta,pos={5,430},size={230,16},title="Volume filling                 =     ", help={"Volume filling, between 0 and 1"}
    523529                SetVariable MassFrIntgNumPnts,limits={0,inf,0},variable= root:Packages:IR2L_NLSQF:MassFrIntgNumPnts_pop1, proc=IR2L_PopSetVarProc
    524                 SetVariable MassFrIntgNumPnts,pos={5,450},size={200,16},title="Intg. Num. pnts.               =       ", help={"Internal integration pnts, typically 500"}
     530                SetVariable MassFrIntgNumPnts,pos={5,450},size={230,16},title="Intg. Num. pnts.             =     ", help={"Internal integration pnts, typically 500"}
     531                SetVariable MassFrPDI,limits={0,inf,0},variable= root:Packages:IR2L_NLSQF:MassFrPDI_pop1, proc=IR2L_PopSetVarProc
     532                SetVariable MassFrPDI,pos={5,470},size={230,16},title="Unified Fit Form F. PDI     =    ", help={"PDI for Unified Fit Form factor"}
     533
    525534                       
    526535
     
    577586
    578587                SetVariable Contrast,limits={0,Inf,0},variable= root:Packages:IR2L_NLSQF:Contrast_pop1,proc=IR2L_PopSetVarProc
    579                 SetVariable Contrast,pos={8,495},size={150,15},title="Contrast [*10^20] = ", help={"Contrast [*10^20]  of this population"}
     588                SetVariable Contrast,pos={8,495},size={250,15},title="Contrast [*10^20] = ", help={"Contrast [*10^20]  of this population"}
    580589                SetVariable Contrast_set1,limits={0,Inf,0},variable= root:Packages:IR2L_NLSQF:Contrast_set1_pop1,proc=IR2L_PopSetVarProc
    581590                SetVariable Contrast_set1,pos={8,490},size={150,15},title="Contrast data 1 = ", help={"Contrast [*10^20]  of this population for data set 1"}
  • trunk/User Procedures/Irena/IR2_ModelingSupport.ipf

    r930 r941  
    11091109                NVAR tempNVR=$("root:Packages:IR2L_NLSQF:MassFrKsi_pop"+num2str(tab+1))
    11101110                SetVariable MassFrKsi,win=LSQF2_MainPanel, Limits= {0,inf,0.05*tempNVR}
     1111                Checkbox MassFrUseUFFF,win=LSQF2_MainPanel,variable= root:Packages:IR2L_NLSQF:$("MassFrUseUFFF_pop"+num2str(tab+1)), disable=(!(DisplayModelControls)|| !(F_sw==3)|| !(UsePop))
    11111112                Checkbox MassFrKsiFit,win=LSQF2_MainPanel,variable= root:Packages:IR2L_NLSQF:$("MassFrKsiFit_pop"+num2str(tab+1)), disable=(!(DisplayModelControls)|| !(F_sw==3)|| !(UsePop))
    11121113                SetVariable MassFrKsiMin,win=LSQF2_MainPanel,variable= root:Packages:IR2L_NLSQF:$("MassFrKsiMin_pop"+num2str(tab+1)), disable=(!(DisplayModelControls)|| (NoFittingLimits)|| !(F_sw==3)|| !(UsePop))
    11131114                SetVariable MassFrKsiMax,win=LSQF2_MainPanel,variable= root:Packages:IR2L_NLSQF:$("MassFrKsiMax_pop"+num2str(tab+1)), disable=(!(DisplayModelControls)|| (NoFittingLimits)|| !(F_sw==3)|| !(UsePop))
    11141115
    1115                 SetVariable MassFrBeta,win=LSQF2_MainPanel,variable= root:Packages:IR2L_NLSQF:$("MassFrBeta_pop"+num2str(tab+1)), disable=(!(DisplayModelControls)|| !(F_sw==3)|| !(UsePop))
    11161116                SetVariable MassFrEta,win=LSQF2_MainPanel,variable= root:Packages:IR2L_NLSQF:$("MassFrEta_pop"+num2str(tab+1)), disable=(!(DisplayModelControls)|| !(F_sw==3)|| !(UsePop))
    11171117                SetVariable MassFrIntgNumPnts,win=LSQF2_MainPanel,variable= root:Packages:IR2L_NLSQF:$("MassFrIntgNumPnts_pop"+num2str(tab+1)), disable=(!(DisplayModelControls)|| !(F_sw==3)|| !(UsePop))
     1118                NVAR UseUFFF = $("root:Packages:IR2L_NLSQF:MassFrUseUFFF_pop"+num2str(tab+1))
     1119                SetVariable MassFrPDI,win=LSQF2_MainPanel,variable= root:Packages:IR2L_NLSQF:$("MassFrPDI_pop"+num2str(tab+1)), disable=(!(DisplayModelControls)|| !(F_sw==3)|| !(UsePop) || !UseUFFF)
     1120                SetVariable MassFrBeta,win=LSQF2_MainPanel,variable= root:Packages:IR2L_NLSQF:$("MassFrBeta_pop"+num2str(tab+1)), disable=(!(DisplayModelControls)|| !(F_sw==3)|| !(UsePop) || UseUFFF)
    11181121
    11191122
     
    22222225                //Fractals parameters - Mass
    22232226        ListOfPopulationVariablesFR+="MassFrPhi;MassFrRadius;MassFrDv;MassFrKsi;MassFrBeta;MassFrEta;MassFrIntgNumPnts;"
    2224         ListOfPopulationVariablesFR+="MassFrPhiFit;MassFrRadiusFit;MassFrDvFit;MassFrKsiFit;"
     2227        ListOfPopulationVariablesFR+="MassFrPhiFit;MassFrRadiusFit;MassFrDvFit;MassFrKsiFit;MassFrUseUFFF;MassFrPDI;"
    22252228        //ListOfPopulationVariables+="MassFrPhiError;MassFrRadiusError;MassFrDvError;MassFrKsiError;"
    22262229        ListOfPopulationVariablesFR+="MassFrPhiMin;MassFrRadiusMin;MassFrDvMin;MassFrKsiMin;"
     
    26982701                                        NVAR/Z testVar=$(StringFromList(i,ListOfVariables)+"Max_pop"+num2str(j))
    26992702                                        testVar=1               
     2703                                endif
     2704                        endfor
     2705                       
     2706                        ListOfVariables = "MassFrPDI;"          //other parameter
     2707                        For(i=0;i<itemsInList(ListOfVariables);i+=1)
     2708                                NVAR/Z testVar=$(StringFromList(i,ListOfVariables)+"_pop"+num2str(j))
     2709                                if(testVar==0)
     2710                                        testVar=3
    27002711                                endif
    27012712                        endfor
     
    60196030        endif
    60206031        if(UseThePop && UseDatasw)
    6021 //      //and now we need to calculate the model Intensity
    6022 //              NVAR QMin=$("root:Packages:IR2L_NLSQF:Qmin_set"+num2str(DataSet))
    6023 //              NVAR QMax=$("root:Packages:IR2L_NLSQF:Qmax_set"+num2str(DataSet))
    6024 //              Wave/Z Qwave=$("root:Packages:IR2L_NLSQF:Q_set"+num2str(DataSet))
    6025 //              if (!WaveExists (Qwave))
    6026 //                      Abort "Select original data first"
    6027 //              endif
    6028 //              variable StartPoint, EndPoint
    6029 //              StartPoint = BinarySearch(Qwave, QMin)
    6030 //              EndPoint = BinarySearch(Qwave, QMax)
    6031 //              if(StartPoint<0)
    6032 //                      StartPoint=0
    6033 //              endif
    6034 //              if(EndPoint<0)
    6035 //                      EndPoint = numpnts(Qwave)-1
    6036 //              endif
    6037 //              Duplicate/O/R=[StartPoint,EndPoint] Qwave, $("Qmodel_set"+num2str(DataSet))
    6038 //              Wave ModelQ = $("Qmodel_set"+num2str(DataSet))
    60396032                Wave/Z ModelQ = $("Qmodel_set"+num2str(DataSet))
    60406033                if (!WaveExists (ModelQ))
     
    60626055                NVAR BetaVar=$("root:Packages:IR2L_NLSQF:MassFrBeta_pop"+num2str(pop))
    60636056                NVAR Eta=$("root:Packages:IR2L_NLSQF:MassFrEta_pop"+num2str(pop))
     6057                NVAR UseUFFormFactor=$("root:Packages:IR2L_NLSQF:MassFrUseUFFF_pop"+num2str(pop))
     6058                NVAR PDI= $("root:Packages:IR2L_NLSQF:MassFrPDI_pop"+num2str(pop))
    60646059               
    60656060                variable CHiS=IR1V_CaculateChiS(BetaVar)
     
    60706065                variable Bracket
    60716066                Bracket = ( Eta * RC^3 / (BetaVar * Radius^3)) * ((Ksi/RC)^Dv )
    6072                 if(BetaVar!=1)
    6073                         ModelInt = Phi * LocalContrast* 1e-4 * IR1V_SpheroidVolume(Radius,BetaVar) * (Bracket * sin((Dv-1)*atan(ModelQ*Ksi)) / ((Dv-1)*ModelQ*Ksi*(1+(ModelQ*Ksi)^2)^((Dv-1)/2)) + (1-Eta)^2 )* IR2L_CalculateFSquared(pop,ModelQ)
     6067                if(UseUFFormFactor)                                                             //use Unified fit Form factor for sphere...
     6068                        ModelInt = Phi * LocalContrast* 1e-4 * IR1V_SpheroidVolume(Radius,1) * (Bracket * sin((Dv-1)*atan(ModelQ*Ksi)) / ((Dv-1)*ModelQ*Ksi*(1+(ModelQ*Ksi)^2)^((Dv-1)/2)) + (1-Eta)^2 )* IR1V_UnifiedSphereFFSquared(Radius,ModelQ, PDI)
    60746069                else
    6075                         ModelInt = Phi * LocalContrast* 1e-4 * IR1V_SpheroidVolume(Radius,BetaVar) * (Bracket * sin((Dv-1)*atan(ModelQ*Ksi)) / ((Dv-1)*ModelQ*Ksi*(1+(ModelQ*Ksi)^2)^((Dv-1)/2)) + (1-Eta)^2 )* IR2L_CalculateFSquared(pop,ModelQ)
     6070                        if(BetaVar!=1)
     6071                                ModelInt = Phi * LocalContrast* 1e-4 * IR1V_SpheroidVolume(Radius,BetaVar) * (Bracket * sin((Dv-1)*atan(ModelQ*Ksi)) / ((Dv-1)*ModelQ*Ksi*(1+(ModelQ*Ksi)^2)^((Dv-1)/2)) + (1-Eta)^2 )* IR2L_CalculateFSquared(pop,ModelQ)
     6072                        else
     6073                                ModelInt = Phi * LocalContrast* 1e-4 * IR1V_SpheroidVolume(Radius,BetaVar) * (Bracket * sin((Dv-1)*atan(ModelQ*Ksi)) / ((Dv-1)*ModelQ*Ksi*(1+(ModelQ*Ksi)^2)^((Dv-1)/2)) + (1-Eta)^2 )* IR2L_CalculateFSquared(pop,ModelQ)
     6074                        endif
    60766075                endif
    60776076                //      tempFractFitIntensity*=1e-48                                                                    //this is conversion for Volume of particles from A to cm       
Note: See TracChangeset for help on using the changeset viewer.