> I am not sure if I understand you correctly, I was putting this below the solver block
When you wrote "Of your two suggestions, I prefer the second" I thought you were talking about my suggestion of defining a new function gg(Vb):=-log(g(Vb)) below the solve block which defines function g. A function which calls the solve block function g and using NO vectorization. All these functions are setup to deal with single scalar variables and are just later called vectorized with a vector of argument values. It can be seen in the picture I added to that post.
> What I thought I could do was add a second constraint like
You can, but you would have to use the boolean equal (the fat "=") and because you now have two unknowns, you would have to provide guesses for both and also solve for both, even though you are only interested in on of them.
Solving for both would create a function which returns a 2x1 vector (with H+ and ph) and as you are interested in pH only you would again have to define a further function which calls this solve block function and selects the desired value only. So there is no benefit compared to my suggestion with the follow up function gg(Vb).
By the way, is there a way to copy and paste something that you have written into my reply and show that it is a quote from your message?
Yes, but partial quoting is a bit cumbersome. You can use the quote button in the menu of the reply window

to add the whole post you are replying to and then delete the parts you don't need. Its often easier for me to simply copy and paste the line I'd like to quote and add a "greater than" character in front (which is what I am used to from another forum which does not offer any quoting functionality) as I did in the first line of this reply.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.



