Message Boards Message Boards

Unexpected solution from Solve?

Hello, and Good evening Wolfram Community. I am running into a rather frustrating issue while trying to run this chemical equilibrium solver program I am working on:

As you can see, I get a rather nice looking solution for dy1, but the solution for dy2 is totally convoluted and way too long to make sense. Furthermore, I did a sanity check by solving a similar form equation below that. As you can see, dy1 and dy2 are supposed to look almost exactly alike, and you can actually see what constants go where in each equation. However, for some reason, dy2 "blows up" and I cannot seem to figure out why. I have gone over the code with a fine toothed comb and cannot pinpoint any mistakes that would cause this to happen.

Any help or advice will be greatly appreciated, thanks.

POSTED BY: Jason L

A workaround: flip the order of the unknown variables and pick the expression you like best for each:

Solve[{dx2 == dx2K, dx3 == dx3K}, {dy1, dy2}]
Solve[{dx2 == dx2K, dx3 == dx3K}, {dy2, dy1}]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract