Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hello mathcad 10.0 Prime User,
I wanted to ask if someone knows how to use the the "solve-block" to find two missing variables in an equation. Or if there might be a different way? I am searching for h1u und h1o. And h1o depends on "a" and h1u.
Thanks for any help. The mathcad-file is attached.
Saro
Solved! Go to Solution.
There is no difference between "find" and "Find" - you may use both, they are equivalent.
You attempt fails because when you defined the guess value you typed h10 (with a zero as last character) and not h1o (with a lower case letter o).
EDIT: Just noticed that it was my fault - the picture I posted is the proof 😉
Not sure why the pic does not show the error - presumably because while playing with the sheet i had defined h1o somewhere above and this values was then used as the guess value (the guess value should, but must not be defined in the solve block).
You seem to have worked from the first version of my answer and there was a failure concerning the order of the variables h1u and h1o in the result vector. I corrected this in the meantime and also attached the Prime 10 sheet.
The difference between what you did and the example of mine you show is that the name of the variable/constant (Q) is different from the name of the function (Q.n). It would be possible for a function and a variable to coexist using the same name if you use different labels for them, but this makes subsequent usage of these names unnecessary cumbersome.
Avoiding equal names for different thing also was the reason I called the function q (lowercase) so I could use the expression q(hu)-Q in the "root" function without having care about applying correct labels.
You could do something similar by defining a function for the "Q-value" in two variables, but for the reasons explained above you should use a different name:
Concerning q=1m^3/s: The problem is not that Mathcad for some reason is not capable enough to find a solution but that no solution (at least no solution with real valued h1u and h1o) exists where the difference h1u-h10=a (= 30 cm).
You probably had not seen my edited answer where I made Q dependent on h1u only (function q) and showed that we only get real values for q if h1u is larger than a-hk0 and q start at approx. 1,5 m^3/s and gets larger with increasing values for h1u.
If you replace the 0,3 m for a by 0,2 m, you get an answer even for Q=1m^3/s.
Corrected Prime 10 sheet attached
Don't define a function Q(h1u) as this would overwrite the constant Q you defined before!
You also don't have to define a function h1o and you sure can't use h1u as if it would be a function (your wrote h1u(h1u).
What you tried to accomplish could be achieved that way:
But your system has no solution and so Prime cannot find a solution.
If you increase Q a solution can be found:
EDIT: There is still an error in the above pictures (and also in the attached sheet) concerning the name of the second guess value:
Its corrected in the sheet attached at my next answer here in the thread.
Lowest value you can demand for Q is about 1.522 m³/s - that's the value you get for h1o = -hk0(= -2.395 cm) and h1u = a - hk0 (= 27.641 cm).
Once you turned the task into a problem in only one variable, you could also use the "root" function to solve it:
Prime 10 sheet attached
Thank you again Werner.
However, I am a little bit confused. I will show you a solution you gave me once that worked for one thing. I thought if I write my equation above and define that my Q(x) is defined as my Q, that mathcad tries to find my missing variable "x". And what is the difference in "find" and "Find"?
And I tried the same thing as you now but it doesn't work - it says my variable is not defined.
You once showed me this:
What is the actuall difference in those two. I have my Q defined. But here it doesn't overwrite anything. Does this only work, when I am searching vor one variable? Or why do I have to write Q=Q(hn) in this case and for this problem I shoudn't?
And another question, you mean that there is no solution for Q = 1 m³/s or that Mathcad is just incapable of finding it? Because I can't understand how this can be? Since Q is known, the goal is to find two variables whose combination results in the given Q. Or is it because the other given variables are to high and therefore can never establish Q?
Thank you so much for always helping me. I learned so much in Mathcad in only a month. I really appreciate you.
Saro
There is no difference between "find" and "Find" - you may use both, they are equivalent.
You attempt fails because when you defined the guess value you typed h10 (with a zero as last character) and not h1o (with a lower case letter o).
EDIT: Just noticed that it was my fault - the picture I posted is the proof 😉
Not sure why the pic does not show the error - presumably because while playing with the sheet i had defined h1o somewhere above and this values was then used as the guess value (the guess value should, but must not be defined in the solve block).
You seem to have worked from the first version of my answer and there was a failure concerning the order of the variables h1u and h1o in the result vector. I corrected this in the meantime and also attached the Prime 10 sheet.
The difference between what you did and the example of mine you show is that the name of the variable/constant (Q) is different from the name of the function (Q.n). It would be possible for a function and a variable to coexist using the same name if you use different labels for them, but this makes subsequent usage of these names unnecessary cumbersome.
Avoiding equal names for different thing also was the reason I called the function q (lowercase) so I could use the expression q(hu)-Q in the "root" function without having care about applying correct labels.
You could do something similar by defining a function for the "Q-value" in two variables, but for the reasons explained above you should use a different name:
Concerning q=1m^3/s: The problem is not that Mathcad for some reason is not capable enough to find a solution but that no solution (at least no solution with real valued h1u and h1o) exists where the difference h1u-h10=a (= 30 cm).
You probably had not seen my edited answer where I made Q dependent on h1u only (function q) and showed that we only get real values for q if h1u is larger than a-hk0 and q start at approx. 1,5 m^3/s and gets larger with increasing values for h1u.
If you replace the 0,3 m for a by 0,2 m, you get an answer even for Q=1m^3/s.
Corrected Prime 10 sheet attached