This is an old revision of the document!

# Set or refine weight percentages directly

Macro to aid in the setting or refining of weight percentages for up to 9 phases. The scale factors are calculated from the given weight fractions. Weight fractions can be either fixed or refined.

Contributors: Matthew Rowles, with help from Alan

The equations were calculated in Maple from the standard Hill/Howard quantification algorithm.

The Maple syntax used was

```> restart:
> f2 :=x2 *(s1*m1 + s3*m3 + s4*m4);
> f3 :=x3 *(s1*m1 + s2*m2 + s4*m4);
> f4 :=x4 *(s1*m1 + s2*m2 + s3*m3);
> solve({f2=s2, f3=s3, f4=s4},[s2, s3, s4]);```

where

```mn = cell_mass * cell_volume
xn = wn / (mn (100 - wn))```

## To use the macro

The first phase must have a scale factor: s1. The remaining phases must have weight percentages: w2, w3, … wp.

Instead of giving a phase a scale factor, use this macro. You must tell the macro the number of the phase that it is in, as well as the total number of phases.

Potential useage

```xdd
prm s1 0.0035
prm w1 = 100 - w2 - w3 - w4; : 0 ''this will just report the value
prm !w2 20
prm w3 30
prm w4 30

str
wt_dets(1,4)
str
wt_dets(2,4)
str
wt_dets(3,4)
str
wt_dets(4,4)```
```macro wt_dets(n,p)
{
prm m##n = Get(cell_mass) Get(cell_volume);
prm x##n = w##n / (m##n (100 - w##n));

#m_if p == 2; ''there are 2 phases in total
#m_if n == 1;
''do nothing, as s1 should already be defined elsewhere
#m_elseif n == 2;
prm s##n = x2*s1*m1;
#m_endif

#m_elseif p == 3; ''there are three phases in total
#m_if n == 1;
prm m_denom = (m2*m3*x2*x3-1);
#m_elseif n == 2;
prm s##n = -m1*s1*x2*(m3*x3+1)/m_denom;
#m_elseif n == 3;
prm s##n = -m1*s1*x3*(m2*x2+1)/m_denom;
#m_endif

#m_elseif p == 4;
#m_if n == 1;
prm m_denom = (2*m2*m3*m4*x2*x3*x4+m2*m3*x2*x3+m2*m4*x2*x4+m3*m4*x3*x4-1);
#m_elseif n == 2;
prm s##n = -m1*s1*x2*(m3*m4*x3*x4+m3*x3+m4*x4+1)/m_denom;
#m_elseif n == 3;
prm s##n = -m1*s1*x3*(m2*m4*x2*x4+m2*x2+m4*x4+1)/m_denom;
#m_elseif n == 4;
prm s##n = -m1*s1*x4*(m2*m3*x2*x3+m2*x2+m3*x3+1)/m_denom;
#m_endif

#m_elseif p == 5;
#m_if n == 1;
prm m_denom = (3*m2*m3*m4*m5*x2*x3*x4*x5+2*m2*m3*m4*x2*x3*x4+2*m2*m3*m5*x2*x3*x5+2*m2*m4*m5*x2*x4*x5+2*m3*m4*m5*x3*x4*x5+m2*m3*x2*x3+m2*m4*x2*x4+m2*m5*x2*x5+m3*m4*x3*x4+m3*m5*x3*x5+m4*m5*x4*x5-1);
#m_elseif n == 2;
prm s##n = -m1*s1*x2*(m3*m4*m5*x3*x4*x5+m3*m4*x3*x4+m3*m5*x3*x5+m4*m5*x4*x5+m3*x3+m4*x4+m5*x5+1)/m_denom;
#m_elseif n == 3;
prm s##n = -m1*s1*x3*(m2*m4*m5*x2*x4*x5+m2*m4*x2*x4+m2*m5*x2*x5+m4*m5*x4*x5+m2*x2+m4*x4+m5*x5+1)/m_denom;
#m_elseif n == 4;
prm s##n = -m1*s1*x4*(m2*m3*m5*x2*x3*x5+m2*m3*x2*x3+m2*m5*x2*x5+m3*m5*x3*x5+m2*x2+m3*x3+m5*x5+1)/m_denom;
#m_elseif n == 5;
prm s##n = -m1*s1*x5*(m2*m3*m4*x2*x3*x4+m2*m3*x2*x3+m2*m4*x2*x4+m3*m4*x3*x4+m2*x2+m3*x3+m4*x4+1)/m_denom;
#m_endif

#m_elseif p == 6;
#m_if n == 1;
prm m_denom = (4*m2*m3*m4*m5*m6*x2*x3*x4*x5*x6+3*m2*m3*m4*m5*x2*x3*x4*x5+3*m2*m3*m4*m6*x2*x3*x4*x6+3*m2*m3*m5*m6*x2*x3*x5*x6+3*m2*m4*m5*m6*x2*x4*x5*x6+3*m3*m4*m5*m6*x3*x4*x5*x6+2*m2*m3*m4*x2*x3*x4+2*m2*m3*m5*x2*x3*x5+2*m2*m3*m6*x2*x3*x6+2*m2*m4*m5*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