cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Solving Equations for undefined variable with units

ptc-5478968
1-Newbie

Solving Equations for undefined variable with units

So, I am confused on how to solve an equation for an unknown with units. I am not sure if I am having unit problems or if my way of stating variables is incorrect. I am simply just trying to solve for the variable "d" which should have units in length. How should I declare variables that rely on other known and unknown variables? When should I solve an equation symbolically and just numerically in terms of getting proper units? I am used to using maple 16 so switching to MathCAD has been fairly intiutive but I am failing to pick up on certain features. If you fix my MathCAD code, I should be able to figure it out from the fix solution. Thanks!

equations.PNG

9 REPLIES 9

You have a unit balance problem.

Mass flow (Q/h) needs to be mass/time, your equation gives mass only.

mass flow is density times area times velocity, so velocity is mass flow/(area x density).

But area (of a circle) is pi x r squared, not the fourth power.

Start there

Hmm, now units won't cancel....

equations.PNG

Fred already commented on your unit problems, so I will deal with your Mathcad problems.

Get rid of the symbolic evaluation (right arrow) - you don't need it and it isn't aware of units.Treats them as unknown variables and so is not able to collect and simplify units.

When should I solve an equation symbolically and just numerically in terms of getting proper units?

Not solve, evaluate. And you don't need symbolic evaluation at all as you are doing just simple numeric calculations. If you don't like the units the normal numeric eval (=) yields, just overwrite the units with those you want and Mathcad will give you the correct value.

How should I declare variables that rely on other known and unknown variables?

known/defined variables: just use their name. You already did that

unknown variable you want to use late: you can't define a variable but must create a function.

Solve block: You probably used literature for Mathcad 15 (the better program anyway) or below. There is no "given" in Prime. Solve blocks are handled differently in Prime. You have to insert kind of an ugly template (ribbon Math, Solve Block), provide a guess value for the variable(s) to solve for and copy the equation(s) in this template. You may resize it but it still will look ugly.

See if the attached sheet helps but note that I haven't corrected your unit problem - I just added s^2 on the LHS so the units match and the solve block works.

Im sorry Werner but your attachment is corrupted somehow. I am unable to open it.

Thanks for your help. I think I will migragate over to Mathcad 15.

Im sorry Werner but your attachment is corrupted somehow. I am unable to open it.

The file I posted is in Prime3 format.

You didn't state which version of Prime you are using but if you have Prime2 all you will see when you try to open a Prime3 sheet is a blank page. Unfortunately PTC has decided that there should be no way to save/convert a Prime3 sheet to Prime2 format.

If thats the problem I could post a pdf of the file.

Yes, I only have Prime 2. This software is truly frusterating. Could you point out how to make my solve block work? Thank you for your continued patience and support. You could also upload a screenshot of the code, I can work from that.equations.PNG

Here is a pdf, but notice that I didn't fix the unit mismatch.

a and v have to be functions of d and you need to specify a guess value for d in the solve block to give the numerical algorithm a starting point. The choice of this guess value may influence the solution the solve block will come up with, but not in your case as your equation has five solutions and the found is the only real one.

Don't need a solve block!

One same my task - may by helps You:

4-HW.png

Top Tags