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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Symbolic Evaluation in Mathcad 15

regcurry
16-Pearl

Symbolic Evaluation in Mathcad 15

Refer to this post earlier today by me.

https://community.ptc.com/t5/Mathcad/Need-a-little-help-with-polynomial-regression-fitting-in-Mathcad/td-p/940392

In the attached code, I cannot get these symbolic evaluation to work.  They just keep running and never evaluate.

Screenshot 2024-03-30 133936.png

 

 

Any suggestions

Reg
ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:regcurry)

Make sure you undefine x numerically, before doing the symbolic. With x some range, the symbolic is trying to get a symbolic solution for each of the values of x, that takes time if x is a large range, and the symbolic result is going to be huge...

So put an

x := x

To the right and above your symbolic evaluation F1(x) ->

 

But, looking closer to your sheet, you have numeric data. What do you expect the symbolic evaluation to show?

Or is it just this:

LucMeekes_0-1711873752162.png

Success!
Luc

View solution in original post

6 REPLIES 6
LucMeekes
23-Emerald III
(To:regcurry)

Make sure you undefine x numerically, before doing the symbolic. With x some range, the symbolic is trying to get a symbolic solution for each of the values of x, that takes time if x is a large range, and the symbolic result is going to be huge...

So put an

x := x

To the right and above your symbolic evaluation F1(x) ->

 

But, looking closer to your sheet, you have numeric data. What do you expect the symbolic evaluation to show?

Or is it just this:

LucMeekes_0-1711873752162.png

Success!
Luc

Thanks.  I didn’t realize I needed to include the coeffs in F1 since I had defined it above.  
Again, thanks much.  I will do that.

I may have another question tomorrow on how to combine it with a fourier integral symbolically.

 

KucMeekes, you are always a big help!

Reg

Is this not working because I am using Mathcad 15?

 

regcurry_0-1711917406303.png

 

Reg

I got a little further.  The sum works this way, but not if I use last(coeffs) as upper bound on sum.  Why does it not like me using the coeffs vector elements either as an upper bound on the summation or just a constant in front of the integral?

Screenshot 2.png

 

Thanks much as always.

Reg
LucMeekes
23-Emerald III
(To:regcurry)

This may be dependent on how you got to coeffs... When you symbolically evaluate an expression involving coeffs, Mathcad will want to 'know' how coeffs got to get its values. If that involves operations that the symbolic processor does not support, then coeffs will be symbolically unsolved (that differs from being symbolically undefined).

Then why does it allow the upper left expression, you ask?...

Well the F1(z, coeffs) := ..... expression defines a function F1 of two parameters. You can use any parameter names  there. You chose z and coeffs, but you could have chosen a and b just as well, AS LONG AS you use those same names inside the definition (to the right-hand-side of the ;= (definition operator. The parameter coeffs in that function is NOT the variable coeffs that you have (numerically) defined (apparently, because numerical values of coeffs[0 and coeffs[1 are known) on worksheet level.

Now if you try to symbolically evaluate the F1 function with:

F12(z, coeffs) ->

then Mathcad uses the values of z and coeffs as they are defined on worksheet level. If one or both are undefined, then that's OK for the symbolic processor. It will use their (symbolic) names. If one or both are defined, it will use the definition. But if one or both cannot be solved symbolically, you get this error,

I hope this sheds some light.

 

Success!
Luc

 

P.S.

 

In Mathcad 11, I get this:

LucMeekes_1-1711924767471.png

Apparently the regress() function cannot be symbolically evaluated, so Mathcad simply uses the definition, symbolically.

I suppose Mathcad 15 will throw the undefined error.

 

Great. Thanks again.
Reg
Announcements

Top Tags