Skip to main content
1-Visitor
January 28, 2015
Solved

Solve equation with variables of different units

  • January 28, 2015
  • 3 replies
  • 8276 views

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

Best answer by Werner_E

Here are two different approaches.

3 replies

25-Diamond I
January 28, 2015

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

... ???

BPP1-VisitorAuthor
1-Visitor
January 28, 2015

IMAGEN.png

I made the correction of the inequality, but still can not solve the problem

25-Diamond I
January 28, 2015

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

BPP1-VisitorAuthor
1-Visitor
January 28, 2015

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

25-Diamond I
January 28, 2015

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.

1-Visitor
January 28, 2015

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 ...)

BPP1-VisitorAuthor
1-Visitor
January 29, 2015

When I finally get it, thank you very much for your advice Werner, served me pretty

25-Diamond I
January 29, 2015

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?

1.png

BPP1-VisitorAuthor
1-Visitor
January 29, 2015

Yes; maybe it is not the best way, but so far it works well.

RESULTADO.png

Attached the file with my solution