Jump to content
Geochemist's Workbench Support Forum

Problems with custom rate law script


Recommended Posts

I am trying to implement a custom rate law script (see attached)for albite using React but keep getting the error message "could not evaluate rate law". I am using the rate law and rate parameters included in Palandri and Kharaka (2004; A compilation of rate parameters of water-mineral interaction kinetics for application to geochemical modelling). I cannot see where the problem is with the script so any advice gratefully received.

albite kinetic file.rea

Link to comment
Share on other sites

Hi Ross:

 

I simplified the script quite a bit, and am still getting a syntax error in line 1, even though the format appears to be correct. I'll need to check with the developers to see if I'm doing something wrong here.

 

However, there's a simple work-around. Save the file in notepad with a .bas extension, and load it in as a Rate law script file.

 

Let me know if that resolves the issue.

 

Regards,

 

Tom Meuzelaar

RockWare, Inc.

Link to comment
Share on other sites

Hi Ross:

 

It turns our that the rate law script, as written in the v8 Reaction Modeling user's guide (page 56), reflects command line syntax. The actual code for the direct script editor looks exactly like the code you would put in a .bas file- you only need the code in between the brackets- not the 'kinetic Albite rate_law = { }' part.

 

I hope that makes sense...

 

We'll update the User's Guide to be a little more clear.

 

Regards,

 

Tom Meuzelaar

RockWare, Inc.

Link to comment
Share on other sites

Tom,

 

Thank you for the suggestions. I have tried simplifying my script and including it as a script file (attached - note I needed to change fiel extension to .txt as I cannot upload .bas files) but although React now 'runs' it does not appear to be dissolving any albite. I am probably missing something very obvious!

 

Best regards

Ross

albite kinetic file1.rea

albite_kinetic.txt

Link to comment
Share on other sites

Hi Ross:

 

Yes, your rate law evaluates to zero in the output file. I can't spot the issue right off- troubleshooting rate law scripts can tedious and time-consuming. What I recommend is that you simplify the script and first test your neutral, acid and base rates individually. Then put them together into your combined rate law.

 

Hope that helps,

 

Tom Meuzelaar

RockWare, Inc.

Link to comment
Share on other sites

Tom,

 

Thank you for looking at the script for me - managed to spend a little more time on this and found that the problem was with the quotes on H+ activity (thought it would be obvious!). Anyway, for the benefit of the forum, the attached script now works and so will act as a template for those using the kinetic data in Palandri and Kharaka 2004.

albite.rea

Link to comment
Share on other sites

Hi Ross:

 

Glad you were able to get it working- yes, usually the problem for has been a missing quote here, or an extra parenthesis there.... The devil is in the details.

 

I appreciate you sharing with the User's Group.

 

Regards,

 

Tom Meuzelaar

RockWare, Inc.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...