1 Pages (8 items)
FindRoot Chemical Balance - FindRoot Chemical Balance - Messages
#1 Posted: 10/29/2016 11:10:59 PM
"I was using SMath 0.98.6128 an NonlinerSolver 1.1.6099.14159"
Try that one Radovan
Jean
Solve Given_Find [UN CO2].sm (25 KiB) downloaded 65 time(s).
Try that one Radovan
Jean
Solve Given_Find [UN CO2].sm (25 KiB) downloaded 65 time(s).
1 users liked this post
Radovan Omorjan 10/30/2016 3:59:00 AM
#2 Posted: 10/30/2016 4:14:35 AM
Wrote"I was using SMath 0.98.6128 an NonlinerSolver 1.1.6099.14159"
Try that one Radovan
Jean
Solve Given_Find [UN CO2].sm (25 KiB) downloaded 65 time(s).
Thank you Jean for this example,
This is a quite tricky example for root solving because the results are quite close to zero. Your version does not work for me, FindRoot() failed here (it gives me few rather high values of concentrations, order of magnitude 10^5). As usual, when I change the IC, I can get the result which gives the balance equations close to zero. However, as the solutions are also close to zero we can get small negative values as well. This is not acceptable as the solution because we have concentrations here (nonnegative values). Here I changed the last two parameters for FindRoot() (relative and absolute errors) and I get all the positive values.
Moreover, the Mathcad solution is more agreeable (for example, H.equil=OH.equil=10^-7). Carbonic acid is the subject, our solution will indicate that this is stronger acid than expected - which is not the case.
Regards,
Radovan
P.S. By more careful examining this case, I think even Mathcad solution is quite suspicious...see the next post
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Posted: 10/30/2016 8:36:45 AM
#4 Posted: 10/30/2016 11:47:56 AM
"Carbonic acid" is a monkey business to manage. Especially wrt to
atmospheric gas phase and temperature. That reminds me Syncrude
[Alberta tar sand] asked me to improve their pH control. Good thing
I had several "Doctors in Chemestry" to help me and vice versa.
That is 35 years back and got rusted/diluted, since.
I will check your latest post [just arrived as I type this one]
How can you trust those very small sanity results, FindRoot is
only ± 0.0001 !!! ???
I managed a bit more from Mathcad.
Thanks Radovan, Jean
______________________________________________
The very original document is Mathcad 7 or lower from Dr. Griffin.
No more in contact from years.
Solve Given_Find [UN CO2].sm (101 KiB) downloaded 52 time(s).
atmospheric gas phase and temperature. That reminds me Syncrude
[Alberta tar sand] asked me to improve their pH control. Good thing
I had several "Doctors in Chemestry" to help me and vice versa.
That is 35 years back and got rusted/diluted, since.
I will check your latest post [just arrived as I type this one]
How can you trust those very small sanity results, FindRoot is
only ± 0.0001 !!! ???
I managed a bit more from Mathcad.
Thanks Radovan, Jean
______________________________________________
The very original document is Mathcad 7 or lower from Dr. Griffin.
No more in contact from years.
Solve Given_Find [UN CO2].sm (101 KiB) downloaded 52 time(s).
1 users liked this post
Radovan Omorjan 10/30/2016 12:40:00 PM
#5 Posted: 10/30/2016 12:37:15 PM
You are very welcome Jean,
I do not have experience with this system at all, I just used logs because of low concentrations. I know from somewhere ( I forgot from where? ) that logs might help. Actually, not always. It might get you into troubles when you get logs from negative values (complex numbers etc.). BTW, FindRoot() is not only ± 0.0001 (I think). Look at the last two numbers arguments of FindRoot()- these are for controlling relative and absolute errors.
I know of Dr. Griffin Mathcad pages many years back as well.
Regards,
Radovan
P.S. You might forget to divide by C(x) to get the plot? - not sure

I do not have experience with this system at all, I just used logs because of low concentrations. I know from somewhere ( I forgot from where? ) that logs might help. Actually, not always. It might get you into troubles when you get logs from negative values (complex numbers etc.). BTW, FindRoot() is not only ± 0.0001 (I think). Look at the last two numbers arguments of FindRoot()- these are for controlling relative and absolute errors.
I know of Dr. Griffin Mathcad pages many years back as well.
Regards,
Radovan
P.S. You might forget to divide by C(x) to get the plot? - not sure
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#6 Posted: 10/30/2016 2:29:52 PM
Thanks Radovan,
I will try FindRoot(4)in my version.
The problem was with your plotting
suggestion it crashes 5346 UNofficial !
Was tried before "freak scale" invention.
Jean
I will try FindRoot(4)in my version.
The problem was with your plotting
suggestion it crashes 5346 UNofficial !
Was tried before "freak scale" invention.
Jean
#7 Posted: 10/30/2016 3:52:01 PM
Just to remember it, when there are multiple unknowns IC and results are assumed to be in alphabetical order (something I'm changing in code refactoring).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#8 Posted: 10/30/2016 5:15:08 PM
WroteJust to remember it, when there are multiple unknowns IC and results are assumed to be in alphabetical order (something I'm changing in code refactoring).
Davide, I always forget that

Best Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 Pages (8 items)
-
New Posts
-
No New Posts