Quantcast
Channel: MaplePrimes - Questions and Posts tagged with solve
Viewing all articles
Browse latest Browse all 1089

How to solve this chemical equilibrium equation without applying manual simplification of the expression.

$
0
0

I have a question about a calculation I was just trying to do. For some context, I am trying to calculate the pH of a solution of a weak acid in water. When the concentration of the weak acid is low enough, we need to consider the effect of ionization of the water itself (ie, autoprotolysis of water), since the order of magnitude of this ionization is the same as the order of magnitude of the ions due to the weak acid in this case of very low concentration.

There is a specific formula that can be used for this, which is shown below.

K_a is a constant that depends on the weak acid being considered, and K_w is a constant as well (for the autoprotolysis of water). I am interested in solving for the concentration of hydronium, given an initial concentration of the weak acid [HA]_initial.

I'd like to solve the equation for different values of [HA]_initial.

In the calculations below, I am trying to solve for [H__3*LinearAlgebra:-Transpose(O)] in the expression

K__a = ([H__3*LinearAlgebra:-Transpose(O)])([H__3*LinearAlgebra:-Transpose(O)]-K__w/[H__3*LinearAlgebra:-Transpose(O)])/(HA__initial+[-H__3*LinearAlgebra:-Transpose(O)]+K__w/[H__3*LinearAlgebra:-Transpose(O)])

Below, I use x as the concentration of hydronium [H__3*LinearAlgebra:-Transpose(O)] and K__a = 5*10^(-3), K__w = 10^(-14), HA__initial = 10^(-3)

evalf(solve((x^2-10^(-14))/(10^(-3)-x+10^(-14)/x) = 5*10^(-3), x))

0.854101976e-3-0.4e-11*I, -0.5854101969e-2-0.465063510e-12*I, -0.9e-11+0.3865063510e-11*I

(1)

If I use a manual simplification (noting that K__w is extremely small compared to reasonable values of [H__3*LinearAlgebra:-Transpose(O)], then I am able to get real solutions.

evalf(solve(x^2/(10^(-3)-x) = 5*10^(-3), x))

-0.5854101966e-2, 0.854101966e-3

(2)

Now, looking at the complex solutions, the imaginary parts are very small and the real parts of two of the three solutions match the real solutions above, so I guess perhaps I could have just ignored those complex parts.

On the other hand, if I try to do similar calculations but with HA__initial = 10^(-6), I get

evalf(solve((x^2-10^(-14))/(10^(-6)-x+10^(-14)/x) = 5*10^(-3), x))

0.1009702e-5-0.3e-11*I, -0.5000999802e-2-0.332050808e-12*I, -0.9902e-8+0.3132050808e-11*I

(3)

evalf(solve(x^2/(10^(-6)-x) = 5*10^(-3), x))

-0.5000999800e-2, 0.999800e-6

(4)

So here, I don't see a complex solution that looks like the positive real solution above. Which means that I am not sure if the equation with the complex solutions (which is not simplified) is useful to me (I am doing various such calculations with different values of "`HA__initial`)".

Download concentrations.mw


Viewing all articles
Browse latest Browse all 1089

Trending Articles