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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Translate the entire conversation x

How do I get Mathcad to give me the simplified version of an operation on 2 functions?

AP_12953245
10-Marble

How do I get Mathcad to give me the simplified version of an operation on 2 functions?

How do I get Mathcad to get from this:

AP_12953245_0-1740496552324.png

to this:

AP_12953245_1-1740496584930.png

without having to redefine f(x) myself?

4 REPLIES 4
Werner_E
25-Diamond I
(To:AP_12953245)

You may use symbolic evaluation to get an expanded view of the expression but I guess you wont get the summands in the order you show. Unfortunately, Prime does not offer many options to control the way the Symbolics displays its results.

Because you use the decimal point in your expression, the symbolics switch to some kind of float mode and ALL numbers are displayed with at least one decimal, which is quite silly and looks ugly.

Werner_E_0-1740497934276.png

The last result with the modifier "factor" is strange. The factor 1.0 actually should not be shown. It even may be called a bug that Prime does this.

 

For future questions please keep in mind to always attach you worksheet as well.

 

SPaulis
14-Alexandrite
(To:AP_12953245)

@AP_12953245 please keep in mind that Mathcad will not "redefine" f(x) for you in any way.  The methods described by Werner are only only intended to 'display' the result of the symbolic manipulation of expanding and collecting terms, and is very useful in validating your work or simplifying formulas you are trying to derive.  Since your formula is still technically valid in either form, there is no reason to redefine the function anyway—your original definition of f(x) will give you the correct output regardless.  Does this make sense?

Shawn P.
“It’s OK to fall in love with your heart. But, when it comes to making engineering decisions, don’t design with your heart.” – Blodgett, Omer W.
Werner_E
25-Diamond I
(To:SPaulis)

I agree that there is no reason for redefining the function based on the symbolic simplification.

I could be done that way

Werner_E_0-1740530912650.png

and indeed evaluation should be a little bit faster as the calculation  11+47 has not to be done every time you evaluate the function. But I doubt that this decrease of calc time would be noticeable - not even when done million times.

A redefinition would make sense if the original function definition is extremely time consuming and could be simplified symbolically - e.g. when using integrals as numerical integration is rather time consuming.

Here an example with a double integration. The non-simplified function definition takes more than 100 times longer:

Werner_E_1-1740531254483.png

 

Doing the same with the function given here does not show a significant improvement as expected

Werner_E_2-1740531687703.png

 

LucMeekes
23-Emerald IV
(To:AP_12953245)

How about:

LucMeekes_0-1740523505316.png

Success!
Luc

Announcements

Top Tags