EquilibriumInverseProblem.hpp
111 auto fixSpeciesAmount(std::string species, double value, std::string units) -> EquilibriumInverseProblem&;
118 auto fixSpeciesAmount(std::string species, double value, std::string units, std::string titrant) -> EquilibriumInverseProblem&;
124 auto fixSpeciesMass(std::string species, double value, std::string units) -> EquilibriumInverseProblem&;
131 auto fixSpeciesMass(std::string species, double value, std::string units, std::string titrant) -> EquilibriumInverseProblem&;
142 auto fixSpeciesActivity(std::string species, double value, std::string titrant) -> EquilibriumInverseProblem&;
149 auto fixSpeciesActivity(std::string species, double value, std::string titrant1, std::string titrant2) -> EquilibriumInverseProblem&;
155 auto fixSpeciesFugacity(std::string species, double value, std::string units) -> EquilibriumInverseProblem&;
162 auto fixSpeciesFugacity(std::string species, double value, std::string units, std::string titrant) -> EquilibriumInverseProblem&;
169 auto fixPhaseAmount(std::string phase, double value, std::string units, std::string titrant) -> EquilibriumInverseProblem&;
176 auto fixPhaseMass(std::string phase, double value, std::string units, std::string titrant) -> EquilibriumInverseProblem&;
183 auto fixPhaseVolume(std::string phase, double value, std::string units, std::string titrant) -> EquilibriumInverseProblem&;
190 auto fixPhaseSetVolume(const std::vector<std::string>& phases, double value, std::string units, std::string titrant) -> EquilibriumInverseProblem&;
205 auto pH(double value, std::string titrant1, std::string titrant2) -> EquilibriumInverseProblem&;
230 auto alkalinity(double value, std::string units, std::string titrant) -> EquilibriumInverseProblem&;
267 auto residualEquilibriumConstraints(VectorConstRef x, const ChemicalState& state) const -> ResidualEquilibriumConstraints;
auto operator=(EquilibriumInverseProblem other) -> EquilibriumInverseProblem &
Assign a copy of an EquilibriumInverseProblem instance.
Definition: EquilibriumInverseProblem.cpp:614
auto Eh(double value, std::string units) -> EquilibriumInverseProblem &
Fix the Eh of the aqueous solution (in units of volts).
Definition: EquilibriumInverseProblem.cpp:792
auto solve(ChemicalState &state) -> EquilibriumResult
Solve the inverse equilibrium problem.
Definition: EquilibriumInverseProblem.cpp:863
A type used to define the result of the evaluation of a system of equilibrium constraints.
Definition: EquilibriumInverseProblem.hpp:36
auto setPressure(double val) -> EquilibriumInverseProblem &
Set the pressure for the equilibrium calculation (in units of Pa).
Definition: EquilibriumInverseProblem.cpp:638
auto titrantInitialAmounts() const -> Vector
Return the initial amounts of titrants as initial guess for the inverse equilibrium calculation.
Definition: EquilibriumInverseProblem.cpp:853
auto system() const -> const ChemicalSystem &
Return a reference to the ChemicalSystem instance used to create this EquilibriumProblem instance.
Definition: EquilibriumInverseProblem.cpp:813
auto amount(double value, Index nspecies, Index ispecies) -> ChemicalScalarBase< double, decltype(tr(unit(nspecies, ispecies)))>
Return a ChemicalScalar representation of a mole amount of a species.
Definition: ChemicalScalar.hpp:233
A class to represent a system and its attributes and properties.
Definition: ChemicalSystem.hpp:38
auto fixSpeciesAmount(std::string species, double value, std::string units) -> EquilibriumInverseProblem &
Fix the molar amount of a species at equilibrium.
Definition: EquilibriumInverseProblem.cpp:662
Provides a computational representation of the state of a multiphase chemical system.
Definition: ChemicalState.hpp:61
auto fixSpeciesMass(std::string species, double value, std::string units) -> EquilibriumInverseProblem &
Fix the mass of a species at equilibrium.
Definition: EquilibriumInverseProblem.cpp:676
auto pressure() const -> double
Return the pressure for the equilibrium calculation (in units of Pa)
Definition: EquilibriumInverseProblem.cpp:828
auto elementInitialAmounts() const -> Vector
Return the initial amounts of elements in the equilibrium partition.
Definition: EquilibriumInverseProblem.cpp:848
auto numConstraints() const -> Index
Return the number of constraints used in the inverse equilibrium problem.
Definition: EquilibriumInverseProblem.cpp:833
auto fixPhaseMass(std::string phase, double value, std::string units, std::string titrant) -> EquilibriumInverseProblem &
Fix the total mass of a phase at equilibrium with given titrant.
Definition: EquilibriumInverseProblem.cpp:735
auto fixPhaseSetVolume(const std::vector< std::string > &phases, double value, std::string units, std::string titrant) -> EquilibriumInverseProblem &
Fix the total volume of a set of phases at equilibrium with given titrant.
Definition: EquilibriumInverseProblem.cpp:753
auto setTemperature(double val) -> EquilibriumInverseProblem &
Set the temperature for the equilibrium calculation (in units of K).
Definition: EquilibriumInverseProblem.cpp:626
A class used for defining an inverse equilibrium problem.
Definition: EquilibriumInverseProblem.hpp:57
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
Vector val
The residual values of the equilibrium constraints.
Definition: EquilibriumInverseProblem.hpp:38
auto partition() const -> const Partition &
Return a reference to the Partition instance used to create this EquilibriumProblem instance.
Definition: EquilibriumInverseProblem.cpp:818
auto alkalinity(double value, std::string units, std::string titrant) -> EquilibriumInverseProblem &
Fix the total alkalinity of the aqueous solution.
Definition: EquilibriumInverseProblem.cpp:805
auto formulaMatrixTitrants() const -> Matrix
Return the formula matrix of the titrants.
Definition: EquilibriumInverseProblem.cpp:843
auto fixPhaseAmount(std::string phase, double value, std::string units, std::string titrant) -> EquilibriumInverseProblem &
Fix the total molar amount of a phase at equilibrium with given titrant.
Definition: EquilibriumInverseProblem.cpp:726
auto add(std::string name, double amount, std::string units) -> EquilibriumInverseProblem &
Add a given amount of a compound or species to the initial equilibrium recipe.
Definition: EquilibriumInverseProblem.cpp:656
auto setPartition(const Partition &partition) -> EquilibriumInverseProblem &
Set the partition of the chemical system.
Definition: EquilibriumInverseProblem.cpp:620
auto residualEquilibriumConstraints(VectorConstRef x, const ChemicalState &state) const -> ResidualEquilibriumConstraints
Return the residuals of the equilibrium constraints and their partial derivatives.
Definition: EquilibriumInverseProblem.cpp:858
auto fixPhaseVolume(std::string phase, double value, std::string units, std::string titrant) -> EquilibriumInverseProblem &
Fix the volume of a phase at equilibrium with given titrant.
Definition: EquilibriumInverseProblem.cpp:744
virtual ~EquilibriumInverseProblem()
Destroy this EquilibriumInverseProblem instance.
Definition: EquilibriumInverseProblem.cpp:611
EquilibriumInverseProblem(const ChemicalSystem &system)
Construct an EquilibriumInverseProblem instance.
Definition: EquilibriumInverseProblem.cpp:603
auto setElementInitialAmounts(VectorConstRef values) -> EquilibriumInverseProblem &
Set the initial known molar amounts of the elements in the equilibrium partition.
Definition: EquilibriumInverseProblem.cpp:650
auto numTitrants() const -> Index
Return the number of titrants used in the inverse equilibrium problem.
Definition: EquilibriumInverseProblem.cpp:838
Matrix ddn
The partial derivatives of the residuals w.r.t. species amounts n.
Definition: EquilibriumInverseProblem.hpp:44
auto pH(double value) -> EquilibriumInverseProblem &
Fix the pH of the aqueous solution.
Definition: EquilibriumInverseProblem.cpp:762
Matrix ddx
The partial derivatives of the residuals w.r.t. titrant amounts x.
Definition: EquilibriumInverseProblem.hpp:41
Provide a computational representation of the Partition of a chemical system.
Definition: Partition.hpp:56
auto fixSpeciesActivity(std::string species, double value) -> EquilibriumInverseProblem &
Fix the activity of a species at equilibrium.
Definition: EquilibriumInverseProblem.cpp:689
auto fixSpeciesFugacity(std::string species, double value, std::string units) -> EquilibriumInverseProblem &
Fix the fugacity of a gaseous species.
Definition: EquilibriumInverseProblem.cpp:714
auto pE(double value) -> EquilibriumInverseProblem &
Fix the pe of the aqueous solution.
Definition: EquilibriumInverseProblem.cpp:780
Eigen::Ref< const Eigen::VectorXd > VectorConstRef
< Alias to Eigen type Ref<VectorXd>.
Definition: Matrix.hpp:31
A type used to describe the result of an equilibrium calculation.
Definition: EquilibriumResult.hpp:35
auto temperature() const -> double
Return the temperature for the equilibrium calculation (in units of K)
Definition: EquilibriumInverseProblem.cpp:823