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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Unable to evaluate a conditional expression (Prime 6)

SL_7995759
5-Regular Member

Unable to evaluate a conditional expression (Prime 6)

 Hi,

I'm working on a quite big automation tool.

I've come to a point where I'm making a function in one variable out of simple conditional statements with functions in more variables.

When I try to let Mathcad show me it's symbolic answer, it gives me an error:
"Unable to evaluate a conditional expression"

I checked above that this is not the case.

How can I solve this?

SL_7995759_0-1640010761592.pngSL_7995759_1-1640010776500.png

Thanks in advance!
Arne

1 ACCEPTED SOLUTION

Accepted Solutions
SL_7995759
5-Regular Member
(To:LucMeekes)

Hi LucMeekes,

thanks for your time! Don't ask me why, but I managed to get a solution by redefining the conditional statements to a variable:

SL_7995759_1-1640013216207.png

 

View solution in original post

12 REPLIES 12
LucMeekes
23-Emerald III
(To:SL_7995759)

Symbolic evaluation of programs is not supported in Prime, I guess.

 

Where did you "check above", I see only ONE symbolic evaluation on your sheet.

 

Success!
Luc

              

SL_7995759
5-Regular Member
(To:LucMeekes)

Any idea if writing the full statements out can do the trick?

SL_7995759_0-1640011909775.png

I see that in my file I get a 1 or 0 if a statement is or is not true. But when I try to use it in a formula, it doesn't give me 1 or 0 but the statement itself.

If I get a workaround like this, my problem is "solved" yet very timeconsuming for a lot of conditional and nested conditional functions.

 

SL_7995759
5-Regular Member
(To:LucMeekes)

With "check above" I meant that I checked if "the bigger and smaller than"-statements don't return an error outside of the function program

LucMeekes
23-Emerald III
(To:SL_7995759)

In Mathcad (not Prime), the following works:

LucMeekes_0-1640012210892.png

Guess you were looking for something like that...

 

Success!
Luc

SL_7995759
5-Regular Member
(To:LucMeekes)

Hi LucMeekes,

thanks for your time! Don't ask me why, but I managed to get a solution by redefining the conditional statements to a variable:

SL_7995759_1-1640013216207.png

 

LucMeekes
23-Emerald III
(To:SL_7995759)

Would it also work if you supply e.a as a parameter to the M.1 function (like I did)?

 

Did you notice that in your symbolic results, the kN and m are no longer units...?

There is a setting in Prime to have its symbolics be aware of units.

 

Success!
Luc

SL_7995759
5-Regular Member
(To:LucMeekes)

Doesn't seem to work unfortunately.

SL_7995759_0-1640015559380.png

 

As for the units, Prime does seem to identify the units correctly when values for x get inserted or the graph gets plotted:

SL_7995759_2-1640015924968.png

 

 

 


@SL_7995759 wrote:

Hi LucMeekes,

thanks for your time! Don't ask me why, but I managed to get a solution by redefining the conditional statements to a variable.


It worked because the numerical evaluation of a and b updated the values of a and b as perceived by the symbolic processor.   It would appear that, even with Units/Constants in Symbolics turned on, the symbolic processor doesn't handle comparisons involving units.

 

2021 12 21 a.png

 

Using SIUnitsOf doesn't help, either.

 

2021 12 21 b.png

 

But enabling those numerically evaluated assignments gets rid of the problem.

 

2021 12 21 c.png

 

I can't find much in the online Mathcad Help about the effects of in-line evaluation.

 

https://support.ptc.com/help/mathcad/r7.0/en/index.html#page/PTC_Mathcad_Help%2Fto_define_a_var_by_result.html%23

 

And even this doesn't (IMO) give a clear picture of what's happening.  It looks like Mathcad evaluates the rhs first (if it legally can) and then assigns the result to the variable rather than assigning the expression to the variable and then evaluating it.

 

Stuart

 

Sometimes telling the symbolics a little bit more about the units using "assume" helps, but sometimes it doesn't:

Werner_E_0-1640084975296.png

But of course its the very same like numerically inline evaluating xy. xy is assigned 1 that way and the symbolics don't go any further back into the definitions of x and y.

Hi,

I know this post has been answered but it is similar to a post earlier in the month dealing with loads on a beam.

Would be a shame if you are not made aware of the earlier post.

For uniform load on the whole span set w1 equal to w2, A to zero and B equal to L.

 

The enclosed file is Prime 7, can someone backdate it to Prime 6.

Have enclosed a PDF so if all else fails it can be created again in Prime 6.

 

Cheers

Terry

Capture.JPG

Here you go.

 

LucMeekes
23-Emerald III
(To:LucMeekes)

Apparently the plot on the sheet doesn't 'plot'. See here for a solution:

https://community.ptc.com/t5/PTC-Mathcad/Mathcad-Prime-Integrals-Are-Too-Slow/m-p/762776#M198690

 

Luc

Top Tags