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

Simplify and combine/collect/reduce variables in symbolic expression

tnichol
5-Regular Member

Simplify and combine/collect/reduce variables in symbolic expression

Hi,

 

I'm new to mathcad and I'm sure this is an easy thing to do but I can't for the life of me figure it out from documentation and existing threads.

 

All I'm trying to do is simplify the results of a symbolic evaluation. Right now, MathCAD is returning this:

Capture.JPG

 

It's pretty obvious that the RHS is equal to 5.758*F0/in^2.

There must be a way to get MathCAD to return this simplified form of the expression, right? Can somebody please show me how to do that?

 

Similarly, I have another expression in which MathCAD expresses units as in^2*psi.

Capture2.JPG

 

It would sure be nice to display those units as lbf. Does anybody know how to do that?

 

Thank you!

3 REPLIES 3
LucMeekes
23-Emerald III
(To:tnichol)

First of all: You should realize that the symbolic processor of Prime does not know units. It treats them as unknown variables (which it is happy to work with, by the way... the unknown variables that is).

If you want to solve something symbolically, then work fully (or as much as possible) symbolic.

Once you (or Prime) has solved symbolically, then plug in the numbers (with units if you like) to calculate a numeric result.

So make sigma.3 a function of all (not just F0) parameters that you need, then call it with the numerical values of the parameters filled in.

Another thing that may help: if you need numbers in your symbolic equation, enter them as much as possible in the form of integers: not 0.01, but 1/100. This 'll help keeping the results readable.

Finally: It is very hard to get the symbolic processor to show an answer exactly in the shape you want. You'll need to learn to live with this.

 

Success!
Luc

 

 

LucMeekes
23-Emerald III
(To:tnichol)

I'm using Mathcad 11. Your first expression could be:

LM_20181202_Simplify.png

Note that in order to get F0 from under the root, I have to tell Mathcad that F0 is positive. Otherwise Mathcad assumes it just might be negative, and that would introduce complex numbers. One more reason you don't always simply get what you expect from the symbolic processor.

 

Oh, and units: they don't always come out the way you want. You'll just have to put your desired unit(s) on the placeholder next to the result value. Why doesn't Mathcad/Prime just put the unit you wanted? Well, how would it know that you wanted N*m, if you multiplied a pressure in Pascal with a volume in cubic metres. So it just defaults to J...

 

Success!
Luc

Werner_E
25-Diamond I
(To:tnichol)

For the first symbolic simplification assuming F0>0 (maybe additionally in>0) should do the job.
You might consider posting your worksheet next time instead of just pics.

 

You may also use a numeric method in place of your second symbolic "solve".

"root" or a solve block will happily deal correctly with units.

Announcements

Top Tags