Titration Curve:(M(n+) with EDTA =>Y(4-) )
-----------------------------------------------
M(n+)+Y(4-) <-> MY(n-4)
Ca(2+) -> n=2 -> Ca(2+)+Y(4-) = CaY(2-4)=CaY(2-)
-----------------------------------------------
peter.vlasschaert@gmail.com, 05/10/2016 
-----------------------------------------------

Definition :  me=[M(n+)] = (Fraction remaining * initial concentration *dilutionfactor)=f1*f2*f3
              -----------------------------------------------------------------------------------------
                                       volume , concentration
              -----------------------------------------------------------------------------------------
              give : M(n+) -> [M(n+)] , yy ml , U Molair conc (erlenmeyer flask)
                     added
                     EDTA  -> [y(4-]  , xx ml , W Molair conc (buret)
              ------------------------------------------------------------------------------------------
              kf  = formation constant = [MY(n-4)]/([M(n+)]*[y(4-)])
                    edta = polyprotic acid (= tetraprotic weak acid)
                    [Y(4-)] = alpha(4) * [EDTA]   ,alpha(4) = f(h,ka1,ka2,ka3,ka4)=g(pH,ka1,ka2,ka3,ka4)
              rem : kfc ,conditional formation for complexes.
                    kfc = kf * alpha(4) = [MY(n-4)]/([M(n+)]*[EDTA])=(my)/(me*edta) = kf *alpha4
              ------------------------------------------------------------------------------------------

Before EP:
----------
----------

xx=0 ml,w no EDTA ,yy ml concentration U

find general equation ,yy,u,w ( rule : v*t = v'*t', v' = (v*t)/t',from analytical chemistry, v'=z )

kill(all)$

p1 : z = (yy*u)/w;

p2:f1=(z-xx)/z;
p3:f2= u;
p4:f3= yy/(yy+xx);
p5:f = rhs(p2)*rhs(p3)*rhs(p4);

p6:me=ev(rhs(p5),p1);

p7:ev(rhs(p6),xx=0);

xx < > 0,ml,w EDTA,yy concentration  U, ( use: z-xx >0),FreeM_before = me

p8:p6;

By  EP:
-------
-------

xx=z ml,w EDTA,yy ml concentration U

p9:me=ev(rhs(p5),xx=z);

me = 0  ? all MY_VAL
     M(n+)+EDTA <-> MY
       0    0       my_val ?

p10:my_val=u*yy/(yy+z);
p11: kfc=kf*alpha4;

find free [M(n+)] :freeM =[M(n+)]
                 M(n+) + EDTA <-> MY
 conc initial      0       0      my_val
 conc formation    freeM  freeM   my_val - freeM

p12: my_ep = my_val - freeM;
p13: me_ep = freeM;
p14: edta_ep = freeM;
p15: kfc = my_ep/(me_ep*edta_ep);

p16:my_ep=ev(rhs(p12),p10);

p17:kfc=ev(rhs(p15),p16);

p18:kfc=ev(rhs(p17),p13,p14);

p19:solve(p18,freeM);

only positive solution ?

p20:part(p19,2);

after EP:
---------
---------

xx > Z ml:w EDTA => z < x_excess=xxx,      freeM_after = [M(n+)]

p21:edta_after=w*(xxx/(yy+z+xxx));
p22:my_after  =u*(yy/(yy+z+xxx));
p23:kfc = my_after/(freeM_after*edta_after);

p24:kfc=ev(rhs(p23),p21,p22);

p25:part(solve(p24,freeM_after),1);