我的mathematica代码存在一些问题,我想我忽略了一些简单的事情。我为u0到u4获得了有效的解决方案,但它根本不会产生任何情节。另外,我真的很想用ph而不是ohc来绘制,并且也给出了关系。
Solve[{u0 + u1 + u2 + u4 == 1,
k1 == u1/(u0*ohc),
k2 == u2/(u0*ohc^2),
k4 == u4/(u0*ohc^4)},
{u0, u1, u2, u4}]
Solve[Log[10, k1] == 9.5, k1]
Solve[Log[10, k2] == 22.8, k2]
Solve[Log[10, k4] == 32.4, k4]
ph == 14 - poh;
poh == -log[ohc];
Plot[{u1, u2, u3, u4}, {ohc, 0, 1}]
答案 0 :(得分:1)
修正u0和u3拼写错误,对Mathematica的处理方式进行一些调整,这应该会有所帮助。
Clear[u0, u1, u2, u4, k1, k2, k4];
{u0, u1, u2, u4} = {u0, u1, u2, u4} /.
First[Solve[{u0 + u1 + u2 + u4 == 1, k1 == u1/(u0*ohc),
k2 == u2/(u0*ohc^2), k4 == u4/(u0*ohc^4)}, {u0, u1, u2, u4}]]
k1 = k1 /. First[Solve[Log[10, k1] == 9.5, k1]]
k2 = k2 /. First[Solve[Log[10, k2] == 22.8, k2]]
k4 = k4 /. First[Solve[Log[10, k4] == 32.4, k4]]
ph == 14 - poh;
poh == -log[ohc];
Plot[{u0, u1, u2, u4}, {ohc, 0, 1}]
Table[{u0, u1, u2, u4}, {ohc, 0, 1, 1/10}]
并且该表可能有助于解释为什么Plot看起来如此。