Skip to main content

skm

Apr
27
comment Resolve inconsistency regarding percentage of ionized water molecules in the auto-ionization of water
I'm getting a notice about extended comments, but perhaps one last question. In my understanding, activity is the "effective concentration" and for an elementary reaction, the effective concentration is the same as the concentration. So isn't the number "1" taken just for convenience? Strictly speaking should not the activity be 55.56? I'm saying this based on the definition of the equilibrium constant for $\alpha A + \beta B \rightleftharpoons \rho R + \sigma S$ as $K = \frac{x_{R}^{\rho}x_{S}^{\sigma}}{x_{A}^{\alpha}x_{B}^{\beta‌​}}$.
Apr
27
awarded Supporter
Apr
27
awarded Scholar
Apr
27
accepted Resolve inconsistency regarding percentage of ionized water molecules in the auto-ionization of water
Apr
27
comment Resolve inconsistency regarding percentage of ionized water molecules in the auto-ionization of water
Thank you very much for your explanation. Please also see my reply to your second comment above.
Apr
27
comment Resolve inconsistency regarding percentage of ionized water molecules in the auto-ionization of water
OK, so having read a little bit more, it seems like the "activity" for water should strictly be 55.56 (under standard conditions) - the same as concentration, but to simplify calculations, it is taken to be 1 (under standard conditions). Would this be a correct assessment?
Apr
27
comment Resolve inconsistency regarding percentage of ionized water molecules in the auto-ionization of water
One question is: Does this mean that the water ionization is not an elementary reaction - otherwise the equilibrium constant would be expressible in terms of the concentrations and the stoichiometric coefficients.
Apr
27
comment Resolve inconsistency regarding percentage of ionized water molecules in the auto-ionization of water
OK, I do know that the equilibrium constant is actually defined in terms of the activities of the substances involved and the activity of water is 1. So to get the ratio of molar concentrations, I would have to divide by 55.56 - that would give roughly 2 parts per billion. Thank You.
Apr
27
awarded Student
Apr
27
asked Resolve inconsistency regarding percentage of ionized water molecules in the auto-ionization of water
2023
Oct
13
comment Need class to expose a private static function via handle
Well, what do you know - both the code in the original post as well as the local function version work perfectly well on the mathworks site. So I have to conclude that this issue can be regarded as an undocumented bug in 2020a.
Oct
13
comment Need class to expose a private static function via handle
I'll try finding a recent Matlab version and running on that. It may be some time but I'll report back here. Thank you indeed for your efforts.
Oct
13
comment Need class to expose a private static function via handle
I did what the bug report suggested and used an intermediate variable pspec = ParamClass.param_spec; in the ParamClass constructor. Along with this change, I also inspected all the values in the debugger - all the values are as they are supposed to be. But I get the same error: "Unrecognized function or variable 'validate_param_2'". I am sure that there is no inadvertent error/typo - it is just a single file with the class definition and two local functions. I could post the modified code - but then I would have to answer my own question.
Oct
13
comment Need class to expose a private static function via handle
Just saw you last comment. Will check it out.
Oct
13
comment Need class to expose a private static function via handle
I'm testing with exactly the code posted on this thread. Are you using an anonymous wrapper @(x) validate_param_2(x)?
Oct
13
comment Need class to expose a private static function via handle
BTW, I'm using Matlab 2020a. Not sure if things are different in later versions.
Oct
13
comment Need class to expose a private static function via handle
Regarding my first comment, what I mean is that if "parse_my_args" is in the class file, and Matlab allows class file local functions to access private class members, then in theory, the initial problem in the original post should never have occurred.
Oct
13
comment Need class to expose a private static function via handle
Once I took validate_param_2 outside the class and made it into a local function, I access it via the cell array which now contains the anonymous function @(x) validate_param_2(x) (note: without the class namespace - there was a typo in the second comment). But I get the error "Unrecognized function or variable 'validate_param_2".
Oct
13
comment Need class to expose a private static function via handle
OK, sorry to continue this further, but in in the modified code that you posted, you have replaced @(x) ParamClass.validate_param_2(x) with @validate_param_2. The latter works, but the former does not with matlab giving the error (which occurs in the parse_my_args function) "Unrecognized function or variable 'validate_param_2". Unfortunately, in the original code, I need the anonymous wrapper as there are other variables involved.
Oct
13
comment Need class to expose a private static function via handle
Thank you. This more or less solves the problem. One additional issue, not directly related to the exact problem and which I did not notice yesterday, is that in my example code I have, for convenience, put the function parse_my_args" in the class file. However, despite being in the class file Matlab is not letting it access the class private static "validate_param_2" via the cell array, as is evident from the error.
1 2 3 4 5