Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
I find myself trying to solve a set of equations, which are a function of two variables (P2 and D), with different units (psi and pulg), whose values I intend to find out.
How I can deal with this problem?
Thank in advance
Solved! Go to Solution.
Bryan Pérez Pérez wrote:
I find myself trying to solve a set of equations, which are a function of two variables (P2 and D), with different units (psi and pulg), whose values I intend to find out.
How I can deal with this problem?
You deal with this problem exactly as you had done, but ...
... you haven't defined variable f
... you used function L.e with just one argument while ther should be two
... you have a unit mismatch in your first inequation (left side Re(D) is dimensionless, right side is in/psi) guess it should be P.2 instead of D on the RHS
... ???
I made the correction of the inequality, but still can not solve the problem
Bryan Pérez Pérez wrote:
I made the correction of the inequality, but still can not solve the problem
There are still my other two points missing.
1) You used your own function L.e wrong in the second equation of the sove block (argument D is missing)
2) f is missing. You cant't expect it to be calculated from the first equation unless you
a) provide an explicit function f(D,P.2):= ... or
b) you include f in the list of variables Mathcad should solve for - then you have to provide a guess value
At last I found the mistake of Le (P2, D).
About provide explicit function f (P2, D), the truth could not do, because for the calculations the value of this variable is calculated by iteration of equation I use in the calculations.
Bryan Pérez Pérez wrote:
At last I found the mistake of Le (P2, D).
About provide explicit function f (P2, D), the truth could not do, because for the calculations the value of this variable is calculated by iteration of equation I use in the calculations.
Sure you can define a function f(D) which calculates the value of f for any given value of D!
As f is inside and outside of the logarithm you won't find an analytic function but will have to define a numerical one to do the job (a small solve block turned into a function of D).
Your solution will not be unique because you have one equation less than variables to solve for and two inequality constraints.
Another problem: If you insist on the second inequality you will not get a solution near your guess values. Try instead 1000 psi and 20 in.
The truth do not quite understand how, appreciate if you could give me an example on the attached sheet about defining f
My apologies for being so slow, I could finally get it, thanks for everything Werner
With your instructions, I managed to solve the problem, in the same way that your first approach.
Again, thank you very much Werner
I tried to combine this question, with the answer to the question "Extract values from tables" but I can not get it to work. Hope you can help me.
Attachment worksheet with what I intend to do.
Thanks in advance
Bryan Pérez Pérez wrote:
I tried to combine this question, with the answer to the question "Extract values from tables" but I can not get it to work. Hope you can help me.
Attachment worksheet with what I intend to do.
At first you would have to turn all values which are dependent on L, H1, H2 and Nc into functions of those four variables and similar with all values which are dependent on P1,Tp,eta and Qb. A single varaible may now be a function in up to eight arguments.
Then you would have to turn the solbe block into a function of those four variables, too. This would probably mean that you have to get rid of the units temporarily as the result of that solve block function would be a vector with elements of different dimensions which is not allowed in Mathcad. After solving you can add the units again.
The last part is a routine which loops through all of your components, extracts the L, H1 etc values, call the solve block function and collects the result in a nice table.
Looks you now know what to do the next time as this probably is not done in just a quarter of an hour, depending on whoch special cases you'd like to consider as well.
You wrote that you already tried something but I don't see any attempt in the sheet you attached.
Give it a try and if you got stuck its probably better to open a new question concentrating specifically on the error you may encounter and are not able to solve on your own.
Forgive me for hijacking the conversation, but ...
Werner Exinger wrote:
This would probably mean that you have to get rid of the units temporarily as the result of that solve block function would be a vector with elements of different dimensions which is not allowed in Mathcad.
Increadible ! A feature that is avalable in Prime and not in Mathcad !
This is so rare I just had to mention it ! (and I don't know if I should laugh or cry about it ...)
Yes, it's one of the few features that we have been asking for for more than a decade that they have actually given us. I don't know what came over them.
Forgive them! They didn't mean it.
(In differential equations too!
When I finally get it, thank you very much for your advice Werner, served me pretty
Bryan Pérez Pérez wrote:
When I finally get it, thank you very much for your advice Werner, served me pretty
That means you already found a way to do what you asked for, right?
Yes; maybe it is not the best way, but so far it works well.
Attached the file with my solution
Bryan Pérez Pérez wrote:
Yes; maybe it is not the best way, but so far it works well.
Attached the file with my solution
Looks good for me. And I was wrong when I suspected that you would have to get rid of the units. I forgot that we can put two single functions in a 2x1 vector as you did - thats the better solution.
I could solve my problem thanks to your advice, and based on what was learned from my previous questions, so thank you.