package sansmodels; public class CoreShellCylinder extends SANSModel{ private double scale, coreRadius, thickness, background; private double rhoCore, rhoShell, rhoSolvent, coreLength; //Default constructor public CoreShellCylinder() { scale = 1.0; coreRadius = 20.0; thickness = 10.0; coreLength = 400.0; rhoCore = 1.e-6; rhoShell = 4.e-6; rhoSolvent = 1.e-6; background = 0.00; setNumberOfParameters(8); String[] parameters = {"Scale", "Core Radius (A)", "Shell Thickness (A)", "Core Length (A)", "Core SLD (A-2)", "Shell SLD (A-2)", "Solvent SLD (A-2)", "Background (cm-1)"}; setParametersText(parameters); } public CoreShellCylinder(double inScale, double inCoreRadius, double inThickness, double inCoreLength, double inRhoCore, double inRhoShell, double inRhoSolvent, double inBackground) { scale = inScale; coreRadius = inCoreRadius; thickness = inThickness; coreLength = inCoreLength; rhoCore = inRhoCore; rhoShell = inRhoShell; rhoSolvent = inRhoSolvent; background = inBackground; setNumberOfParameters(8); String[] parameters = {"Scale", "Core Radius (A)", "Shell Thickness (A)", "Core Length (A)", "Core SLD (A-2)", "Shell SLD (A-2)", "Solvent SLD (A-2)", "Background (cm-1)"}; setParametersText(parameters); } private double coreShellCylinderFunc(double inQ, double inZ) { double dr1, dr2, bessarg1, bessarg2, vol1, vol2; double sinarg1, sinarg2, t1, t2, retval; dr1 = rhoCore - rhoShell; dr2 = rhoShell - rhoSolvent; vol1 = Math.PI*coreRadius*coreRadius*coreLength; vol2 = Math.PI*(coreRadius + thickness) *(coreRadius + thickness) *(coreLength+2.0*thickness); bessarg1 = inQ*coreRadius*Math.sin(inZ); bessarg2 = inQ*(coreRadius+thickness)*Math.sin(inZ); sinarg1 = inQ*(coreLength/2.0)*Math.cos(inZ); sinarg2 = inQ*(coreLength/2.0 + thickness)*Math.cos(inZ); t1 = 2.0*vol1*dr1*Math.sin(sinarg1)/sinarg1 *SpecialFunction.j1(bessarg1)/bessarg1; t2 = 2.0*vol2*dr2*Math.sin(sinarg2)/sinarg2 *SpecialFunction.j1(bessarg2)/bessarg2; return (t1+t2)*(t1+t2)*Math.sin(inZ); } public double getFormFactor(double inX) { int nord = 76; double va, vb, summ, zi, answer, yyy; double vol; va = 0.0; vb = Math.PI/2.0; summ = 0.0; for(int i=0;i