Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.8K Views
|
14 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Error: "Solve was unable to solve the system" after using Rationalize

Posted 4 years ago
POSTED BY: Zhenyu Zeng
14 Replies
Posted 4 years ago

Thanks. I know now.

POSTED BY: Zhenyu Zeng
Posted 4 years ago
POSTED BY: Zhenyu Zeng
Posted 4 years ago

Zhenyu,

solution = 
 NSolve[c/b == pK1/H && d/c == pK2/H && b == pK0 a && (a + b + c + d) 12 == DIC, {a, b, c, d}] // Simplify

(* Solution for a *)
a /. solution

You may be tempted to do this

a = a /. solution

but that is not a good idea because now a has a value and that will change the equations passed to NSolve.

Read the documentation.

POSTED BY: Rohit Namjoshi
Posted 4 years ago
POSTED BY: Bill Nelson
Posted 4 years ago

Hello. What's the meaning of [[1]] in your last code? I felt I can't understand it. May you explain it to me?

POSTED BY: Zhenyu Zeng
Posted 4 years ago
POSTED BY: Bill Nelson
Posted 4 years ago

Hello, after these code ran:

then I input c, but I can't get the c value but get a c symbol. Why?

POSTED BY: Zhenyu Zeng
Posted 4 years ago

Hello, thanks for your reply. I found in output there were some 1.t, may can I make it to t not 1.t. Thanks.

POSTED BY: Zhenyu Zeng
Posted 4 years ago

If you replace

pH = -Log[H]

with

H=E^-pH

then Solve will find solutions in terms of pH instead of H. Please check carefully that the signs of H and pH allow this change to be correctly made. I do not know if the form of this solution is what you need. Please carefully test the solutions to make certain that they are correct.

POSTED BY: Bill Nelson
Posted 4 years ago

Hello, thanks for your reply. Is there a way to show out with pH not H?

POSTED BY: Zhenyu Zeng
Posted 4 years ago

I know now.

POSTED BY: Zhenyu Zeng
Posted 4 years ago

Is there a way to show the output with ScienticForm?

POSTED BY: Zhenyu Zeng
Posted 4 years ago

May you tell me why one of terms has not been rationalized?

POSTED BY: Zhenyu Zeng
Posted 4 years ago

If you display the value of pK0 I believe you will see that it did not completely rationalize and there is still a decimal point in one of the terms. This is probably because of the number of digits after the decimal point in one of the terms. Changing that expression to

pK0=Rationalize[-2622.38/T - 0.0178471 T + 15.5873, 0]

will force the complete rationalization. The documentation for Rationalize explains this.

Then Solve is able to find your solution.

POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard