function fromValues input Phase phase "Phase of the chemical solution"; input Real T = 298.15 "Temperature of the solution"; input Real p = 100000 "Pressure of the solution"; input Real v = 0 "Electric potential in the solution"; input Real n = 1 "Amount of the solution"; input Real m = 1 "Mass of the solution"; input Real V = if (phase == Phase.Gas) then n*(1.380649e-23*6.02214076e23)*T/p else 0.001 "Volume of the solution"; input Real G = 0 "Free Gibbs energy of the solution"; input Real Q = 0 "Electric charge of the solution"; input Real I = 0 "Mole fraction based ionic strength of the solution"; output SolutionState result(T = T, p = p, v = v, n = n, m = m, V = V, G = G, Q = Q, I = I); end fromValues;