Skip to main content
18-Opal
March 26, 2021
Solved

Best Smoothing Approach

  • March 26, 2021
  • 1 reply
  • 7378 views

Hi

Help with smoothing function please.

I am having issues formulation a smoothing function. Errors like "This value must be a vector of real numbers: pop up.

A working example will help a lot. 

Prime 6 File Attached.

muser_0-1616730394451.png

 

Best answer by ppal_255687

l having problems plotting.

Mathcad and Excel file attached for your help please.

1 reply

25-Diamond I
March 26, 2021

Your approach failed because i is not a vector but a range!

In the pic below I used an undocumented trick to turn a range into a vector by adding a numeric evaluation when defining the variable i. Furthermore I chose the first value to be 1 instead of zero so the magnitude of i and r.dom match.

Werner_E_0-1616736919902.png

But of course you are on the save side if you define the necessary vector the "legal" way:

Werner_E_1-1616737210004.png

 

A working example can also be found in the help

https://support.ptc.com/help/mathcad/r6.0/en/index.html#page/PTC_Mathcad_Help%2Fexample_adaptive_smoothing.html%23wwID0EFBUV

 

You may also be interested in the information about smoothing in the MC15 help. Find it converted to pdf in the attachments.

 

16-Pearl
March 26, 2021

Is it possible to integrate the supsmooth function?

25-Diamond I
March 26, 2021

@DJF wrote:

Is it possible to integrate the supsmooth function?

 


supsmooth does not return a function but rather a vector of y-values corresponding to the vector of x-values provided.

You either can write your own "integration" function which works on datapoints given by vectors or you use interpolation (either linear or cubic splines) to turn the result of supsmooth into a function.