Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    specmicp
    @specmicp
    ok, thank you for the information
    bgvinayk
    @bgvinayk

    state = ChemicalState(system)
    I'm getting an error in following line which used to work before:
    state.temperature(25.0, "celsius")
    TypeError: temperature(): incompatible function arguments. The following argument types are supported:

    1. (self: reaktoro.reaktoro4py.ChemicalState, arg0: autodiff::detail::Real<1ul, double>) -> None
    2. (self: reaktoro.reaktoro4py.ChemicalState, arg0: autodiff::detail::Real<1ul, double>, arg1: str) -> None
    3. (self: reaktoro.reaktoro4py.ChemicalState) -> autodiff::detail::Real<1ul, double>

    Is there any solution to fix this?

    Allan Leal
    @allanleal
    Hi @bgvinayk , are you using Reaktoro from conda? What is the version?
    There was a new package produced this morning, v2.0rc19, wondering if this is the issue
    Allan Leal
    @allanleal
    There is something indeed going on with the new release.
    Allan Leal
    @allanleal
    You can install the version before:
    conda install reaktoro=2.0.0rc18
    I'll fix the issue with v2.0rc19
    bgvinayk
    @bgvinayk
    I was using reaktoro from colab. Thanks for the temporary solution.
    Allan Leal
    @allanleal
    There was an update of compilers in conda-forge, and then a mismatch of compiler versions used for reaktoro and autodiff. That's the reason. A new package should be available soon.
    Thanks for reporting this.
    cskv
    @cskv
    Dear Allan,
    Dear Allan, is version 2 meant to supersede version 1? In that case I'll wait for some more documentation and rework my examples to run in version 2. I'll be happy to contribute some as well.
    Allan Leal
    @allanleal
    Hi @cskv , yes, v2 is aimed to be a much more capable and efficient version that v1. If you want to contribute, let's have a chat at some point!
    Yuvasriram
    @Yuvasriram
    Hi @allanleal There is an issue with reaktoro while using in colab. How to fix this?
    image.png
    image.png
    Allan Leal
    @allanleal
    Hi @Yuvasriram . New packages for optima and autodiff (dependencies of reaktoro) were produced, and they may be incompatible with the current package for reaktoro that got installed in colab. I'll publish a new reaktoro package in conda to resolve this. Was this happening before? Did you try it two days ago?
    Yuvasriram
    @Yuvasriram
    Hi @allanleal Actually, it was working till 6:30 pm(IST) yesterday. But now, its not working.
    Allan Leal
    @allanleal
    OK, this confirms then my guess (I uploaded new versions for autodiff and optima late yesterday)
    The new package for reaktoro that will work well with these deps is being built by conda at the moment.
    Thanks for reporting this issue.
    Allan Leal
    @allanleal
    It's working for me now on Google Colab.
    Yuvasriram
    @Yuvasriram
    Thanks a lot @allanleal It's working as expected.
    Omar-Zuair
    @Omar-Zuair
    Hi @allanleal , I wanted to ask if I can access the Pitzer parameters on Reaktoro to add ones for new materials or modify them. I want to model CO2 solubility using an aqueous amine solvent and would like to correlate the pitzer parameters using experimental data.
    Allan Leal
    @allanleal
    Hi Omar. ATM the parameters for the Pitzer model are embedded in the implementation (which needs to be decoupled). This is a planned important work, but I don't have an estimate for when this will be implemented. Can you program in C++?
    3 replies
    bgvinayk
    @bgvinayk
    image.png
    Hi Allan. I have installed reaktoro from environment.yml file. But getting an error in above line. Any suggestions?
    image.png
    image.png
    Svetlana Kyas
    @mtsveta
    Hi @bgvinayk! This is Svetlana, postdoc from Allan's team. He is on vocation at the moment, so I will try to help you.
    From the environment.yml file I see that you are installing 1.2.2 version of reaktoro. At the same time, you are calling db = PhreeqcDatabase("minteq.v4.dat") which is a new functionality from the reaktoro v.2. May I ask if you intend to use the reaktoro v1 or v2?
    If it is v2, you should remove the version of the reaktoro python package in the yml-file.
    Svetlana Kyas
    @mtsveta
    After activating your conda environment, and executing conda list, you should see reaktoro 2.0.0rc22 py39hfc627dd_0 conda-forge if you intend to use the most recent version of reaktoro v2.
    bgvinayk
    @bgvinayk

    Hi @mtsveta Appreciate you quick response. I need to use following code. Which version is recommended?
    db = PhreeqcDatabase("minteq.v4.dat")
    solution = AqueousPhase(speciate("H O Ca Mg Na K C P S Cl N"))
    solution.setActivityModel(ActivityModelDebyeHuckelPHREEQC())
    system = ChemicalSystem(db, solution)
    specs = EquilibriumSpecs(system)
    specs.temperature()
    specs.pressure()
    specs.pH()
    solver = EquilibriumSolver(specs)
    state = ChemicalState(system)

    I have listed reaktoro 2.0.0rc22 version in dependencies now. I am getting some errors like:
    PhreeqcDatabase is not defined
    speciate is not defined
    EquilibriumSpecs is not defined

    I had to use Phreeqc("minteq.v4.dat") instead of PhreeqcDatabase and it worked.
    Also tried removing the reaktoro version and got same result
    Svetlana Kyas
    @mtsveta

    Hi @bgvinayk.

    I need to use following code. Which version is recommended?

    This looks like Reaktoro v2. The snippet of code you shared above runs for me on the 2.0.0rc22 version. Phreeqc("minteq.v4.dat") is the functionality of the version 1.2. I think, you have to make sure that you activate the environment with Reaktoro v2.

    Could you include this lines of code in the try.py script so that I understand better what is going on?

    import sys
    print(sys.path)

    In the command line, it would be python -c 'import sys; print(sys.path)'

    Svetlana Kyas
    @mtsveta

    Also tried removing the reaktoro version and got same result

    I would also try to remove old environment and create the new one from the scratch. Maybe this would help.

    Enrique Garcia Franco
    @EnriqueGarciaFranco

    Hello to all:

    I hope you had a good summer

    I tried creating a new environment

    But since then I get the same errors as @bgvinayk

    It seems like it weren't importing libraries from Reaktoro

    It does

    import reaktoro as rkt

    and then import all

    But it won't be recognized later on the code

    I tried changing the environment and activating it

    Thank you!

    Allan Leal
    @allanleal
    Hi Enrique. I'm checking what is going on. Some dependencies were updated today/recently, and something may be happening related to this.
    Web capture_8-9-2022_205511_colab.research.google.com.jpeg
    As you see above, just used Google Colab to install reaktoro and then run the script in the screenshot. It worked without any issues (the results on the right-hand side). Could you please double check? This is the script I executed:
    from reaktoro import *
    
    db = PhreeqcDatabase("phreeqc.dat")
    
    solution = AqueousPhase(speciate("H O C Na Cl"))
    solution.setActivityModel(chain(
        ActivityModelHKF(),
        ActivityModelDrummond("CO2")
    ))
    
    gases = GaseousPhase("CO2(g)")
    gases.setActivityModel(ActivityModelPengRobinson())
    
    system = ChemicalSystem(db, solution, gases)
    
    T = 25.0 # temperature in celsius
    P = 1.0  # pressure in bar
    
    state = ChemicalState(system)
    state.temperature(T, "celsius")
    state.pressure(P, "bar")
    state.set("H2O"   , 1.0 , "kg")
    state.set("CO2(g)", 10.0, "mol")
    state.set("Na+"   , 4.00, "mol")
    state.set("Cl-"   , 4.00, "mol")
    
    solver = EquilibriumSolver(system)
    solver.solve(state)
    
    props = ChemicalProps(state)
    props.output("props.txt")
    
    aprops = AqueousProps(state)
    aprops.output("aprops.txt")
    
    print("Success! Check outputted files `props.txt` and `aprops.txt`.")
    Allan Leal
    @allanleal
    Also tried in Windows, and all is working fine. Curious to know what you may be doing differently.
    Enrique Garcia Franco
    @EnriqueGarciaFranco

    OK, after chatting one-on-one with Allan it might be the case that I am not working on the right conda environment

    I also had to create a new environment and seems like Reaktoro isn't updated in whichever environment that has been loaded by default on Jupyter Notebook

    I am learning how to change the environment in whichever Python app that I use

    Trying with

    1. Microsoft Visual Studio Code (Community)

    2. Anaconda Jupyter Notebook

    3. Anaconda Spyder

    Allan Leal
    @allanleal
    Thanks, Enrique, for sharing. I highly recommend Visual Studio Code (it's what I use for C++ programming, and Jupyter Notebooks)
    Enrique Garcia Franco
    @EnriqueGarciaFranco

    Yes, thank you. I have been doing my best. Seems that I will need to invest a couple of days into getting all done with it

    I have been able to fix it with Anaconda

    The issue was indeed with the environment

    I fixed it by launching Spyder from Anaconda Navigator after choosing my environment in the very same GUI

    So, my advice for @bgvinayk would be to choose the right environment, in Anaconda distribution or Visual Studio Code

    I find Anaconda easier for me. Visual Code Studio has a more abstract GUI

    1 reply
    bgvinayk
    @bgvinayk
    image.png
    Hi @allanleal I am using above attached code to get tricalcium phosphate saturation index with variation in temperature. I just noticed that its saturation index is decreasing with increase in temperature. But theoretically it is expected to increase with increase in temperature.
    bgvinayk
    @bgvinayk
    image.png