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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Function that shows the equation that was used in a satisfied condition

MS_9880453
5-Regular Member

Function that shows the equation that was used in a satisfied condition

Hi, 

 

I'm not sure if my subject is correct. But I'm looking for function to show the formula or equation that was used in a variable especially if there are conditions that was used in the said variable. see example below. Variable Leh has 2 formulas that was conditioned based on the value of variable nv. if the first condition was satisfied, i want to display the formula instead of the result of the formula. Thank you

 

Sample.png

9 REPLIES 9

Probably your best bet is to return the expression as a string, if you can put up with the lack of subscription (and can tolerate, say, using a period (".") to indicate start of subscripts).

 

You may be able to play around with the symbolic processor (SP) to get the result you want, but invoking the symbolic processor both slows things down and may lead to undesirable side effects.

 

Stuart

 

 

MS_9880453
5-Regular Member
(To:StuartBruff)

hi, thanks for the reply, can you so me how to do it or can you give an example? 


@MS_9880453 wrote:

hi, thanks for the reply, can you so me how to do it or can you give an example? 


Terry's given you a Mathcad 15 example of returning the formula as a string.   Here's a Mathcad Prime 7 example using the symbolic processor.  I haven't got M15, but I *think* it should work in M15 if you use different Math Styles for the "formula" and "working" expression.

 

2021 09 07 C.png

Stuart

And here's a follow up to my previous message showing a symbolic solution ...

 

2021 09 07 D.png

LucMeekes
23-Emerald III
(To:StuartBruff)

Stuart,

there is a setting in Prime to make the Symbolic processor aware of units. It's a 'calculation option', you can set "Units/Constants in Symbolics".

LucMeekes_0-1631027414201.png

The online help explains:

LucMeekes_1-1631027490232.png

and more...

But the example with m+m above isn't very convincing to me... Pre mathcad15 does:

LucMeekes_0-1631027624033.png

For two different 'math styles', the first is a variable, the second is a unit (UserX style).

And of course:

LucMeekes_1-1631027934748.png

 

Success!
Luc

StuartBruff
23-Emerald II
(To:LucMeekes)

Thanks, Luc. I'd either forgotten and hadn't noticed (I don't play with units much.)

 

Cheers,

 

Stuart

And the worksheet (now updated with Luc's information) that I didn't attach before (*).

 

Stuart

 


 

(*) I've got the Mathcad Prime 7 trial running on a laptop with only 8 GiB RAM and an HDD, and it runs slower than a stunned snail if I open a browser as well as Mathcad ... it's only marginally faster if Prime is the only thing open!  

 

I'm reliant upon OneDrive to act as my repository and as the bridge between my Windows laptop and my MacBook (which I run the browser on).   OneDrive can be a bit tardy syncing between the two devices, so the worksheet wasn't available at the time I posted the images (courtesy of Evernote's screen capture facility and Evernote's quick syncing).

Hi,

Capture.JPG

LucMeekes
23-Emerald III
(To:MS_9880453)

How about:

LucMeekes_0-1631045365781.png

 

Success!
Luc

Top Tags