Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default effective radius type (Trac #1201) #191

Closed
pkienzle opened this issue Mar 30, 2019 · 4 comments
Closed

default effective radius type (Trac #1201) #191

pkienzle opened this issue Mar 30, 2019 · 4 comments

Comments

@pkienzle
Copy link
Contributor

pkienzle commented Mar 30, 2019

In sasmodels, all platforms.

For the beta_approx branch we are using a default of 0 as the effective radius type (i.e., use the value from the parameter table instead of the form factor calculation) rather than whatever the model was returning before.

Do we want this as the default?

Or should we set the default to 1 and make sure that is the "best" effective radius to use when computing P@S?

There is also an issue with reloading a saved P@S fit from 4.2 and earlier, which all implicitly use old ER radius type.

Do we try to set the equivalent effective radius type parameter in the model?

Or do we let it silently use the default value for radius_effective from S?

Note: if the old ER is not the first effective radius type for any model then conversion with need a table for each model giving the number to use. Not difficult, but a detail to test if we decide to support correct reloading of old P@S models.

Migrated from http://trac.sasview.org/ticket/1201

{
    "status": "closed",
    "changetime": "2019-03-19T14:49:37",
    "_ts": "2019-03-19 14:49:37.985291+00:00",
    "description": "In sasmodels, all platforms.\n\nFor the beta_approx branch we are using a default of 0 as the effective radius type (i.e., use the value from the parameter table instead of the form factor calculation) rather than whatever the model was returning before.\n\nDo we want this as the default?\n\nOr should we set the default to 1 and make sure that is the \"best\" effective radius to use when computing P@S?\n\nThere is also an issue with reloading a saved P@S fit from 4.2 and earlier, which all implicitly use old ER radius type.\n\nDo we try to set the equivalent effective radius type parameter in the model?  \n\nOr do we let it silently use the default value for radius_effective from S?\n\nNote: if the old ER is not the first effective radius type for any model then conversion with need a table for each model giving the number to use.  Not difficult, but a detail to test if we decide to support correct reloading of old P@S models.\n",
    "reporter": "pkienzle",
    "cc": "",
    "resolution": "fixed",
    "workpackage": "Beta Approximation Project",
    "time": "2018-10-19T22:15:02",
    "component": "sasmodels",
    "summary": "default effective radius type",
    "priority": "major",
    "keywords": "",
    "milestone": "sasmodels 1.0",
    "owner": "GitHub <[email protected]>",
    "type": "defect"
}
@RichardHeenan
Copy link
Contributor

Trac update at 2018/10/22 10:39:35: richardh commented:

Hmm this is going to be tricky. Suspect that for backwards compatibility 5.0 ought to default to doing what 4.2 would do, thus as Paul K says to make sure that effective radius defaults to the one used by 4.2  This would reduce or perhaps remove the need for conversions.

Would it help, before we get too far along with this, to change the default type of 0 to mean use ER from P(Q) rather than take a user supplied value?

@pkienzle
Copy link
Contributor Author

Trac update at 2018/10/22 16:04:05: pkienzle commented:

The code in product.py needs to know whether to use the user value or the computed value independent of model. I'm guessing the GUI code also needs to know, given that it places the computed value into the user value slot when a computed value is requested. So best to leave that as option 0.

Easiest is to set the default to 1 and make sure that the first effective radius is the one defined in sasview 4.1.

@pkienzle
Copy link
Contributor Author

Trac update at 2018/10/29 20:30:03:

  • pkienzle changed _comment0 from:

A lot of the old models use some function which is perhaps the average radius of the equivalent cylinder, but which is not implemented for the new models. There are a couple of models which have an equivalent mode different from 1. There are a number of models that did not have ER before, but those ones won't be used with structure factors so it doesn't matter to the loader what they used to be. The new models all use the outer radius equivalent sphere, except mono gauss coil which uses Rg.

beta_approx branch radius_effective_mode value for the old style ER function. Uses -- for not implemented and N/A for no equivalent.

||= Model =||= R_eff mode =||= old ER =||
|| barbell || N/A || -- ||
|| capped_cylinder || N/A || -- ||
|| core_multi_shell || 1 || outer radius ||
|| core_shell_bicelle || N/A || -- ||
|| core_shell_bicell_elliptical || N/A || -- ||
|| core_shell_bicell_elliptical_belt_rough || N/A || -- ||
|| core_shell_cylinder || N/A || outer cylinder average radius ||
|| core_shell_ellipsoid || N/A || eq. cylinder average radius ||
|| core_shell_parallelepiped || N/A || eq. cylinder average radius ||
|| core_shell_sphere || 1 || outer radius ||
|| cylinder || N/A || average radius ||
|| ellipsoid || 2 || radius from curvature ||
|| elliptical_cylinder || N/A || eq. cylinder average radius ||
|| fractal || -- || -- ||
|| fractal_core_shell || -- || outer radius ||
|| fuzzy_sphere || 1 || radius ||
|| hollow_cylinder || N/A || average radius ||
|| hollow_rectangular_prism || N/A || eq. cylinder average radius ||
|| hollow_rectangular_prism_thin_walls || N/A || eq. cylinder average radius ||
|| mono_gauss_coil || N/A || -- ||
|| multilayer_vesicle || 1 || outer radius ||
|| onion || 1 || outer radius ||
|| parallelepiped || N/A || equivalent cylinder average radius ||
|| pearl_necklace || -- || equivalent volume ||
|| pringle || N/A || equivalent cylinder average radius ||
|| raspberry || N/A || -- ||
|| rectangular_prism || N/A || equivalent cylinder average radius ||
|| sphere || 1 || radius ||
|| spherical_sld || 1 || outer radius ||
|| triaxial_ellipsoid || N/A || equivalent ellipsoid average curvature ||
|| vesicle || 1 || outer radius ||

to:

1540846710754685

  • pkienzle changed _comment1 from:

A lot of the old models use some function which is perhaps the average radius of the equivalent cylinder, but which is not implemented for the new models. There are a couple of models which have an equivalent mode different from 1. There are a number of models that did not have ER before, but those ones won't be used with structure factors so it doesn't matter to the loader what they used to be. The new models all use the outer radius equivalent sphere, except mono gauss coil which uses Rg.

beta_approx branch radius_effective_mode value for the old style ER function. Uses -- for not implemented and N/A for no equivalent.

||= Model =||= R_eff mode =||= old ER =||
|| barbell || N/A || -- ||
|| capped_cylinder || N/A || -- ||
|| core_multi_shell || 1 || outer radius ||
|| core_shell_bicelle || N/A || -- ||
|| core_shell_bicell_elliptical || N/A || -- ||
|| core_shell_bicell_elliptical_belt_rough || N/A || -- ||
|| core_shell_cylinder || N/A || outer cylinder average radius ||
|| core_shell_ellipsoid || N/A || eq. cylinder average radius ||
|| core_shell_parallelepiped || N/A || eq. cylinder average radius ||
|| core_shell_sphere || 1 || outer radius ||
|| cylinder || N/A || average radius ||
|| ellipsoid || 2 || radius from curvature ||
|| elliptical_cylinder || N/A || eq. cylinder average radius ||
|| fractal || -- || -- ||
|| fractal_core_shell || -- || outer radius ||
|| fuzzy_sphere || 1 || radius ||
|| hollow_cylinder || N/A || average radius ||
|| hollow_rectangular_prism || N/A || eq. cylinder average radius ||
|| hollow_rectangular_prism_thin_walls || N/A || eq. cylinder average radius ||
|| mono_gauss_coil || N/A || -- ||
|| multilayer_vesicle || 1 || outer radius ||
|| onion || 1 || outer radius ||
|| parallelepiped || N/A || equivalent cylinder average radius ||
|| pearl_necklace || -- || equivalent volume ||
|| pringle || N/A || equivalent cylinder average radius ||
|| raspberry || N/A || -- ||
|| rectangular_prism || N/A || equivalent cylinder average radius ||
|| sphere || 1 || radius ||
|| spherical_sld || 1 || outer radius ||
|| triaxial_ellipsoid || N/A || equivalent ellipsoid average curvature ||
|| vesicle || 1 || outer radius ||

The old cylinder ER expression is as follows:
{{{
def ER(radius, length):
ddd = 0.75 * radius * (2 * radius * length + (length + radius) * (length + pi * radius))
return 0.5 * (ddd) ** (1. / 3.)
}}}
I don't see it in [Pedersen 1997], and don't know where it comes from. Maybe [Fournet 1951]?

Parallelepipeds used the long axis to define the equivalent cylinder.

Would adding Rg for everything be useful? This is yet another

to:

1541192594885962

  • pkienzle commented:

A lot of the old models use some function which is perhaps the average radius of the equivalent cylinder, but which is not implemented for the new models. There are a couple of models which have an equivalent mode different from 1. There are a number of models that did not have ER before, but those ones won't be used with structure factors so it doesn't matter to the loader what they used to be. The new models all use the outer radius equivalent sphere, except mono gauss coil which uses Rg.

beta_approx branch radius_effective_mode value for the old style ER function. Uses -- for not implemented and N/A for no equivalent.

||= Model =||= R_eff mode =||= old ER =||
|| barbell || N/A || -- ||
|| capped_cylinder || N/A || -- ||
|| core_multi_shell || 1 || outer radius ||
|| core_shell_bicelle || N/A || -- ||
|| core_shell_bicell_elliptical || N/A || -- ||
|| core_shell_bicell_elliptical_belt_rough || N/A || -- ||
|| core_shell_cylinder || N/A || outer cylinder excl. vol ||
|| core_shell_ellipsoid || N/A || eq. cylinder excl. vol ||
|| core_shell_parallelepiped || N/A || eq. cylinder excl. vol ||
|| core_shell_sphere || 1 || outer radius ||
|| cylinder || N/A || excl. vol ||
|| ellipsoid || 2 || radius from curvature ||
|| elliptical_cylinder || N/A || eq. cylinder excl. vol ||
|| fractal || -- || -- ||
|| fractal_core_shell || -- || outer radius ||
|| fuzzy_sphere || 1 || radius ||
|| hollow_cylinder || N/A || average radius ||
|| hollow_rectangular_prism || N/A || eq. cylinder excl. vol ||
|| hollow_rectangular_prism_thin_walls || N/A || eq. cylinder excl. vol ||
|| mono_gauss_coil || N/A || -- ||
|| multilayer_vesicle || 1 || outer radius ||
|| onion || 1 || outer radius ||
|| parallelepiped || N/A || equivalent cylinder excl. vol ||
|| pearl_necklace || -- || equivalent volume ||
|| pringle || N/A || equivalent cylinder excl. vol ||
|| raspberry || N/A || -- ||
|| rectangular_prism || N/A || equivalent cylinder excl. vol ||
|| sphere || 1 || radius ||
|| spherical_sld || 1 || outer radius ||
|| triaxial_ellipsoid || N/A || equivalent ellipsoid average curvature ||
|| vesicle || 1 || outer radius ||

The old cylinder ER expression is as follows:

def ER(radius, length):
    ddd = 0.75 * radius * (2 * radius * length + (length + radius) * (length + pi * radius))
    return 0.5 * (ddd) ** (1. / 3.)

I don't see it in [Pedersen 1997], and don't know where it comes from. Maybe [Fournet 1951]?

Parallelepipeds used the long axis to define the equivalent cylinder.

Would adding Rg for everything be useful? This is yet another

@sasview-bot
Copy link

Trac update at 2019/03/19 14:49:37:

In changeset 29c455a:

#!CommitTicketReference repository="sasmodels" revision="29c455af8add2421edd313d03218d6a1ba3b7873"
Merge pull request SasView/sasview#318 from SasView/beta_approx

Beta approx

closes #191
closes #192
closes #137
closes SasView/sasview#1130

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants