Trace:

# Differences

This shows you the differences between two versions of the page.

Next revision | Previous revision | ||

refining_setting_weight_percents_directly [2011/08/25 08:46] alancoelho created |
refining_setting_weight_percents_directly [2015/10/29 06:33] (current) rowlesmr3 |
||
---|---|---|---|

Line 1: | Line 1: | ||

+ | ====== Refining/Setting Weight Percents directly ====== | ||

+ | ==== Version 5 ==== | ||

+ | |||

+ | The macro Known_Weight_Percent can be used to either set a weight percent or to refine a weight percent. For example: | ||

+ | |||

+ | str... | ||

+ | ' scale parameter must not be defined for this phase | ||

+ | Known_Weight_Percent(10) ' set weight percent to 10 | ||

+ | |||

+ | To refine the weight percent then the following could be used: | ||

+ | |||

+ | str... | ||

+ | prm wt1 10 min 0 max 100 | ||

+ | Known_Weight_Percent(wt1) | ||

+ | |||

+ | Only one phase can have its weight percentage set by this macro. All remaining phases must have a scale factor. | ||

+ | |||

+ | ==== Version 4.1 ==== | ||

+ | |||

Symbols used here are defined in the Technical Reference entry for [cell_mass !E] [cell_volume !E] [weight_percent !E] | Symbols used here are defined in the Technical Reference entry for [cell_mass !E] [cell_volume !E] [weight_percent !E] | ||

Ignoring the Brindley correction we can write | Ignoring the Brindley correction we can write | ||

- | |||

Sp = Q_sum wp / (Mp Vp (1 – wp)) | Sp = Q_sum wp / (Mp Vp (1 – wp)) | ||

- | |||

where Qsum is Qp as written in the manual except that Sp Mp Vp is excluded. | where Qsum is Qp as written in the manual except that Sp Mp Vp is excluded. | ||

Thus if you had four phases and you knew the weight percents w1, w2, w3, w4 then you could write: | Thus if you had four phases and you knew the weight percents w1, w2, w3, w4 then you could write: | ||

- | |||

s1 = (s2 m2 + s3 m3 + s4 m4) w1 / (m1 (1 - w1)) | s1 = (s2 m2 + s3 m3 + s4 m4) w1 / (m1 (1 - w1)) | ||

s2 = (s1 m1 + s3 m3 + s4 m4) w2 / (m2 (1 - w2)) | s2 = (s1 m1 + s3 m3 + s4 m4) w2 / (m2 (1 - w2)) | ||

s3 = (s1 m1 + s2 m2 + s4 m4) w3 / (m3 (1 - w3)) | s3 = (s1 m1 + s2 m2 + s4 m4) w3 / (m3 (1 - w3)) | ||

s4 = (s1 m1 + s2 m2 + s3 m3) w4 / (m4 (1 - w4)) | s4 = (s1 m1 + s2 m2 + s3 m3) w4 / (m4 (1 - w4)) | ||

- | |||

where | where | ||

- | |||

m1 = M1 V1 | m1 = M1 V1 | ||

m2 = M2 V2 | m2 = M2 V2 | ||

m3 = M3 V3 | m3 = M3 V3 | ||

m4 = M4 V4 | m4 = M4 V4 | ||

- | |||

simplifying: | simplifying: | ||

- | |||

s1 = s2 m2 x1 + s3 m3 x1 + s4 m4 x1 | s1 = s2 m2 x1 + s3 m3 x1 + s4 m4 x1 | ||

s2 = s1 m1 x2 + s3 m3 x2 + s4 m4 x2 | s2 = s1 m1 x2 + s3 m3 x2 + s4 m4 x2 | ||

s3 = s1 m1 x3 + s2 m2 x3 + s4 m4 x3 | s3 = s1 m1 x3 + s2 m2 x3 + s4 m4 x3 | ||

s4 = s1 m1 x4 + s2 m2 x4 + s3 m3 x4 | s4 = s1 m1 x4 + s2 m2 x4 + s3 m3 x4 | ||

- | |||

where | where | ||

- | |||

x1 = w1 / (m1 (1 - w1)) | x1 = w1 / (m1 (1 - w1)) | ||

x2 = w2 / (m2 (1 - w2)) | x2 = w2 / (m2 (1 - w2)) | ||

x3 = w3 / (m3 (1 - w3)) | x3 = w3 / (m3 (1 - w3)) | ||

- | x4 = w4 / (m4 (1 - w4)) | + | x4 = w4 / (m4 (1 - w4)) |

+ | | ||

+ | | ||

+ | | ||

+ | If you have need for up to 9 phases, please see [[refine_weight_percentage|this macro]] for help. | ||

+ | | ||

We need to solve the four equations for three of the scale parameters. We will choose to solve for s1, s2 and s3. | We need to solve the four equations for three of the scale parameters. We will choose to solve for s1, s2 and s3. | ||

Line 40: | Line 54: | ||

Substitute s2 into equation s1: | Substitute s2 into equation s1: | ||

- | |||

s1 = (s1 m1 x2 + s3 m3 x2 + s4 m4 x2) m2 x1 + s3 m3 x1 + s4 m4 x1 | s1 = (s1 m1 x2 + s3 m3 x2 + s4 m4 x2) m2 x1 + s3 m3 x1 + s4 m4 x1 | ||

or, | or, | ||

s1 = (s3 (m3 x2 m2 x1 + m3 x1) + s4 (m4 x2 m2 x1 + m4 x1)) / (1 - m1 x2 m2 x1) | s1 = (s3 (m3 x2 m2 x1 + m3 x1) + s4 (m4 x2 m2 x1 + m4 x1)) / (1 - m1 x2 m2 x1) | ||

- | |||

Let | Let | ||

t13 = (m3 x2 m2 x1 + m3 x1) / (1 - m1 x2 m2 x1) | t13 = (m3 x2 m2 x1 + m3 x1) / (1 - m1 x2 m2 x1) | ||

Line 50: | Line 62: | ||

or, | or, | ||

s1 = s3 t13 + s4 t14 | s1 = s3 t13 + s4 t14 | ||

- | |||

Substitute s2 into equation s3: | Substitute s2 into equation s3: | ||

- | |||

s3 = s1 (m1 x3 + m1 x2 m2 x3) + s3 m3 x2 m2 x3 + s4 (m4 x2 m2 x3 + m4 x3) | s3 = s1 (m1 x3 + m1 x2 m2 x3) + s3 m3 x2 m2 x3 + s4 (m4 x2 m2 x3 + m4 x3) | ||

or, | or, | ||

s3 = (s1 (m1 x3 + m1 x2 m2 x3) + s4 (m4 x2 m2 x3 + m4 x3)) / (1 - m3 x2 m2 x3) | s3 = (s1 (m1 x3 + m1 x2 m2 x3) + s4 (m4 x2 m2 x3 + m4 x3)) / (1 - m3 x2 m2 x3) | ||

- | |||

Let | Let | ||

t31 = (m1 x3 + m1 x2 m2 x3) / (1 - m3 x2 m2 x3) | t31 = (m1 x3 + m1 x2 m2 x3) / (1 - m3 x2 m2 x3) | ||

Line 62: | Line 71: | ||

or, | or, | ||

s3 = s1 t31 + s4 t34 | s3 = s1 t31 + s4 t34 | ||

- | |||

Substituting s1 into s3 we get: | Substituting s1 into s3 we get: | ||

- | |||

s3 = s3 t13 t31 + s4 t14 t31 + s4 t34 | s3 = s3 t13 t31 + s4 t14 t31 + s4 t34 | ||

or, | or, | ||

s3 = s4 (t14 t31 + t34) / (1 - t13 t31) | s3 = s4 (t14 t31 + t34) / (1 - t13 t31) | ||

- | |||

Then we set s4 to a starting refinement value and then calculate s1, s2 and s3 using the above equations, ie. | Then we set s4 to a starting refinement value and then calculate s1, s2 and s3 using the above equations, ie. | ||

- | |||

s3 = s4 (t14 t31 + t34) / (1 - t13 t31) | s3 = s4 (t14 t31 + t34) / (1 - t13 t31) | ||

s1 = s3 t13 + s4 t14 | s1 = s3 t13 + s4 t14 | ||

s2 = s1 m1 x2 + s3 m3 x2 + s4 m4 x2 | s2 = s1 m1 x2 + s3 m3 x2 + s4 m4 x2 | ||

- | |||

Refining on s4 works well and the weight percents are kept to their known values. Similar equations can be written for three phases etc... | Refining on s4 works well and the weight percents are kept to their known values. Similar equations can be written for three phases etc... | ||

Below is and INP file ZRO2-WT.INP (with data file ZRO2.DAT) that shows the above working nicely on Zro2. It uses the helper macro wt_dets to hide some of the details. At the top of the file we see: | Below is and INP file ZRO2-WT.INP (with data file ZRO2.DAT) that shows the above working nicely on Zro2. It uses the helper macro wt_dets to hide some of the details. At the top of the file we see: | ||

- | |||

<code topas>prm s4 0.01 min 1.0e-12 ' REFINABLE | <code topas>prm s4 0.01 min 1.0e-12 ' REFINABLE | ||

prm w1 5 min 1.0e-6 ' Refine of fix depending on prior knowledge | prm w1 5 min 1.0e-6 ' Refine of fix depending on prior knowledge | ||

Line 85: | Line 88: | ||

If all of the weight percents were known then the three weight percents should be fixed to their known values. | If all of the weight percents were known then the three weight percents should be fixed to their known values. | ||

+ | Here's the ZRO2-WT.INP | ||

<code topas>macro wt_dets(n) | <code topas>macro wt_dets(n) | ||

{ | { | ||

Line 161: | Line 164: | ||

wt_dets(4)</code> | wt_dets(4)</code> | ||

+ | --- //[[alan.coelho@bigpond.com|Alan Coelho]] 2011/08/25 19:09// | ||

+ | |||

+ | Weights can be restrained using: | ||

+ | <code topas>'--------------------------- | ||

+ | 'Example of restraining weight percent to a known value | ||

+ | penalties_weighting_K1 .2 | ||

+ | restraint = (Cubic_Zirconia_wt_percent - 36); : 0 | ||

+ | '---------------------------</code> |