penalties_and_restraints
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
penalties_and_restraints [2016/10/09 14:02] – created johnsoevans | penalties_and_restraints [2022/11/03 15:08] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Penalties and Restraints ====== | ||
+ | |||
+ | These are discussed in section 5 of the Tech Ref. The notes below are all covered in Tech Ref but in a slightly different order. | ||
+ | |||
+ | Imagine a simple case where you want to use some form of soft-restraint to keep a coordinate x1 close to a particular fractional coordinate, e.g. close to 0.137. | ||
+ | |||
+ | * In topas you could use a penalty equation: penalty = (x1 - 0.137)^2; | ||
+ | |||
+ | * Or you could use a restraint equation: restraint = (x1 - 0.137); | ||
+ | |||
+ | * Internally topas will square the restraint equation. | ||
+ | |||
+ | * Don’t get too confused by the terms “penalty” and “restraint”. | ||
+ | |||
+ | * Soft-restraints differ from constraints. | ||
+ | |||
+ | * Restraint equations are handled by the least squares in exactly the same way as experimental observations (they are “extra observations”). | ||
+ | |||
+ | * Penalties are typically used to influence the direction of a refinement. | ||
+ | |||
+ | * Topas mimimises the overall Chi^2, which is a weighted sum of Chi^2(data) + k1 Chi^2(penalties) + k2*Chi^2(restraints) where k1 and k2 are weights for penalties and restraints (see the manual for exact definitions). | ||
+ | |||
+ | * Topas uses a separate A matrix for the data, penalties and restraints. | ||
+ | |||
+ | * If you have several penalty equations you can change their relative weighting by using an equation like: penalty = w*(x1 - 0.137)^2. | ||
+ | |||
+ | * The relative importance of penalties to data can be increased using the “penalties_weighting_K1 1” keyword. | ||
+ | |||
+ | * Tech Ref tells you how to change the penalty/ | ||
+ | |||
+ | * There are differences in how penalties and restraints feed into the minimisation of Chi^2. | ||
+ | |||
+ | * Penalty equations can take any form – i.e. they can be more complex than the sum of differences squared which appear in restraint equations. | ||
+ | |||
+ | * Depending on how you write your soft-restraint equations they will have different weightings against the diffraction data and the mimimisation pathway and final minimum may differ. | ||
+ | |||
+ | * The built-in topas macros for soft-restraints such as Distance_Restrain() mainly apply penalty equations. | ||
+ | |||